You.i Engine
CYITransformSystem Class Reference

Detailed Description

The transform system maintains a component pool of CYITransformComponent data.

The transform system maintains depth-first sorting of component transform data, updating local & world matrices when dirty.

#include <scenetree/YiTransformSystem.h>

Public Member Functions

 CYITransformSystem ()
 
bool IsValid (CYIComponentPoolUID transformID) const
 
bool Update ()
 
void UpdateLocalMatrix (CYIComponentPoolUID transformID)
 
void UpdateWorldMatrix (CYIComponentPoolUID transformID)
 
CYIComponentPoolUID CreateTransform ()
 
CYIComponentPoolUID CreateTransform (CYIComponentPoolUID parentID)
 
const CYITransformComponentGetTransform (CYIComponentPoolUID transformID) const
 
CYITransformComponentGetTransform (CYIComponentPoolUID transformID)
 
void RemoveSubtree (CYIComponentPoolUID subtreeRootID)
 
void RemoveDescendants (CYIComponentPoolUID transformID)
 
bool SetParent (CYIComponentPoolUID transformID, CYIComponentPoolUID parentID)
 
void SetDirty (CYIComponentPoolUID transformID)
 
void DirtyAll ()
 

Friends

class CYITransform
 
class TransformSystemTest
 

Constructor & Destructor Documentation

◆ CYITransformSystem()

CYITransformSystem::CYITransformSystem ( )

Member Function Documentation

◆ CreateTransform() [1/2]

CYIComponentPoolUID CYITransformSystem::CreateTransform ( )

Create a new transform component parented to root.

Returns
The newly created component's uid.

◆ CreateTransform() [2/2]

CYIComponentPoolUID CYITransformSystem::CreateTransform ( CYIComponentPoolUID  parentID)

Create a new transform component and parent it to parentID.

Note
This is the same as calling CreateTransform() followed by SetParent().
Returns
The newly created component's uid.

◆ DirtyAll()

void CYITransformSystem::DirtyAll ( )

Mark all components dirty.

◆ GetTransform() [1/2]

const CYITransformComponent* CYITransformSystem::GetTransform ( CYIComponentPoolUID  transformID) const

Get a pointer to the transform component given its uid.

Parameters
transformIDThe uid of the component to be retrieved.
Returns
The component's pointer, or null.

◆ GetTransform() [2/2]

CYITransformComponent* CYITransformSystem::GetTransform ( CYIComponentPoolUID  transformID)

Get a pointer to the transform component given its uid.

Parameters
transformIDThe uid of the component to be retrieved.
Returns
The component's pointer, or null.

◆ IsValid()

bool CYITransformSystem::IsValid ( CYIComponentPoolUID  transformID) const

◆ RemoveDescendants()

void CYITransformSystem::RemoveDescendants ( CYIComponentPoolUID  transformID)

Remove all children of a given component.

Parameters
transformIDThe uid of the component whose children will be removed.

◆ RemoveSubtree()

void CYITransformSystem::RemoveSubtree ( CYIComponentPoolUID  subtreeRootID)

Remove a component and all its children.

Parameters
subtreeRootIDThe uid of the root component to be removed.

◆ SetDirty()

void CYITransformSystem::SetDirty ( CYIComponentPoolUID  transformID)

Mark the specified component and all its children dirty.

◆ SetParent()

bool CYITransformSystem::SetParent ( CYIComponentPoolUID  transformID,
CYIComponentPoolUID  parentID 
)

Assign a component's parent.

Parameters
transformIDThe uid of the component to be re-parented.
parentIDThe uid of the parent component to be assigned.
Returns
True if parent was assigned successfully.

◆ Update()

bool CYITransformSystem::Update ( )

Update the local and world transform matrices for all dirty components.

◆ UpdateLocalMatrix()

void CYITransformSystem::UpdateLocalMatrix ( CYIComponentPoolUID  transformID)

Update the local matrix for the specified component.

Parameters
transformIDThe uid of the component to be updated.

◆ UpdateWorldMatrix()

void CYITransformSystem::UpdateWorldMatrix ( CYIComponentPoolUID  transformID)

Update the local and world matrices for the specified component and all dirty parent components.

Parameters
transformIDThe uid of the component to be updated.

Friends And Related Function Documentation

◆ CYITransform

friend class CYITransform
friend

◆ TransformSystemTest

friend class TransformSystemTest
friend

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