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

#include <EditorCameraBus.h>

Inherits AZ::EBusTraits.

Public Types

using Bus = AZ::EBus< EditorCameraRequests >
 

Public Member Functions

virtual void SetViewFromEntityPerspective (const AZ::EntityId &)
 
virtual AZ::EntityId GetCurrentViewEntityId ()
 
virtual bool GetActiveCameraPosition (AZ::Vector3 &)
 
virtual AZStd::optional< AZ::Transform > GetActiveCameraTransform ()
 
virtual AZStd::optional< float > GetCameraFoV ()
 
virtual bool GetActiveCameraState (AzFramework::CameraState &cameraState)
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

This bus allows you to get and set the current editor viewport camera

Member Function Documentation

◆ GetActiveCameraPosition()

virtual bool Camera::EditorCameraRequests::GetActiveCameraPosition ( AZ::Vector3 &  )
inlinevirtual

Gets the position of the currently active Editor camera. The Editor can have multiple viewports displayed, though at most only one is active at any point in time. (Active is not the same as "has focus" - a different editor pane can have focus, but there's still one active viewport that's updating every frame, and the others are not)

Parameters
cameraPosOn return, the current camera position in the one active Editor viewport.
Returns
True if the camera position was successfully retrieved, false if not.

◆ GetActiveCameraState()

virtual bool Camera::EditorCameraRequests::GetActiveCameraState ( AzFramework::CameraState &  cameraState)
inlinevirtual

Gets the position of the currently active Editor camera. The Editor can have multiple viewports displayed, though at most only one is active at any point in time. (Active is not the same as "has focus" - a different editor pane can have focus, but there's still one active viewport that's updating every frame, and the others are not).

Parameters
cameraViewThe current camera view in the one active Editor viewport.
Returns
True if the camera view was successfully retrieved, false if not.

◆ GetActiveCameraTransform()

virtual AZStd::optional< AZ::Transform > Camera::EditorCameraRequests::GetActiveCameraTransform ( )
inlinevirtual

Gets the transform of the currently active Editor camera. The Editor can have multiple viewports displayed, though at most only one is active at any point in time. (Active is not the same as "has focus" - a different editor pane can have focus, but there's still one active viewport that's updating every frame, and the others are not)

Returns
the current camera transform in the one active Editor viewport.

◆ GetCameraFoV()

virtual AZStd::optional< float > Camera::EditorCameraRequests::GetCameraFoV ( )
inlinevirtual

Gets the field of view of the currently active Editor camera. The Editor can have multiple viewports displayed, though at most only one is active at any point in time. (Active is not the same as "has focus" - a different editor pane can have focus, but there's still one active viewport that's updating every frame, and the others are not)

Returns
the current camera field of view in the one active Editor viewport.

◆ GetCurrentViewEntityId()

virtual AZ::EntityId Camera::EditorCameraRequests::GetCurrentViewEntityId ( )
inlinevirtual

Gets the id of the current view entity. Invalid EntityId is returned for the default editor camera

Returns
the entityId of the entity currently being used as the view. The Invalid entity id is returned for the default editor camera

◆ SetViewFromEntityPerspective()

virtual void Camera::EditorCameraRequests::SetViewFromEntityPerspective ( const AZ::EntityId &  )
inlinevirtual

Sets the view from the entity's perspective

Parameters
entityIdthe id of the entity whose perspective is to be used

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