RavEngine
Loading...
Searching...
No Matches
RavEngine::Transform Struct Reference
Inheritance diagram for RavEngine::Transform:
[legend]
Collaboration diagram for RavEngine::Transform:
[legend]

Public Member Functions

bool getTickDirty () const
 
 Transform (Entity owner, const vector3 &inpos, const quaternion &inrot, const vector3 &inscale)
 
 Transform (Entity owner)
 
 MOVE_NO_COPY (Transform)
 
Transform & SetLocalPosition (const vector3 &)
 
Transform & SetWorldPosition (const vector3 &)
 
Transform & LocalTranslateDelta (const vector3 &)
 
Transform & WorldTranslateDelta (const vector3 &)
 
Transform & SetLocalRotation (const quaternion &)
 
Transform & SetWorldRotation (const quaternion &)
 
Transform & LocalRotateDelta (const quaternion &)
 
Transform & SetLocalScale (const vector3 &)
 
Transform & LocalScaleDelta (const vector3 &)
 
Transform & SetLocalScale (const decimalType &scale)
 
vector3 Forward () const
 
vector3 Right () const
 
vector3 Up () const
 
vector3 WorldForward () const
 
vector3 WorldRight () const
 
vector3 WorldUp () const
 
bool HasParent () const
 
vector3 GetLocalPosition () const
 
vector3 GetWorldPosition () const
 
quaternion GetLocalRotation () const
 
quaternion GetWorldRotation () const
 
vector3 GetLocalScale () const
 
matrix4 GenerateLocalMatrix () const
 
matrix4 GetMatrix () const
 
matrix4 GetWorldMatrix () const
 
matrix4 GetParentSpaceMatrix () const
 
Transform & AddChild (ComponentHandle< Transform > child)
 
Transform & RemoveChild (ComponentHandle< Transform > child)
 
const decltype(children) & GetChildren () const
 
void Destroy ()
 
- Public Member Functions inherited from RavEngine::ComponentWithOwner
 ComponentWithOwner (const decltype(owner) o)
 
Entity GetOwner () const
 

Protected Member Functions

void MarkAsDirty () const
 
void ClearTickDirty ()
 
void UpdateChildren ()
 

Protected Attributes

matrix4 matrix
 
UnorderedVector< ComponentHandle< Transform > > children
 
quaternion rotation
 
ComponentHandle< Transform > parent
 
vector3 position
 
vector3 scale
 
bool isDirty: 1 = true
 
bool isTickDirty: 1 = true
 
- Protected Attributes inherited from RavEngine::ComponentWithOwner
Entity owner
 

Friends

class World
 

Additional Inherited Members

- Public Types inherited from RavEngine::Queryable< Transform >
typedef std::array< ctti_t, ntypes > arraytype
 
- Static Public Member Functions inherited from RavEngine::Queryable< Transform >
static constexpr const arraytype & GetQueryTypes ()
 
- Public Attributes inherited from RavEngine::Queryable< Transform >
constexpr q_qt_def
 
- Static Public Attributes inherited from RavEngine::Queryable< Transform >
static constexpr std::size_t ntypes
 

Member Function Documentation

◆ AddChild()

Transform & Transform::AddChild ( ComponentHandle< Transform >  child)

Add a transform as a child object of this transform

Parameters
childweak reference to the child object

◆ Forward()

vector3 RavEngine::Transform::Forward ( ) const
inline
Returns
the vector pointing in the forward direction of this transform

◆ GenerateLocalMatrix()

matrix4 RavEngine::Transform::GenerateLocalMatrix ( ) const
inline

Construct a transformation matrix out of this transform

Returns
glm matrix representing this transform

◆ GetMatrix()

matrix4 RavEngine::Transform::GetMatrix ( ) const
inline
Returns
the current cached matrix, representing the world-space transformation. This may be out-of-date. See CalculateWorldMatrix to calculate if out-of-date.

◆ GetWorldMatrix()

matrix4 RavEngine::Transform::GetWorldMatrix ( ) const
inline

Get the matrix list of all the parents.

Parameters
listthe list to add the matrices to

◆ LocalRotateDelta()

Transform & RavEngine::Transform::LocalRotateDelta ( const quaternion &  delta)
inline

Additively apply a rotation to this transform in local (parent) space.

Parameters
deltathe change in rotation to apply

◆ LocalTranslateDelta()

Transform & RavEngine::Transform::LocalTranslateDelta ( const vector3 &  delta)
inline

Translate the transform in a direction in local (parent) space. This will add to its current position

Parameters
deltathe change to apply

◆ RemoveChild()

Transform & Transform::RemoveChild ( ComponentHandle< Transform >  child)

Remove a transform as a child object of this transform. This does not check if the passed object is actually a child.

Parameters
childweak reference to the child object

◆ Right()

vector3 RavEngine::Transform::Right ( ) const
inline
Returns
the vector pointing in the right direction of this transform

◆ SetLocalPosition()

Transform & RavEngine::Transform::SetLocalPosition ( const vector3 &  newPos)
inline

Overwrite the position of the transform with a new position in local (parent) space

Parameters
newPosthe new position of this transform

◆ SetLocalRotation()

Transform & RavEngine::Transform::SetLocalRotation ( const quaternion &  newRot)
inline

Overwrite the rotation of this transform in local (parent) space.

Parameters
newRotthe new rotation to set

◆ SetLocalScale()

Transform & RavEngine::Transform::SetLocalScale ( const vector3 &  newScale)
inline

Overwrite the scale of this object with a new scale

Parameters
newScalethe new size of this object in local (parent) space

◆ SetWorldPosition()

Transform & RavEngine::Transform::SetWorldPosition ( const vector3 &  newPos)
inline

Move this transform to a new location in world space

Parameters
newPosthe new position in world space.

◆ SetWorldRotation()

Transform & RavEngine::Transform::SetWorldRotation ( const quaternion &  newRot)
inline

Overwrite the rotation of this transform in world space

Parameters
newRotthe new rotation in world space

◆ Up()

vector3 RavEngine::Transform::Up ( ) const
inline
Returns
the vector pointing in the up direction of this transform

The documentation for this struct was generated from the following files: