Open 3D Engine AzFramework API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Camera::CameraComponentRequests Class Referenceabstract

#include <CameraBus.h>

Inherits AZ::ComponentBus.

Public Member Functions

virtual float GetFov ()
 
virtual float GetFovDegrees ()=0
 
virtual float GetFovRadians ()=0
 
virtual float GetNearClipDistance ()=0
 
virtual float GetFarClipDistance ()=0
 
virtual float GetFrustumWidth ()=0
 
virtual float GetFrustumHeight ()=0
 
virtual bool IsOrthographic ()=0
 
virtual float GetOrthographicHalfWidth ()=0
 
virtual void SetFov (float fov)
 
virtual void SetFovDegrees (float fovInDegrees)=0
 
virtual void SetFovRadians (float fovInRadians)=0
 
virtual void SetNearClipDistance (float nearClipDistance)=0
 
virtual void SetFarClipDistance (float farClipDistance)=0
 
virtual void SetFrustumWidth (float width)=0
 
virtual void SetFrustumHeight (float height)=0
 
virtual void SetOrthographic (bool orthographic)=0
 
virtual void SetOrthographicHalfWidth (float halfWidth)=0
 
virtual void SetXRViewQuaternion (const AZ::Quaternion &viewQuat, uint32_t xrViewIndex)=0
 
virtual void MakeActiveView ()=0
 Makes the camera the active view.
 
virtual bool IsActiveView ()=0
 Check if this camera is the active render camera.
 
virtual Configuration GetCameraConfiguration ()
 Get the camera frustum's aggregate configuration.
 
virtual AZ::Vector3 ScreenToWorld (const AZ::Vector2 &screenPosition, float depth)=0
 
virtual AZ::Vector3 ScreenNdcToWorld (const AZ::Vector2 &screenNdcPosition, float depth)=0
 
virtual AZ::Vector2 WorldToScreen (const AZ::Vector3 &worldPosition)=0
 
virtual AZ::Vector2 WorldToScreenNdc (const AZ::Vector3 &worldPosition)=0
 

Detailed Description

Use this bus to send messages to a camera component on an entity If you create your own camera you should implement this bus Call like this: Camera::CameraRequestBus::Event(cameraEntityId, &Camera::CameraRequestBus::Events::SetFov, newFov);

Member Function Documentation

◆ GetFarClipDistance()

virtual float Camera::CameraComponentRequests::GetFarClipDistance ( )
pure virtual

Gets the camera's distance from the far clip plane in meters

Returns
The camera's distance from the far clip plane in meters

◆ GetFov()

virtual float Camera::CameraComponentRequests::GetFov ( )
inlinevirtual

Gets the camera's field of view in degrees

Returns
The camera's field of view in degrees

◆ GetFovDegrees()

virtual float Camera::CameraComponentRequests::GetFovDegrees ( )
pure virtual

Gets the camera's field of view in degrees

Returns
The camera's field of view in degrees

◆ GetFovRadians()

virtual float Camera::CameraComponentRequests::GetFovRadians ( )
pure virtual

Gets the camera's field of view in radians

Returns
The camera's field of view in radians

◆ GetFrustumHeight()

virtual float Camera::CameraComponentRequests::GetFrustumHeight ( )
pure virtual

Gets the camera frustum's height

Returns
The camera frustum's height

◆ GetFrustumWidth()

virtual float Camera::CameraComponentRequests::GetFrustumWidth ( )
pure virtual

Gets the camera frustum's width

Returns
The camera frustum's width

◆ GetNearClipDistance()

virtual float Camera::CameraComponentRequests::GetNearClipDistance ( )
pure virtual

Gets the camera's distance from the near clip plane in meters

Returns
The camera's distance from the near clip plane in meters

◆ GetOrthographicHalfWidth()

virtual float Camera::CameraComponentRequests::GetOrthographicHalfWidth ( )
pure virtual
Returns
The half width of the orthographic projection,
See also
SetOrthographicHalfWidth.

◆ IsOrthographic()

virtual bool Camera::CameraComponentRequests::IsOrthographic ( )
pure virtual

Gets whether or not the camera is using an orthographic projection.

Returns
True if the camera is using an orthographic projection, or false if the camera is using a perspective projection.

◆ ScreenNdcToWorld()

virtual AZ::Vector3 Camera::CameraComponentRequests::ScreenNdcToWorld ( const AZ::Vector2 &  screenNdcPosition,
float  depth 
)
pure virtual

Unprojects a position in screen space normalized device coordinates to world space. With a depth of zero, the position returned will be on the near clip plane of the camera in world space.

Parameters
screenNdcPositionThe normalized device coordinates in the range [0,1]
depthThe depth offset into the world relative to the near clip plane of the camera
Returns
the position in world space

◆ ScreenToWorld()

virtual AZ::Vector3 Camera::CameraComponentRequests::ScreenToWorld ( const AZ::Vector2 &  screenPosition,
float  depth 
)
pure virtual

Unprojects a position in screen space pixel coordinates to world space. With a depth of zero, the position returned will be on the near clip plane of the camera in world space.

Parameters
screenPositionThe absolute screen position
depthThe depth offset into the world relative to the near clip plane of the camera
Returns
the position in world space

◆ SetFarClipDistance()

virtual void Camera::CameraComponentRequests::SetFarClipDistance ( float  farClipDistance)
pure virtual

Sets the far clip plane to a given distance from the camera in meters.

Parameters
farClipDistanceThe camera frustum's new far clip plane distance from camera

◆ SetFov()

virtual void Camera::CameraComponentRequests::SetFov ( float  fov)
inlinevirtual

Sets the camera's field of view in degrees between 0 < fov < 180 degrees

Parameters
fovThe camera frustum's new field of view in degrees

◆ SetFovDegrees()

virtual void Camera::CameraComponentRequests::SetFovDegrees ( float  fovInDegrees)
pure virtual

Sets the camera's field of view in degrees between 0 < fov < 180 degrees

Parameters
fovThe camera frustum's new field of view in degrees

◆ SetFovRadians()

virtual void Camera::CameraComponentRequests::SetFovRadians ( float  fovInRadians)
pure virtual

Sets the camera's field of view in radians between 0 < fov < pi radians

Parameters
fovThe camera frustum's new field of view in radians

◆ SetFrustumHeight()

virtual void Camera::CameraComponentRequests::SetFrustumHeight ( float  height)
pure virtual

Sets the camera frustum's height

Parameters
heightThe camera frustum's new height

◆ SetFrustumWidth()

virtual void Camera::CameraComponentRequests::SetFrustumWidth ( float  width)
pure virtual

Sets the camera frustum's width

Parameters
widthThe camera frustum's new width

◆ SetNearClipDistance()

virtual void Camera::CameraComponentRequests::SetNearClipDistance ( float  nearClipDistance)
pure virtual

Sets the near clip plane to a given distance from the camera in meters. Should be small, but greater than 0

Parameters
nearClipDistanceThe camera frustum's new near clip plane distance from camera

◆ SetOrthographic()

virtual void Camera::CameraComponentRequests::SetOrthographic ( bool  orthographic)
pure virtual

Sets whether or not the camera should use an orthographic projection in place of a perspective projection.

Parameters
orthographicIf true, the camera will use an orthographic projection

◆ SetOrthographicHalfWidth()

virtual void Camera::CameraComponentRequests::SetOrthographicHalfWidth ( float  halfWidth)
pure virtual

Sets the half-width of the orthographic projection. @params halfWidth Used to calculate the bounds of the projection while in orthographic mode. The height is calculated automatically based on the aspect ratio.

◆ SetXRViewQuaternion()

virtual void Camera::CameraComponentRequests::SetXRViewQuaternion ( const AZ::Quaternion &  viewQuat,
uint32_t  xrViewIndex 
)
pure virtual

Sets the Quaternion related to a stereoscopic view for a camera with the provided view index related to your eye. @params viewQuat Used to cache view orientation data from the XR device @params xrViewIndex View index related to the pipeline associated with a specific eye

◆ WorldToScreen()

virtual AZ::Vector2 Camera::CameraComponentRequests::WorldToScreen ( const AZ::Vector3 &  worldPosition)
pure virtual

Projects a position in world space to screen space for the given camera.

Parameters
worldPositionThe world position
Returns
The absolute screen position

◆ WorldToScreenNdc()

virtual AZ::Vector2 Camera::CameraComponentRequests::WorldToScreenNdc ( const AZ::Vector3 &  worldPosition)
pure virtual

Projects a position in world space to screen space normalized device coordinates.

Parameters
worldPositionThe world position
Returns
The normalized device coordinates in the range [0,1]

The documentation for this class was generated from the following file: