You.i Engine
CYITransform Class Reference

Detailed Description

Provides transformation APIs.

Transformation APIs which act on the transform component referenced by CYIComponentPoolUID using the provided CYITransformSystem.

#include <scenetree/YiTransform.h>

Public Member Functions

 CYITransform ()
 
 CYITransform (CYITransformSystem *pTransformSystem, CYIComponentPoolUID transformID)
 
bool IsValid () const
 
void RemoveFromTransformSystem ()
 
void RemoveDescendantsFromTransformSystem ()
 
CYIComponentPoolUID GetTransformID () const
 
bool SetParent (const CYITransform *pTransform)
 
bool GetParent (CYITransform &parent) const
 
bool SetPosition (glm::vec3 position)
 
bool SetRotation (glm::vec3 eulerAngles)
 
bool SetScale (glm::vec3 scale)
 
bool SetAnchorPoint (glm::vec3 anchorPoint)
 
bool SetOrientation (glm::quat orientation)
 
const glm::vec3 & GetPosition () const
 
const glm::vec3 & GetRotation () const
 
const glm::vec3 & GetScale () const
 
const glm::vec3 & GetAnchorPoint () const
 
const glm::quat & GetOrientation () const
 
const glm::mat4x4 & GetLocalMatrix () const
 
const glm::mat4x4 & GetWorldMatrix () const
 
CYITransformSystemGetTransformSystem ()
 
CYITransformComponentGetTransformComponent ()
 

Constructor & Destructor Documentation

◆ CYITransform() [1/2]

CYITransform::CYITransform ( )

◆ CYITransform() [2/2]

CYITransform::CYITransform ( CYITransformSystem pTransformSystem,
CYIComponentPoolUID  transformID 
)

Member Function Documentation

◆ GetAnchorPoint()

const glm::vec3& CYITransform::GetAnchorPoint ( ) const

◆ GetLocalMatrix()

const glm::mat4x4& CYITransform::GetLocalMatrix ( ) const

Get this transform component's local matrix.

Note
If the component is dirty, the local matrix will be updated before it is returned.
Returns
The local matrix.

◆ GetOrientation()

const glm::quat& CYITransform::GetOrientation ( ) const

◆ GetParent()

bool CYITransform::GetParent ( CYITransform parent) const

Get this transform's parent.

Parameters
parent(out) This transform's parent.
Returns
True if parent was returned, false if none (i.e. it is a top-level component) or could not be found.

◆ GetPosition()

const glm::vec3& CYITransform::GetPosition ( ) const

◆ GetRotation()

const glm::vec3& CYITransform::GetRotation ( ) const

◆ GetScale()

const glm::vec3& CYITransform::GetScale ( ) const

◆ GetTransformComponent()

CYITransformComponent* CYITransform::GetTransformComponent ( )

Get a pointer to the CYITransformComponent.

Returns
The CYITransformComponent pointer, or null if this transform component's uid is invalid.

◆ GetTransformID()

CYIComponentPoolUID CYITransform::GetTransformID ( ) const

Get this transform component's uid.

◆ GetTransformSystem()

CYITransformSystem* CYITransform::GetTransformSystem ( )

Get a pointer to the CYITransformSystem.

◆ GetWorldMatrix()

const glm::mat4x4& CYITransform::GetWorldMatrix ( ) const

Get this transform component's world matrix.

Note
If the component is dirty, the world matrix will be updated before it is returned.
See also
CYITransformSystem::UpdateWorldMatrix
Returns
The world matrix.

◆ IsValid()

bool CYITransform::IsValid ( ) const

◆ RemoveDescendantsFromTransformSystem()

void CYITransform::RemoveDescendantsFromTransformSystem ( )

Remove this component's children from the transform system.

◆ RemoveFromTransformSystem()

void CYITransform::RemoveFromTransformSystem ( )

Remove this component and all its children from the transform system.

Note
Once removed from the transform system, this CYITransform becomes invalid.

◆ SetAnchorPoint()

bool CYITransform::SetAnchorPoint ( glm::vec3  anchorPoint)

Set this transform's anchor point.

Returns
False if the anchor point provided was the same as its previous value.

◆ SetOrientation()

bool CYITransform::SetOrientation ( glm::quat  orientation)

Set this transform's orientation.

Returns
False if the orientation provided was the same as its previous value.

◆ SetParent()

bool CYITransform::SetParent ( const CYITransform pTransform)

Assign this transform's parent.

Parameters
pTransformThe parent transform to be assigned. If nullptr, this component will be a top-level component.
Returns
True if parent was assigned successfully.

◆ SetPosition()

bool CYITransform::SetPosition ( glm::vec3  position)

Set this transform's position.

Returns
False if the position provided was the same as its previous value.

◆ SetRotation()

bool CYITransform::SetRotation ( glm::vec3  eulerAngles)

Set this transform's rotation.

Returns
False if the rotation provided was the same as its previous value.

◆ SetScale()

bool CYITransform::SetScale ( glm::vec3  scale)

Set this transform's scale.

Returns
False if the scale provided was the same as its previous value.

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