Menu
Lumberyard
C++ API Reference (Version 1.10)

AZ::TransformInterface Class Reference abstract

Open 3D Engine (O3DE), the successor to Lumberyard, is now available in Developer Preview. Download O3DE or visit the AWS Game Tech blog to learn more.

Interface for AZ::TransformBus , which is an EBus that receives requests to translate (position), rotate, and scale an entity in 3D space. More...

Inherits AZ::ComponentBus .

Public Member Functions

virtual ~TransformInterface ()
A destructor. More...
virtual const Transform & GetLocalTM ()=0
Returns the entity's local transform, not including the parent transform. More...
virtual void SetLocalTM (const Transform &)
Sets the entity's local transform and notifies all listeners. More...
virtual const Transform & GetWorldTM ()=0
Returns the entity's world transform, including the parent transform. More...
virtual void SetWorldTM (const Transform &)
Sets the world transform and notifies all listeners. More...
virtual void GetLocalAndWorld (Transform &, Transform &)
Retrieves the entity's local and world transforms. More...
virtual void SetWorldTranslation (const AZ::Vector3 &)
Sets the entity's world space translation, which represents how to move the entity to a new position within the world. More...
virtual void SetLocalTranslation (const AZ::Vector3 &)
Sets the entity's local space translation, which represents how to move the entity to a new position relative to its parent. More...
virtual AZ::Vector3 GetWorldTranslation ()
Gets the entity's world space translation. More...
virtual AZ::Vector3 GetLocalTranslation ()
Gets the entity's local space translation. More...
virtual void MoveEntity (const AZ::Vector3 &)
Moves the entity within world space. More...
virtual void SetWorldX (float)
Sets the entity's X coordinate in world space. More...
virtual void SetWorldY (float)
Sets the entity's Y coordinate in world space. More...
virtual void SetWorldZ (float)
Sets the entity's Z coordinate in world space. More...
virtual float GetWorldX ()
Gets the entity's X coordinate in world space. More...
virtual float GetWorldY ()
Gets the entity's Y coordinate in world space. More...
virtual float GetWorldZ ()
Gets the entity's Z coordinate in world space. More...
virtual void SetLocalX (float)
Sets the entity's X coordinate in local space. More...
virtual void SetLocalY (float)
Sets the entity's Y coordinate in local space. More...
virtual void SetLocalZ (float)
Sets the entity's Z coordinate in local space. More...
virtual float GetLocalX ()
Gets the entity's X coordinate in local space. More...
virtual float GetLocalY ()
Gets the entity's Y coordinate in local space. More...
virtual float GetLocalZ ()
Gets the entity's Z coordinate in local space. More...
virtual void SetRotation (const AZ::Vector3 &)
Deprecated. More...
virtual void SetRotationX (float)
Deprecated. More...
virtual void SetRotationY (float)
Deprecated. More...
virtual void SetRotationZ (float)
Deprecated. More...
virtual void SetRotationQuaternion (const AZ::Quaternion &)
Deprecated. More...
virtual void RotateByX (float)
Deprecated. More...
virtual void RotateByY (float)
Deprecated. More...
virtual void RotateByZ (float)
Deprecated. More...
virtual AZ::Vector3 GetRotationEulerRadians ()
Deprecated. More...
virtual AZ::Quaternion GetRotationQuaternion ()
Deprecated. More...
virtual float GetRotationX ()
Deprecated. More...
virtual float GetRotationY ()
Deprecated. More...
virtual float GetRotationZ ()
Deprecated. More...
virtual AZ::Vector3 GetWorldRotation ()
Gets the entity's rotation in radians in world space. More...
virtual AZ::Quaternion GetWorldRotationQuaternion ()
Gets the entity's rotation in quaternion in world space. More...
virtual void SetLocalRotation (const AZ::Vector3 &)
Sets the entity's rotation in local space using a composition of rotations around the three axes. More...
virtual void SetLocalRotationQuaternion (const AZ::Quaternion &)
Sets the entity's rotation in local space using a quaternion. More...
virtual void RotateAroundLocalX (float)
Rotates the entity around the X axis in local space. More...
virtual void RotateAroundLocalY (float)
Rotates the entity around the Y axis in local space. More...
virtual void RotateAroundLocalZ (float)
Rotates the entity around the Z axis in local space. More...
virtual AZ::Vector3 GetLocalRotation ()
Gets the entity's rotation in radians in local space. More...
virtual AZ::Quaternion GetLocalRotationQuaternion ()
Gets the quaternion representing the entity's rotation in local space. More...
virtual void SetScale (const AZ::Vector3 &)
Deprecated. More...
virtual void SetScaleX (float)
Deprecated. More...
virtual void SetScaleY (float)
Deprecated. More...
virtual void SetScaleZ (float)
Deprecated. More...
virtual AZ::Vector3 GetScale ()
Deprecated. More...
virtual float GetScaleX ()
Deprecated. More...
virtual float GetScaleY ()
Deprecated. More...
virtual float GetScaleZ ()
Deprecated. More...
virtual void SetLocalScale (const AZ::Vector3 &)
Scales the entity in local space. More...
virtual void SetLocalScaleX (float)
Scales the entity along the X axis in local space. More...
virtual void SetLocalScaleY (float)
Scales the entity along the Y axis in local space. More...
virtual void SetLocalScaleZ (float)
Scales the entity along the Z axis in local space. More...
virtual AZ::Vector3 GetLocalScale ()
Gets the scale of the entity along each axis in local space. More...
virtual AZ::Vector3 GetWorldScale ()
Gets the scale of the entity along each axis in world space. More...
virtual EntityId GetParentId ()
Returns the entity ID of the entity's parent. More...
virtual TransformInterface * GetParent ()
Returns the transform interface of the parent entity. More...
virtual void SetParent ( EntityId )
Sets the entity's parent entity and notifies all listeners. More...
virtual void SetParentRelative ( EntityId )
Sets the entity's parent entity, moves the transform relative to the parent entity, and notifies all listeners. More...
virtual AZStd::vector< AZ::EntityId > GetChildren ()
Returns the entity IDs of the entity's immediate children. More...
virtual AZStd::vector< AZ::EntityId > GetAllDescendants ()
Returns the entity IDs of all descendants of the entity. More...
virtual AZStd::vector< AZ::EntityId > GetEntityAndAllDescendants ()
Returns the entity ID of the entity and all its descendants. More...
virtual bool IsStaticTransform ()=0
Returns whether the transform is static. More...
- Public Member Functions inherited from AZ::ComponentBus
virtual ~ComponentBus ()=default
Destroys a component bus. More...

Static Public Attributes

static const EBusHandlerPolicy HandlerPolicy
Overrides the default AZ::EBusTraits handler policy to allow one listener only. More...
- Static Public Attributes inherited from AZ::ComponentBus
static const EBusAddressPolicy AddressPolicy
Overrides the default AZ::EBusTraits address policy so that the bus has multiple addresses at which to receive messages. More...
- Static Public Attributes inherited from AZ::EBusTraits
static const EBusHandlerPolicy HandlerPolicy
Defines how many handlers can connect to an address on the EBus and the order in which handlers at each address receive events. More...
static const EBusAddressPolicy AddressPolicy
Defines how many addresses exist on the EBus . More...
static const bool EnableEventQueue
Specifies whether the EBus supports an event queue. More...

Additional Inherited Members

- Public Types inherited from AZ::ComponentBus
typedef EntityId BusIdType
Overrides the default AZ::EBusTraits ID type so that entity IDs are used to access the addresses of the bus. More...
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZStd::allocator
Allocator used by the EBus . More...
using BusIdType = NullBusId
The type of ID that is used to address the EBus . More...
using BusIdOrderCompare = NullBusIdCompare
Sorting function for EBus address IDs. More...
using BusHandlerOrderCompare = BusHandlerCompareDefault
Sorting function for EBus event handlers. More...
using MutexType = NullMutex
Locking primitive that is used when connecting handlers to the EBus or executing events. More...
using EventQueueMutexType = NullMutex
Locking primitive that is used when adding and removing events from the queue. More...
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy < Bus >
Enables custom logic to run when a handler connects or disconnects from the EBus . More...
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy < Context >
Specifies where EBus data is stored. More...
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
Controls the flow of EBus events. More...
- Protected Member Functions inherited from AZ::EBusTraits
~EBusTraits ()=default
A destructor. More...

Detailed Description

Interface for AZ::TransformBus , which is an EBus that receives requests to translate (position), rotate, and scale an entity in 3D space.

It also receives requests to get and set the parent of an entity and get the descendants of an entity.

An entity's local transform is the entity's position relative to its parent entity. An entity's world transform is the entity's position within the entire game space.

Constructor & Destructor Documentation

~TransformInterface()

virtual AZ::TransformInterface::~TransformInterface ( )
inline virtual

A destructor.

Member Function Documentation

GetAllDescendants()

virtual AZStd::vector< AZ::EntityId > AZ::TransformInterface::GetAllDescendants ( )
inline virtual

Returns the entity IDs of all descendants of the entity.

The descendants are the entity's children, the children's children, and so on. The entity IDs are ordered breadth-first.

Returns
A vector that contains the entity IDs of the descendants.

GetChildren()

virtual AZStd::vector< AZ::EntityId > AZ::TransformInterface::GetChildren ( )
inline virtual

Returns the entity IDs of the entity's immediate children.

Returns
A vector that contains the entity IDs of the entity's immediate children.

GetEntityAndAllDescendants()

virtual AZStd::vector< AZ::EntityId > AZ::TransformInterface::GetEntityAndAllDescendants ( )
inline virtual

Returns the entity ID of the entity and all its descendants.

The descendants are the entity's children, the children's children, and so on. The entity IDs are ordered breadth-first and this entity's ID is the first in the list.

Returns
A vector that contains the entity ID of the entity followed by the entity IDs of its descendants.

GetLocalAndWorld()

virtual void AZ::TransformInterface::GetLocalAndWorld ( Transform & ,
Transform &
)
inline virtual

Retrieves the entity's local and world transforms.

Parameters
[out] localTM A reference to a transform that represents the entity's position relative to its parent entity.
[out] worldTM A reference to a transform that represents the entity's position within the world.

GetLocalRotation()

virtual AZ::Vector3 AZ::TransformInterface::GetLocalRotation ( )
inline virtual

Gets the entity's rotation in radians in local space.

Returns
A three-dimensional vector, containing Euler angles in radians, that specifies the entity's rotation around each axis in local space. The order of the values in the vector is Z axis, Y axis, and then X axis.

GetLocalRotationQuaternion()

virtual AZ::Quaternion AZ::TransformInterface::GetLocalRotationQuaternion ( )
inline virtual

Gets the quaternion representing the entity's rotation in local space.

Returns
The rotation quaternion in local space.

GetLocalScale()

virtual AZ::Vector3 AZ::TransformInterface::GetLocalScale ( )
inline virtual

Gets the scale of the entity along each axis in local space.

Returns
A three-dimensional vector that represents the scale of the entity in local space.

GetLocalTM()

virtual const Transform& AZ::TransformInterface::GetLocalTM ( )
pure virtual

Returns the entity's local transform, not including the parent transform.

Returns
A reference to a transform that represents the entity's position relative to its parent entity.

GetLocalTranslation()

virtual AZ::Vector3 AZ::TransformInterface::GetLocalTranslation ( )
inline virtual

Gets the entity's local space translation.

Returns
A three-dimensional translation vector.

GetLocalX()

virtual float AZ::TransformInterface::GetLocalX ( )
inline virtual

Gets the entity's X coordinate in local space.

Returns
The entity's X coordinate in local space.

GetLocalY()

virtual float AZ::TransformInterface::GetLocalY ( )
inline virtual

Gets the entity's Y coordinate in local space.

Returns
The entity's Y coordinate in local space.

GetLocalZ()

virtual float AZ::TransformInterface::GetLocalZ ( )
inline virtual

Gets the entity's Z coordinate in local space.

Returns
The entity's Z coordinate in local space.

GetParent()

virtual TransformInterface * AZ::TransformInterface::GetParent ( )
inline virtual

Returns the transform interface of the parent entity.

Returns
A pointer to the transform interface of the parent. Returns a null pointer if no parent is set or the parent entity is not currently activated.

GetParentId()

virtual EntityId AZ::TransformInterface::GetParentId ( )
inline virtual

Returns the entity ID of the entity's parent.

Returns
The entity ID of the parent. The entity ID is invalid if the entity does not have a parent with a valid entity ID.

GetRotationEulerRadians()

virtual AZ::Vector3 AZ::TransformInterface::GetRotationEulerRadians ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalRotation() instead.

GetRotationQuaternion()

virtual AZ::Quaternion AZ::TransformInterface::GetRotationQuaternion ( )
inline virtual

GetRotationX()

virtual float AZ::TransformInterface::GetRotationX ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalRotation() instead.

GetRotationY()

virtual float AZ::TransformInterface::GetRotationY ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalRotation() instead.

GetRotationZ()

virtual float AZ::TransformInterface::GetRotationZ ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalRotation() instead.

GetScale()

virtual AZ::Vector3 AZ::TransformInterface::GetScale ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalScale() instead.

GetScaleX()

virtual float AZ::TransformInterface::GetScaleX ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalScale() instead.

GetScaleY()

virtual float AZ::TransformInterface::GetScaleY ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalScale() instead.

GetScaleZ()

virtual float AZ::TransformInterface::GetScaleZ ( )
inline virtual

Deprecated.

Deprecated:
Use GetLocalScale() instead.

GetWorldRotation()

virtual AZ::Vector3 AZ::TransformInterface::GetWorldRotation ( )
inline virtual

Gets the entity's rotation in radians in world space.

Returns
A three-dimensional vector, containing Euler angles in radians, that represents the entity's rotation around each axis in world space. The order of the values in the vector is Z axis, Y axis, and then X axis.

GetWorldRotationQuaternion()

virtual AZ::Quaternion AZ::TransformInterface::GetWorldRotationQuaternion ( )
inline virtual

Gets the entity's rotation in quaternion in world space.

Returns
A quaternion that represents the entity's rotation in world space.

GetWorldScale()

virtual AZ::Vector3 AZ::TransformInterface::GetWorldScale ( )
inline virtual

Gets the scale of the entity along each axis in world space.

Note
When the entity is rotated and its parent entity is scaled, the transform is skewed. In this case, the value that this function returns is inaccurate.
Returns
A three-dimensional vector that represents the scale of the entity in world space.

GetWorldTM()

virtual const Transform& AZ::TransformInterface::GetWorldTM ( )
pure virtual

Returns the entity's world transform, including the parent transform.

Returns
A reference to a transform that represents the entity's position within the world.

GetWorldTranslation()

virtual AZ::Vector3 AZ::TransformInterface::GetWorldTranslation ( )
inline virtual

Gets the entity's world space translation.

Returns
A three-dimensional translation vector.

GetWorldX()

virtual float AZ::TransformInterface::GetWorldX ( )
inline virtual

Gets the entity's X coordinate in world space.

Returns
The entity's X coordinate in world space.

GetWorldY()

virtual float AZ::TransformInterface::GetWorldY ( )
inline virtual

Gets the entity's Y coordinate in world space.

Returns
The entity's Y coordinate in world space.

GetWorldZ()

virtual float AZ::TransformInterface::GetWorldZ ( )
inline virtual

Gets the entity's Z coordinate in world space.

Returns
The entity's Z coordinate in world space.

IsStaticTransform()

virtual bool AZ::TransformInterface::IsStaticTransform ( )
pure virtual

Returns whether the transform is static.

A static transform is unmovable and does not respond to requests that would move it.

Returns
True if the transform is static, false if the transform is movable.

MoveEntity()

virtual void AZ::TransformInterface::MoveEntity ( const AZ::Vector3 & )
inline virtual

Moves the entity within world space.

Parameters
offset A three-dimensional vector that contains the offset to apply to the entity.

RotateAroundLocalX()

virtual void AZ::TransformInterface::RotateAroundLocalX ( float )
inline virtual

Rotates the entity around the X axis in local space.

Parameters
eulerRadianAngle The angle, in radians, to rotate the entity around the X axis in local space.

RotateAroundLocalY()

virtual void AZ::TransformInterface::RotateAroundLocalY ( float )
inline virtual

Rotates the entity around the Y axis in local space.

Parameters
eulerRadianAngle The angle, in radians, to rotate the entity around the Y axis in local space.

RotateAroundLocalZ()

virtual void AZ::TransformInterface::RotateAroundLocalZ ( float )
inline virtual

Rotates the entity around the Z axis in local space.

Parameters
eulerRadianAngle The angle, in radians, to rotate the entity around the Z axis in local space.

RotateByX()

virtual void AZ::TransformInterface::RotateByX ( float )
inline virtual

Deprecated.

Deprecated:
Use RotateAroundLocalX() instead.

RotateByY()

virtual void AZ::TransformInterface::RotateByY ( float )
inline virtual

Deprecated.

Deprecated:
Use RotateAroundLocalY() instead.

RotateByZ()

virtual void AZ::TransformInterface::RotateByZ ( float )
inline virtual

Deprecated.

Deprecated:
Use RotateAroundLocalZ() instead.

SetLocalRotation()

virtual void AZ::TransformInterface::SetLocalRotation ( const AZ::Vector3 & )
inline virtual

Sets the entity's rotation in local space using a composition of rotations around the three axes.

Parameters
eulerRadianAngles A three-dimensional vector, containing Euler angles in radians, that specifies a rotation around each axis. The order of the values in the vector is Z axis, Y axis, and then X axis.

SetLocalRotationQuaternion()

virtual void AZ::TransformInterface::SetLocalRotationQuaternion ( const AZ::Quaternion & )
inline virtual

Sets the entity's rotation in local space using a quaternion.

Parameters
quaternion A quaternion representing the rotation to set.

SetLocalScale()

virtual void AZ::TransformInterface::SetLocalScale ( const AZ::Vector3 & )
inline virtual

Scales the entity in local space.

Parameters
scale A three-dimensional vector that represents the multipliers with which to scale the entity in local space.

SetLocalScaleX()

virtual void AZ::TransformInterface::SetLocalScaleX ( float )
inline virtual

Scales the entity along the X axis in local space.

Parameters
scaleX The multiplier by which to scale the entity along the X axis in local space.

SetLocalScaleY()

virtual void AZ::TransformInterface::SetLocalScaleY ( float )
inline virtual

Scales the entity along the Y axis in local space.

Parameters
scaleY The multiplier by which to scale the entity along the Y axis in local space.

SetLocalScaleZ()

virtual void AZ::TransformInterface::SetLocalScaleZ ( float )
inline virtual

Scales the entity along the Z axis in local space.

Parameters
scaleZ The multiplier by which to scale the entity along the Z axis in local space.

SetLocalTM()

virtual void AZ::TransformInterface::SetLocalTM ( const Transform & )
inline virtual

Sets the entity's local transform and notifies all listeners.

Parameters
tm A reference to a transform for positioning the entity relative to its parent entity.

SetLocalTranslation()

virtual void AZ::TransformInterface::SetLocalTranslation ( const AZ::Vector3 & )
inline virtual

Sets the entity's local space translation, which represents how to move the entity to a new position relative to its parent.

Parameters
newPosition A three-dimensional translation vector.

SetLocalX()

virtual void AZ::TransformInterface::SetLocalX ( float )
inline virtual

Sets the entity's X coordinate in local space.

Parameters
x A new value for the entity's X coordinate in local space.

SetLocalY()

virtual void AZ::TransformInterface::SetLocalY ( float )
inline virtual

Sets the entity's Y coordinate in local space.

Parameters
y A new value for the entity's Y coordinate in local space.

SetLocalZ()

virtual void AZ::TransformInterface::SetLocalZ ( float )
inline virtual

Sets the entity's Z coordinate in local space.

Parameters
z A new value for the entity's Z coordinate in local space.

SetParent()

virtual void AZ::TransformInterface::SetParent ( EntityId )
inline virtual

Sets the entity's parent entity and notifies all listeners.

The entity's local transform is moved into the parent entity's space to preserve the entity's world transform.

Parameters
id The ID of the entity to set as the parent.

SetParentRelative()

virtual void AZ::TransformInterface::SetParentRelative ( EntityId )
inline virtual

Sets the entity's parent entity, moves the transform relative to the parent entity, and notifies all listeners.

This function uses the world transform as a local transform and moves the transform relative to the parent entity.

Parameters
id The ID of the entity to set as the parent.

SetRotation()

virtual void AZ::TransformInterface::SetRotation ( const AZ::Vector3 & )
inline virtual

Deprecated.

Deprecated:
Use SetLocalRotation() instead.

SetRotationQuaternion()

virtual void AZ::TransformInterface::SetRotationQuaternion ( const AZ::Quaternion & )
inline virtual

SetRotationX()

virtual void AZ::TransformInterface::SetRotationX ( float )
inline virtual

Deprecated.

Deprecated:
Use SetLocalRotation() instead.

SetRotationY()

virtual void AZ::TransformInterface::SetRotationY ( float )
inline virtual

Deprecated.

Deprecated:
Use SetLocalRotation() instead.

SetRotationZ()

virtual void AZ::TransformInterface::SetRotationZ ( float )
inline virtual

Deprecated.

Deprecated:
Use SetLocalRotation() instead.

SetScale()

virtual void AZ::TransformInterface::SetScale ( const AZ::Vector3 & )
inline virtual

Deprecated.

Deprecated:
Use SetLocalScale() instead.

SetScaleX()

virtual void AZ::TransformInterface::SetScaleX ( float )
inline virtual

Deprecated.

Deprecated:
Use SetLocalScaleX() instead.

SetScaleY()

virtual void AZ::TransformInterface::SetScaleY ( float )
inline virtual

Deprecated.

Deprecated:
Use SetLocalScaleY() instead.

SetScaleZ()

virtual void AZ::TransformInterface::SetScaleZ ( float )
inline virtual

Deprecated.

Deprecated:
Use SetLocalScaleZ() instead.

SetWorldTM()

virtual void AZ::TransformInterface::SetWorldTM ( const Transform & )
inline virtual

Sets the world transform and notifies all listeners.

Parameters
tm A reference to a transform for positioning the entity within the world.

SetWorldTranslation()

virtual void AZ::TransformInterface::SetWorldTranslation ( const AZ::Vector3 & )
inline virtual

Sets the entity's world space translation, which represents how to move the entity to a new position within the world.

Parameters
newPosition A three-dimensional translation vector.

SetWorldX()

virtual void AZ::TransformInterface::SetWorldX ( float )
inline virtual

Sets the entity's X coordinate in world space.

Parameters
x A new value for the entity's X coordinate in world space.

SetWorldY()

virtual void AZ::TransformInterface::SetWorldY ( float )
inline virtual

Sets the entity's Y coordinate in world space.

Parameters
y A new value for the entity's Y coordinate in world space.

SetWorldZ()

virtual void AZ::TransformInterface::SetWorldZ ( float )
inline virtual

Sets the entity's Z coordinate in world space.

Parameters
z A new value for the entity's Z coordinate in world space.

Member Data Documentation

HandlerPolicy

const EBusHandlerPolicy AZ::TransformInterface::HandlerPolicy
static

Overrides the default AZ::EBusTraits handler policy to allow one listener only.


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