#include <TransformBus.h>
Inherits AZ::ComponentBus.
Public Member Functions | |
AZ_RTTI (TransformInterface, "{8DD8A4E2-7F61-4A36-9169-A31F03E25FEB}") | |
virtual | ~TransformInterface ()=default |
Destroys the instance of the class. | |
virtual OnParentChangedBehavior | GetOnParentChangedBehavior () |
Get the behavior at runtime when this entity's parent's transform changes. | |
virtual void | SetOnParentChangedBehavior (OnParentChangedBehavior onParentChangedBehavior) |
Set the behavior at runtime when this entity's parent's transform changes. | |
virtual void | BindTransformChangedEventHandler (TransformChangedEvent::Handler &handler)=0 |
virtual void | BindParentChangedEventHandler (ParentChangedEvent::Handler &handler)=0 |
virtual void | BindChildChangedEventHandler (ChildChangedEvent::Handler &handler)=0 |
virtual void | NotifyChildChangedEvent (ChildChangeType changeType, EntityId entityId)=0 |
virtual const Transform & | GetLocalTM ()=0 |
virtual void | SetLocalTM (const Transform &tm) |
virtual const Transform & | GetWorldTM ()=0 |
virtual void | SetWorldTM (const Transform &tm) |
virtual void | GetLocalAndWorld (Transform &localTM, Transform &worldTM) |
virtual void | SetWorldTranslation (const AZ::Vector3 &newPosition) |
virtual void | SetLocalTranslation (const AZ::Vector3 &newPosition) |
virtual AZ::Vector3 | GetWorldTranslation () |
virtual AZ::Vector3 | GetLocalTranslation () |
virtual void | MoveEntity (const AZ::Vector3 &offset) |
virtual void | SetWorldX (float x) |
virtual void | SetWorldY (float y) |
virtual void | SetWorldZ (float z) |
virtual float | GetWorldX () |
virtual float | GetWorldY () |
virtual float | GetWorldZ () |
virtual void | SetLocalX (float x) |
virtual void | SetLocalY (float y) |
virtual void | SetLocalZ (float z) |
virtual float | GetLocalX () |
virtual float | GetLocalY () |
virtual float | GetLocalZ () |
virtual void | SetWorldRotation (const AZ::Vector3 &eulerAnglesRadian) |
virtual void | SetWorldRotationQuaternion (const AZ::Quaternion &quaternion) |
virtual AZ::Vector3 | GetWorldRotation () |
virtual AZ::Quaternion | GetWorldRotationQuaternion () |
virtual void | SetLocalRotation (const AZ::Vector3 &eulerRadianAngles) |
virtual void | SetLocalRotationQuaternion (const AZ::Quaternion &quaternion) |
virtual void | RotateAroundLocalX (float eulerAngleRadian) |
virtual void | RotateAroundLocalY (float eulerAngleRadian) |
virtual void | RotateAroundLocalZ (float eulerAngleRadian) |
virtual AZ::Vector3 | GetLocalRotation () |
virtual AZ::Quaternion | GetLocalRotationQuaternion () |
virtual AZ::Vector3 | GetLocalScale () |
virtual void | SetLocalUniformScale (float scale) |
Set the uniform scale value in local space. | |
virtual float | GetLocalUniformScale () |
virtual float | GetWorldUniformScale () |
virtual EntityId | GetParentId () |
virtual TransformInterface * | GetParent () |
virtual void | SetParent (EntityId id) |
virtual void | SetParentRelative (EntityId id) |
virtual AZStd::vector< AZ::EntityId > | GetChildren () |
virtual AZStd::vector< AZ::EntityId > | GetAllDescendants () |
virtual AZStd::vector< AZ::EntityId > | GetEntityAndAllDescendants () |
virtual bool | IsStaticTransform ()=0 |
virtual void | SetIsStaticTransform (bool isStatic) |
Public Member Functions inherited from AZ::ComponentBus | |
virtual | ~ComponentBus ()=default |
Static Public Attributes | |
static const EBusHandlerPolicy | HandlerPolicy = EBusHandlerPolicy::Single |
Overrides the default AZ::EBusTraits handler policy to allow one listener only. | |
Static Public Attributes inherited from AZ::ComponentBus | |
static const EBusAddressPolicy | AddressPolicy = EBusAddressPolicy::ById |
Static Public Attributes inherited from AZ::EBusTraits | |
static constexpr EBusHandlerPolicy | HandlerPolicy = EBusHandlerPolicy::Multiple |
static constexpr EBusAddressPolicy | AddressPolicy = EBusAddressPolicy::Single |
static constexpr bool | EnableEventQueue = false |
static constexpr bool | EventQueueingActiveByDefault = true |
static constexpr bool | EnableQueuedReferences = false |
static constexpr bool | LocklessDispatch = false |
Additional Inherited Members | |
Public Types inherited from AZ::ComponentBus | |
typedef EntityId | BusIdType |
Public Types inherited from AZ::EBusTraits | |
using | AllocatorType = AZ::Internal::EBusEnvironmentAllocator |
using | BusIdType = NullBusId |
using | BusIdOrderCompare = NullBusIdCompare |
using | BusHandlerOrderCompare = BusHandlerCompareDefault |
using | MutexType = NullMutex |
using | EventQueueMutexType = NullMutex |
template<class Bus > | |
using | ConnectionPolicy = EBusConnectionPolicy< Bus > |
template<class Context > | |
using | StoragePolicy = EBusEnvironmentStoragePolicy< Context > |
template<class Bus > | |
using | RouterPolicy = EBusRouterPolicy< Bus > |
using | EventProcessingPolicy = EBusEventProcessingPolicy |
template<typename DispatchMutex , bool IsLocklessDispatch> | |
using | DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > > |
template<typename ContextMutex > | |
using | ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > > |
template<typename ContextMutex > | |
using | BindLockGuard = AZStd::scoped_lock< ContextMutex > |
template<typename ContextMutex > | |
using | CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > > |
Protected Member Functions inherited from AZ::EBusTraits | |
~EBusTraits ()=default | |
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.
|
pure virtual |
Binds the provided ChildChangedEvent handler to the TransformComponent.
handler | the handler to invoke when the entity has a child entity added or removed |
|
pure virtual |
Binds the provided ParentChangedEvent to the TransformComponent.
handler | the handler to invoke when the entities parent changes |
|
pure virtual |
Event handlers
Binds the provided TransformChangedEvent handler to the TransformComponent.
handler | the handler to invoke when the entities transform changes |
|
inlinevirtual |
Returns the entityIds of all descendants of the entity. The descendants are the entity's children, the children's children, and so on. The entityIds are ordered breadth-first.
|
inlinevirtual |
Returns the entityIds of the entity's immediate children.
|
inlinevirtual |
Returns the entityId of the entity and all its descendants. The descendants are the entity's children, the children's children, and so on. The entityIds are ordered breadth-first and this entity's ID is the first in the list.
|
inlinevirtual |
Retrieves the entity's local and world transforms.
[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. |
|
inlinevirtual |
Get angles in radian for each principle axis around which the local transform is rotated in the order of x-axis and y-axis and then z-axis.
|
inlinevirtual |
Get the quaternion representing the local rotation.
|
inlinevirtual |
Scale modifiers
|
pure virtual |
Transform modifiers
Returns the entity's local transform, not including the parent transform.
|
inlinevirtual |
Gets the entity's local space translation.
|
inlinevirtual |
Get the uniform scale value in local space.
|
inlinevirtual |
Gets the entity's X coordinate in local space.
|
inlinevirtual |
Gets the entity's Y coordinate in local space.
|
inlinevirtual |
Gets the entity's Z coordinate in local space.
|
inlinevirtual |
Returns the transform interface of the parent entity.
|
inlinevirtual |
Transform hierarchy
Returns the entityId of the entity's parent.
|
inlinevirtual |
Get angles in radian for each principle axis around which the world transform is rotated in the order of z-axis and y-axis and then x-axis.
|
inlinevirtual |
Get the quaternion representing the world rotation.
|
pure virtual |
Returns the entity's world transform, including the parent transform.
|
inlinevirtual |
Gets the entity's world space translation.
|
inlinevirtual |
Get the uniform scale value in world space.
|
inlinevirtual |
Gets the entity's X coordinate in world space.
|
inlinevirtual |
Gets the entity's Y coordinate in world space.
|
inlinevirtual |
Gets the entity's Z coordinate in world space.
|
pure virtual |
Static transforms
Returns whether the transform is static. A static transform is unmovable and does not respond to requests that would move it.
|
inlinevirtual |
Moves the entity within world space.
offset | A three-dimensional vector that contains the offset to apply to the entity. |
|
pure virtual |
Notifies a child change event.
changeType | the type of child event, adding or removing |
entityId | the entityId of the child being added or removed |
|
inlinevirtual |
Rotate around the local x-axis for a radian angle.
eulerRadianAngle | The angle to rotate around the local x-axis. |
|
inlinevirtual |
Rotate around the local y-axis for a radian angle.
eulerRadianAngle | The angle to rotate around the local y-axis. |
|
inlinevirtual |
Rotate around the local z-axis for a radian angle.
eulerRadianAngle | The angle to rotate around the local z-axis. |
|
inlinevirtual |
Set the transform to isStatic. This is needed to set a layer as static. A static transform is unmovable and does not respond to requests that would move it.
|
inlinevirtual |
Set the local rotation matrix using the composition of rotations around the principle axes in the order of z-axis first and y-axis and then x-axis.
eulerRadianAngles | A Vector3 denoting radian angles of the rotations around each principle axis. |
|
inlinevirtual |
Set the local rotation matrix using a quaternion.
quaternion | A quaternion representing the rotation to set. |
|
inlinevirtual |
Sets the entity's local transform and notifies all listeners.
tm | A reference to a transform for positioning the entity relative to its parent entity. |
|
inlinevirtual |
Sets the entity's local space translation, which represents how to move the entity to a new position relative to its parent.
newPosition | A three-dimensional translation vector. |
|
inlinevirtual |
Sets the entity's X coordinate in local space.
x | A new value for the entity's X coordinate in local space. |
|
inlinevirtual |
Sets the entity's Y coordinate in local space.
y | A new value for the entity's Y coordinate in local space. |
|
inlinevirtual |
Sets the entity's Z coordinate in local space.
z | A new value for the entity's Z coordinate in local space. |
|
inlinevirtual |
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.
id | The ID of the entity to set as the parent. |
|
inlinevirtual |
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.
id | The ID of the entity to set as the parent. |
|
inlinevirtual |
Rotation modifiers
Set the world rotation matrix using the composition of rotations around the principle axes in the order of z-axis first and y-axis and then x-axis.
eulerRadianAngles | A Vector3 denoting radian angles of the rotations around each principle axis. |
|
inlinevirtual |
Sets the entity's rotation in the world in quaternion notation. The origin of the axes is the entity's position in world space.
quaternion | A quaternion that represents the rotation to use for the entity. |
|
inlinevirtual |
Sets the world transform and notifies all listeners.
tm | A reference to a transform for positioning the entity within the world. |
|
inlinevirtual |
Translation modifiers
Sets the entity's world space translation, which represents how to move the entity to a new position within the world.
newPosition | A three-dimensional translation vector. |
|
inlinevirtual |
Sets the entity's X coordinate in world space.
x | A new value for the entity's X coordinate in world space. |
|
inlinevirtual |
Sets the entity's Y coordinate in world space.
y | A new value for the entity's Y coordinate in world space. |
|
inlinevirtual |
Sets the entity's Z coordinate in world space.
z | A new value for the entity's Z coordinate in world space. |