Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::TransformComponent Class Referencefinal

#include <TransformComponent.h>

+ Inheritance diagram for Divide::TransformComponent:

Public Types

enum class  ScalingMode : U8 { UNIFORM = 0u , NON_UNIFORM }
 

Public Member Functions

 TransformComponent (SceneGraphNode *parentSGN, PlatformContext &context)
 
void reset ()
 
void getWorldMatrix (mat4< F32 > &matOut) const
 
void getWorldMatrixInterpolated (mat4< F32 > &matrixOut) const
 
mat4< F32getWorldMatrix () const
 
mat4< F32getWorldMatrixInterpolated () const
 
void getLocalRotationMatrix (mat4< F32 > &matOut) const
 
void getLocalRotationMatrixInterpolated (mat4< F32 > &matOut) const
 
void getWorldRotationMatrix (mat4< F32 > &matOut) const
 
void getWorldRotationMatrixInterpolated (mat4< F32 > &matOut) const
 
void setPosition (const vec3< F32 > &position) override
 Component <-> Transform interface.
 
void setPosition (F32 x, F32 y, F32 z) override
 Set the local X,Y and Z position.
 
void setPositionX (F32 positionX) override
 Set the object's position on the X axis.
 
void setPositionY (F32 positionY) override
 Set the object's position on the Y axis.
 
void setPositionZ (F32 positionZ) override
 Set the object's position on the Z axis.
 
void translate (const vec3< F32 > &axisFactors) override
 Add the specified translation factors to the current local position.
 
void setScale (const vec3< F32 > &amount) override
 Set the local X,Y and Z scale factors.
 
void setScaleX (F32 amount) override
 Set the scaling factor on the X axis.
 
void setScaleY (F32 amount) override
 Set the scaling factor on the Y axis.
 
void setScaleZ (F32 amount) override
 Set the scaling factor on the Z axis.
 
void scale (const vec3< F32 > &axisFactors) override
 Add the specified scale factors to the current local position.
 
void scaleX (F32 amount) override
 Increase the scaling factor on the X axis by the specified factor.
 
void scaleY (F32 amount) override
 Increase the scaling factor on the Y axis by the specified factor.
 
void scaleZ (F32 amount) override
 Increase the scaling factor on the Z axis by the specified factor.
 
void setRotation (const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees) override
 
void setRotation (Angle::DEGREES< F32 > pitch, Angle::DEGREES< F32 > yaw, Angle::DEGREES< F32 > roll) override
 
void setRotation (const Quaternion< F32 > &quat) override
 Set the local orientation so that it matches the specified quaternion.
 
void setRotationX (Angle::DEGREES< F32 > angle) override
 
void setRotationY (Angle::DEGREES< F32 > angle) override
 
void setRotationZ (Angle::DEGREES< F32 > angle) override
 
void rotate (const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees) override
 
void rotate (Angle::DEGREES< F32 > pitch, Angle::DEGREES< F32 > yaw, Angle::DEGREES< F32 > roll) override
 
void rotate (const Quaternion< F32 > &quat) override
 Apply the specified Quaternion rotation starting from the current orientation.
 
void rotateSlerp (const Quaternion< F32 > &quat, D64 deltaTime) override
 Perform a SLERP rotation towards the specified quaternion.
 
void rotateX (Angle::DEGREES< F32 > angle) override
 Rotate on the X axis (Axis-Angle used) by the specified angle (either degrees or radians)
 
void rotateY (Angle::DEGREES< F32 > angle) override
 Rotate on the Y axis (Axis-Angle used) by the specified angle (either degrees or radians)
 
void rotateZ (Angle::DEGREES< F32 > angle) override
 Rotate on the Z axis (Axis-Angle used) by the specified angle (either degrees or radians)
 
const vec3< F32getLocalDirection (const vec3< F32 > &worldForward=WORLD_Z_NEG_AXIS) const
 
const vec3< F32getWorldDirection (const vec3< F32 > &worldForward=WORLD_Z_NEG_AXIS) const
 
void setDirection (const vec3< F32 > &fwdDirection, const vec3< F32 > &upDirection=WORLD_Y_AXIS)
 Sets a new, local only, direction for the current component based on the specified world forward direction.
 
void setTransform (const TransformValues &values)
 
bool isUniformScaled () const noexcept
 
vec3< F32getWorldPosition () const
 Return the position.
 
vec3< F32getLocalPosition () const
 Return the local position.
 
vec3< F32getWorldPositionInterpolated () const
 Return the position.
 
vec3< F32getLocalPositionInterpolated () const
 Return the local position.
 
vec3< F32getFwdVector () const
 Return the derived forward direction.
 
vec3< F32getUpVector () const
 Return the derived up direction.
 
vec3< F32getRightVector () const
 Return the derived right direction.
 
vec3< F32getWorldScale () const
 Return the scale factor.
 
vec3< F32getLocalScale () const
 Return the local scale factor.
 
vec3< F32getWorldScaleInterpolated () const
 Return the scale factor.
 
vec3< F32getLocalScaleInterpolated () const
 Return the local scale factor.
 
Quaternion< F32getWorldOrientation () const
 Return the orientation quaternion.
 
Quaternion< F32getLocalOrientation () const
 Return the local orientation quaternion.
 
Quaternion< F32getWorldOrientationInterpolated () const
 Return the orientation quaternion.
 
Quaternion< F32getLocalOrientationInterpolated () const
 Return the local orientation quaternion.
 
void getWorldTransforms (vec3< F32 > &positionOut, vec3< F32 > &scaleOut, Quaternion< F32 > &rotationOut)
 
void getWorldTransformsInterpolated (vec3< F32 > &positionOut, vec3< F32 > &scaleOut, Quaternion< F32 > &rotationOut)
 
void setTransforms (const mat4< F32 > &transform)
 
TransformValues getLocalValues () const
 
void pushTransforms ()
 
bool popTransforms ()
 
void resetCache ()
 
void setOffset (bool state, const mat4< F32 > &offset=mat4< F32 >()) noexcept
 
bool saveCache (ByteBuffer &outputBuffer) const override
 
bool loadCache (ByteBuffer &inputBuffer) override
 
 PROPERTY_R_IW (TransformValues, cachedDerivedTransform)
 
 PROPERTY_RW (bool, editorLockPosition, false)
 
 PROPERTY_RW (bool, editorLockRotation, false)
 
 PROPERTY_RW (bool, editorLockScale, false)
 
 PROPERTY_RW (ScalingMode, scalingMode, ScalingMode::UNIFORM)
 
 PROPERTY_R_IW (mat4< F32 >, localMatrix, MAT4_IDENTITY)
 
 PROPERTY_R_IW (mat4< F32 >, localMatrixInterpolated, MAT4_IDENTITY)
 
virtual void setPosition (const vec3< F32 > &position)=0
 Set the local X,Y and Z position.
 
virtual void setPosition (F32 x, F32 y, F32 z)=0
 Set the local X,Y and Z position.
 
virtual void setScale (const vec3< F32 > &amount)=0
 Set the local X,Y and Z scale factors.
 
void setScale (F32 amount)
 Set an uniform scale on all three axis.
 
void setScale (F32 x, F32 y, F32 z)
 Set a scaling factor for each axis.
 
virtual void setRotation (const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees)=0
 
virtual void setRotation (Angle::DEGREES< F32 > pitch, Angle::DEGREES< F32 > yaw, Angle::DEGREES< F32 > roll)=0
 
virtual void setRotation (const Quaternion< F32 > &quat)=0
 Set the local orientation so that it matches the specified quaternion.
 
virtual void rotate (const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees)=0
 
virtual void rotate (Angle::DEGREES< F32 > pitch, Angle::DEGREES< F32 > yaw, Angle::DEGREES< F32 > roll)=0
 
virtual void rotate (const Quaternion< F32 > &quat)=0
 Apply the specified Quaternion rotation starting from the current orientation.
 
void rotate (F32 xAxis, F32 yAxis, F32 zAxis, Angle::DEGREES< F32 > degrees)
 Apply an axis-angle rotation.
 
void rotate (const vec3< F32 > &euler)
 Apply an euler rotation.
 
- Public Member Functions inherited from Divide::ITransform
virtual ~ITransform ()=default
 
virtual void setPosition (const vec3< F32 > &position)=0
 Set the local X,Y and Z position.
 
virtual void setPosition (F32 x, F32 y, F32 z)=0
 Set the local X,Y and Z position.
 
virtual void setPositionX (F32 positionX)=0
 Set the object's position on the X axis.
 
virtual void setPositionY (F32 positionY)=0
 Set the object's position on the Y axis.
 
virtual void setPositionZ (F32 positionZ)=0
 Set the object's position on the Z axis.
 
virtual void translate (const vec3< F32 > &axisFactors)=0
 Add the specified translation factors to the current local position.
 
virtual void setScale (const vec3< F32 > &amount)=0
 Set the local X,Y and Z scale factors.
 
virtual void setScaleX (F32 amount)=0
 Set the scaling factor on the X axis.
 
virtual void setScaleY (F32 amount)=0
 Set the scaling factor on the Y axis.
 
virtual void setScaleZ (F32 amount)=0
 Set the scaling factor on the Z axis.
 
virtual void scale (const vec3< F32 > &axisFactors)=0
 Add the specified scale factors to the current local position.
 
virtual void scaleX (F32 amount)=0
 Increase the scaling factor on the X axis by the specified factor.
 
virtual void scaleY (F32 amount)=0
 Increase the scaling factor on the Y axis by the specified factor.
 
virtual void scaleZ (F32 amount)=0
 Increase the scaling factor on the Z axis by the specified factor.
 
virtual void setRotation (const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees)=0
 
virtual void setRotation (Angle::DEGREES< F32 > pitch, Angle::DEGREES< F32 > yaw, Angle::DEGREES< F32 > roll)=0
 
virtual void setRotation (const Quaternion< F32 > &quat)=0
 Set the local orientation so that it matches the specified quaternion.
 
virtual void setRotationX (Angle::DEGREES< F32 > angle)=0
 
virtual void setRotationY (Angle::DEGREES< F32 > angle)=0
 
virtual void setRotationZ (Angle::DEGREES< F32 > angle)=0
 
virtual void rotate (const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees)=0
 
virtual void rotate (Angle::DEGREES< F32 > pitch, Angle::DEGREES< F32 > yaw, Angle::DEGREES< F32 > roll)=0
 
virtual void rotate (const Quaternion< F32 > &quat)=0
 Apply the specified Quaternion rotation starting from the current orientation.
 
virtual void rotateSlerp (const Quaternion< F32 > &quat, D64 deltaTime)=0
 Perform a SLERP rotation towards the specified quaternion.
 
virtual void rotateX (Angle::DEGREES< F32 > angle)=0
 Rotate on the X axis (Axis-Angle used) by the specified angle (either degrees or radians)
 
virtual void rotateY (Angle::DEGREES< F32 > angle)=0
 Rotate on the Y axis (Axis-Angle used) by the specified angle (either degrees or radians)
 
virtual void rotateZ (Angle::DEGREES< F32 > angle)=0
 Rotate on the Z axis (Axis-Angle used) by the specified angle (either degrees or radians)
 
void setScale (F32 amount)
 Set an uniform scale on all three axis.
 
void setScale (F32 x, F32 y, F32 z)
 Set a scaling factor for each axis.
 
void setRotationEuler (const vec3< F32 > &euler)
 Set the euler rotation in degrees.
 
void translate (F32 x, F32 y, F32 z)
 Translate the object on each axis by the specified amount.
 
void translateX (F32 positionX)
 Translate the object on the X axis by the specified amount.
 
void translateY (F32 positionY)
 Translate the object on the Y axis by the specified amount.
 
void translateZ (F32 positionZ)
 Translate the object on the Z axis by the specified amount.
 
void scale (F32 amount)
 Increase the scaling factor on all three axis by an uniform factor.
 
void scale (F32 x, F32 y, F32 z)
 Increase the scaling factor on all three axis by the specified amounts.
 
void rotate (F32 xAxis, F32 yAxis, F32 zAxis, Angle::DEGREES< F32 > degrees)
 Apply an axis-angle rotation.
 
void rotate (const vec3< F32 > &euler)
 Apply an euler rotation.
 
virtual void getScale (vec3< F32 > &scaleOut) const =0
 Return the scale factor.
 
virtual void getPosition (vec3< F32 > &posOut) const =0
 Return the position.
 
virtual void getOrientation (Quaternion< F32 > &quatOut) const =0
 Return the orientation quaternion.
 

Protected Member Functions

void setTransformDirty (TransformType type) noexcept
 
void setTransformDirty (U32 typeMask) noexcept
 
void updateCachedValues ()
 
void onParentTransformDirty (U32 transformMask) noexcept
 
void onParentUsageChanged (NodeUsageContext context) noexcept
 
void onParentChanged (const SceneGraphNode *oldParent, const SceneGraphNode *newParent)
 
void getScale (vec3< F32 > &scaleOut) const override
 Return the scale factor.
 
void getPosition (vec3< F32 > &posOut) const override
 Return the position.
 
void getOrientation (Quaternion< F32 > &quatOut) const override
 Return the orientation quaternion.
 
Quaternion< F32getDerivedOrientation () const
 
vec3< F32getDerivedPosition () const
 
vec3< F32getDerivedScale () const
 
void updateLocalMatrix (D64 interpolationFactor)
 

Private Types

using Parent = BaseComponentType< TransformComponent, ComponentType::TRANSFORM >
 
using TransformStack = std::stack< TransformValues >
 

Private Member Functions

void updateLocalMatrixLocked ()
 
void updateLocalMatrixInterpolated (D64 interpolationFactor)
 

Private Attributes

std::pair< bool, mat4< F32 > > _transformOffset
 
std::atomic_uint _transformUpdatedMask {}
 
TransformValues _prevTransformValues
 
TransformValues _transformValuesInterpolated
 
TransformStack _transformStack {}
 
Transform _transformInterface
 
NodeUsageContext _parentUsageContext
 
bool _cacheDirty = true
 
bool _uniformScaled = true
 
SharedMutex _localMatrixLock {}
 
SharedMutex _lock {}
 

Friends

class TransformSystem
 
class Attorney::TransformComponentSGN
 
template<typename T , typename U >
class ECSSystem
 

Detailed Description

Definition at line 53 of file TransformComponent.h.

Member Typedef Documentation

◆ Parent

◆ TransformStack

Definition at line 225 of file TransformComponent.h.

Member Enumeration Documentation

◆ ScalingMode

Enumerator
UNIFORM 
NON_UNIFORM 

Definition at line 57 of file TransformComponent.h.

Constructor & Destructor Documentation

◆ TransformComponent()

Divide::TransformComponent::TransformComponent ( SceneGraphNode parentSGN,
PlatformContext context 
)

Definition at line 10 of file TransformComponent.cpp.

Member Function Documentation

◆ getDerivedOrientation()

Quaternion< F32 > Divide::TransformComponent::getDerivedOrientation ( ) const
protected

Definition at line 746 of file TransformComponent.cpp.

◆ getDerivedPosition()

vec3< F32 > Divide::TransformComponent::getDerivedPosition ( ) const
protected

Definition at line 686 of file TransformComponent.cpp.

◆ getDerivedScale()

vec3< F32 > Divide::TransformComponent::getDerivedScale ( ) const
protected

Definition at line 716 of file TransformComponent.cpp.

◆ getFwdVector()

vec3< F32 > Divide::TransformComponent::getFwdVector ( ) const

Return the derived forward direction.

Definition at line 794 of file TransformComponent.cpp.

◆ getLocalDirection()

const vec3< F32 > Divide::TransformComponent::getLocalDirection ( const vec3< F32 > &  worldForward = WORLD_Z_NEG_AXIS) const

Definition at line 410 of file TransformComponent.cpp.

◆ getLocalOrientation()

Quaternion< F32 > Divide::TransformComponent::getLocalOrientation ( ) const

Return the local orientation quaternion.

Definition at line 778 of file TransformComponent.cpp.

◆ getLocalOrientationInterpolated()

Quaternion< F32 > Divide::TransformComponent::getLocalOrientationInterpolated ( ) const

Return the local orientation quaternion.

Definition at line 809 of file TransformComponent.cpp.

◆ getLocalPosition()

vec3< F32 > Divide::TransformComponent::getLocalPosition ( ) const

Return the local position.

Definition at line 766 of file TransformComponent.cpp.

◆ getLocalPositionInterpolated()

vec3< F32 > Divide::TransformComponent::getLocalPositionInterpolated ( ) const

Return the local position.

Definition at line 784 of file TransformComponent.cpp.

◆ getLocalRotationMatrix()

void Divide::TransformComponent::getLocalRotationMatrix ( mat4< F32 > &  matOut) const

This returns a "normal matrix". If we have uniform scaling, this is just the upper 3x3 part of our world matrix If we have non-uniform scaling, that 3x3 mat goes through an inverse-transpose step to get rid of any scaling factors but keep rotations Padded to fit into a mat4 for convenient. Can cast to a mat3 afterwards as row 3 and column 3 are just 0,0,0,1

Definition at line 548 of file TransformComponent.cpp.

◆ getLocalRotationMatrixInterpolated()

void Divide::TransformComponent::getLocalRotationMatrixInterpolated ( mat4< F32 > &  matOut) const

Definition at line 559 of file TransformComponent.cpp.

◆ getLocalScale()

vec3< F32 > Divide::TransformComponent::getLocalScale ( ) const

Return the local scale factor.

Definition at line 772 of file TransformComponent.cpp.

◆ getLocalScaleInterpolated()

vec3< F32 > Divide::TransformComponent::getLocalScaleInterpolated ( ) const

Return the local scale factor.

Definition at line 789 of file TransformComponent.cpp.

◆ getLocalValues()

TransformValues Divide::TransformComponent::getLocalValues ( ) const

Definition at line 499 of file TransformComponent.cpp.

◆ getOrientation()

void Divide::TransformComponent::getOrientation ( Quaternion< F32 > &  quatOut) const
overrideprotectedvirtual

Return the orientation quaternion.

Implements Divide::ITransform.

Definition at line 827 of file TransformComponent.cpp.

◆ getPosition()

void Divide::TransformComponent::getPosition ( vec3< F32 > &  posOut) const
overrideprotectedvirtual

Return the position.

Implements Divide::ITransform.

Definition at line 821 of file TransformComponent.cpp.

◆ getRightVector()

vec3< F32 > Divide::TransformComponent::getRightVector ( ) const

Return the derived right direction.

Definition at line 804 of file TransformComponent.cpp.

◆ getScale()

void Divide::TransformComponent::getScale ( vec3< F32 > &  scaleOut) const
overrideprotectedvirtual

Return the scale factor.

Implements Divide::ITransform.

Definition at line 815 of file TransformComponent.cpp.

◆ getUpVector()

vec3< F32 > Divide::TransformComponent::getUpVector ( ) const

Return the derived up direction.

Definition at line 799 of file TransformComponent.cpp.

◆ getWorldDirection()

const vec3< F32 > Divide::TransformComponent::getWorldDirection ( const vec3< F32 > &  worldForward = WORLD_Z_NEG_AXIS) const

Definition at line 415 of file TransformComponent.cpp.

◆ getWorldMatrix() [1/2]

mat4< F32 > Divide::TransformComponent::getWorldMatrix ( ) const

Definition at line 648 of file TransformComponent.cpp.

◆ getWorldMatrix() [2/2]

void Divide::TransformComponent::getWorldMatrix ( mat4< F32 > &  matOut) const

Definition at line 626 of file TransformComponent.cpp.

◆ getWorldMatrixInterpolated() [1/2]

mat4< F32 > Divide::TransformComponent::getWorldMatrixInterpolated ( ) const

Definition at line 655 of file TransformComponent.cpp.

◆ getWorldMatrixInterpolated() [2/2]

void Divide::TransformComponent::getWorldMatrixInterpolated ( mat4< F32 > &  matrixOut) const

Definition at line 638 of file TransformComponent.cpp.

◆ getWorldOrientation()

Quaternion< F32 > Divide::TransformComponent::getWorldOrientation ( ) const

Return the orientation quaternion.

Definition at line 736 of file TransformComponent.cpp.

◆ getWorldOrientationInterpolated()

Quaternion< F32 > Divide::TransformComponent::getWorldOrientationInterpolated ( ) const

Return the orientation quaternion.

Definition at line 756 of file TransformComponent.cpp.

◆ getWorldPosition()

vec3< F32 > Divide::TransformComponent::getWorldPosition ( ) const

Return the position.

Definition at line 676 of file TransformComponent.cpp.

◆ getWorldPositionInterpolated()

vec3< F32 > Divide::TransformComponent::getWorldPositionInterpolated ( ) const

Return the position.

Definition at line 696 of file TransformComponent.cpp.

◆ getWorldRotationMatrix()

void Divide::TransformComponent::getWorldRotationMatrix ( mat4< F32 > &  matOut) const

This returns a "normal matrix". If we have uniform scaling, this is just the upper 3x3 part of our local matrix If we have non-uniform scaling, that 3x3 mat goes through an inverse-transpose step to get rid of any scaling factors but keep rotations Padded to fit into a mat4 for convenient. Can cast to a mat3 afterwards as row 3 and column 3 are just 0,0,0,1

Definition at line 571 of file TransformComponent.cpp.

◆ getWorldRotationMatrixInterpolated()

void Divide::TransformComponent::getWorldRotationMatrixInterpolated ( mat4< F32 > &  matOut) const

Definition at line 585 of file TransformComponent.cpp.

◆ getWorldScale()

vec3< F32 > Divide::TransformComponent::getWorldScale ( ) const

Return the scale factor.

Definition at line 706 of file TransformComponent.cpp.

◆ getWorldScaleInterpolated()

vec3< F32 > Divide::TransformComponent::getWorldScaleInterpolated ( ) const

Return the scale factor.

Definition at line 726 of file TransformComponent.cpp.

◆ getWorldTransforms()

void Divide::TransformComponent::getWorldTransforms ( vec3< F32 > &  positionOut,
vec3< F32 > &  scaleOut,
Quaternion< F32 > &  rotationOut 
)

Definition at line 662 of file TransformComponent.cpp.

◆ getWorldTransformsInterpolated()

void Divide::TransformComponent::getWorldTransformsInterpolated ( vec3< F32 > &  positionOut,
vec3< F32 > &  scaleOut,
Quaternion< F32 > &  rotationOut 
)

Definition at line 669 of file TransformComponent.cpp.

◆ isUniformScaled()

bool Divide::TransformComponent::isUniformScaled ( ) const
noexcept

Definition at line 833 of file TransformComponent.cpp.

◆ loadCache()

bool Divide::TransformComponent::loadCache ( ByteBuffer inputBuffer)
override

Definition at line 873 of file TransformComponent.cpp.

◆ onParentChanged()

void Divide::TransformComponent::onParentChanged ( const SceneGraphNode oldParent,
const SceneGraphNode newParent 
)
protected

Definition at line 606 of file TransformComponent.cpp.

◆ onParentTransformDirty()

void Divide::TransformComponent::onParentTransformDirty ( U32  transformMask)
protectednoexcept

Definition at line 83 of file TransformComponent.cpp.

◆ onParentUsageChanged()

void Divide::TransformComponent::onParentUsageChanged ( NodeUsageContext  context)
protectednoexcept

Definition at line 91 of file TransformComponent.cpp.

◆ popTransforms()

bool Divide::TransformComponent::popTransforms ( )

Definition at line 461 of file TransformComponent.cpp.

◆ PROPERTY_R_IW() [1/3]

Divide::TransformComponent::PROPERTY_R_IW ( mat4< F32 ,
localMatrix  ,
MAT4_IDENTITY   
)

◆ PROPERTY_R_IW() [2/3]

Divide::TransformComponent::PROPERTY_R_IW ( mat4< F32 ,
localMatrixInterpolated  ,
MAT4_IDENTITY   
)

◆ PROPERTY_R_IW() [3/3]

Divide::TransformComponent::PROPERTY_R_IW ( TransformValues  ,
cachedDerivedTransform   
)

◆ PROPERTY_RW() [1/4]

Divide::TransformComponent::PROPERTY_RW ( bool  ,
editorLockPosition  ,
false   
)

◆ PROPERTY_RW() [2/4]

Divide::TransformComponent::PROPERTY_RW ( bool  ,
editorLockRotation  ,
false   
)

◆ PROPERTY_RW() [3/4]

Divide::TransformComponent::PROPERTY_RW ( bool  ,
editorLockScale  ,
false   
)

◆ PROPERTY_RW() [4/4]

Divide::TransformComponent::PROPERTY_RW ( ScalingMode  ,
scalingMode  ,
ScalingMode::UNIFORM   
)

◆ pushTransforms()

void Divide::TransformComponent::pushTransforms ( )

Definition at line 455 of file TransformComponent.cpp.

◆ reset()

void Divide::TransformComponent::reset ( )

Definition at line 104 of file TransformComponent.cpp.

◆ resetCache()

void Divide::TransformComponent::resetCache ( )

Definition at line 96 of file TransformComponent.cpp.

◆ rotate() [1/8]

void Divide::TransformComponent::rotate ( Angle::DEGREES< F32 pitch,
Angle::DEGREES< F32 yaw,
Angle::DEGREES< F32 roll 
)
overridevirtual

Apply the specified Euler rotation starting from the current orientation. The angles can be in either degrees(default) or radians

Implements Divide::ITransform.

Definition at line 230 of file TransformComponent.cpp.

◆ rotate() [2/8]

virtual void Divide::ITransform::rotate ( Angle::DEGREES< F32 pitch,
Angle::DEGREES< F32 yaw,
Angle::DEGREES< F32 roll 
)
virtual

Apply the specified Euler rotation starting from the current orientation. The angles can be in either degrees(default) or radians

Implements Divide::ITransform.

◆ rotate() [3/8]

void Divide::TransformComponent::rotate ( const Quaternion< F32 > &  quat)
overridevirtual

Apply the specified Quaternion rotation starting from the current orientation.

Implements Divide::ITransform.

Definition at line 240 of file TransformComponent.cpp.

◆ rotate() [4/8]

virtual void Divide::ITransform::rotate ( const Quaternion< F32 > &  quat)
virtual

Apply the specified Quaternion rotation starting from the current orientation.

Implements Divide::ITransform.

◆ rotate() [5/8]

void Divide::TransformComponent::rotate ( const vec3< F32 > &  axis,
Angle::DEGREES< F32 degrees 
)
overridevirtual

Apply the specified Axis-Angle rotation starting from the current orientation. The angles can be in either degrees(default) or radians

Implements Divide::ITransform.

Definition at line 220 of file TransformComponent.cpp.

◆ rotate() [6/8]

virtual void Divide::ITransform::rotate ( const vec3< F32 > &  axis,
Angle::DEGREES< F32 degrees 
)
virtual

Apply the specified Axis-Angle rotation starting from the current orientation. The angles can be in either degrees(default) or radians

Implements Divide::ITransform.

◆ rotate() [7/8]

void Divide::ITransform::rotate ( const vec3< F32 > &  euler)
inline

Apply an euler rotation.

Definition at line 144 of file TransformInterface.inl.

◆ rotate() [8/8]

void Divide::ITransform::rotate ( F32  xAxis,
F32  yAxis,
F32  zAxis,
Angle::DEGREES< F32 degrees 
)
inline

Apply an axis-angle rotation.

Definition at line 142 of file TransformInterface.inl.

◆ rotateSlerp()

void Divide::TransformComponent::rotateSlerp ( const Quaternion< F32 > &  quat,
D64  deltaTime 
)
overridevirtual

Perform a SLERP rotation towards the specified quaternion.

Implements Divide::ITransform.

Definition at line 250 of file TransformComponent.cpp.

◆ rotateX()

void Divide::TransformComponent::rotateX ( Angle::DEGREES< F32 angle)
overridevirtual

Rotate on the X axis (Axis-Angle used) by the specified angle (either degrees or radians)

Implements Divide::ITransform.

Definition at line 350 of file TransformComponent.cpp.

◆ rotateY()

void Divide::TransformComponent::rotateY ( Angle::DEGREES< F32 angle)
overridevirtual

Rotate on the Y axis (Axis-Angle used) by the specified angle (either degrees or radians)

Implements Divide::ITransform.

Definition at line 360 of file TransformComponent.cpp.

◆ rotateZ()

void Divide::TransformComponent::rotateZ ( Angle::DEGREES< F32 angle)
overridevirtual

Rotate on the Z axis (Axis-Angle used) by the specified angle (either degrees or radians)

Implements Divide::ITransform.

Definition at line 370 of file TransformComponent.cpp.

◆ saveCache()

bool Divide::TransformComponent::saveCache ( ByteBuffer outputBuffer) const
override

Definition at line 849 of file TransformComponent.cpp.

◆ scale()

void Divide::TransformComponent::scale ( const vec3< F32 > &  axisFactors)
overridevirtual

Add the specified scale factors to the current local position.

Implements Divide::ITransform.

Definition at line 208 of file TransformComponent.cpp.

◆ scaleX()

void Divide::TransformComponent::scaleX ( F32  amount)
overridevirtual

Increase the scaling factor on the X axis by the specified factor.

Implements Divide::ITransform.

Definition at line 305 of file TransformComponent.cpp.

◆ scaleY()

void Divide::TransformComponent::scaleY ( F32  amount)
overridevirtual

Increase the scaling factor on the Y axis by the specified factor.

Implements Divide::ITransform.

Definition at line 320 of file TransformComponent.cpp.

◆ scaleZ()

void Divide::TransformComponent::scaleZ ( F32  amount)
overridevirtual

Increase the scaling factor on the Z axis by the specified factor.

Implements Divide::ITransform.

Definition at line 335 of file TransformComponent.cpp.

◆ setDirection()

void Divide::TransformComponent::setDirection ( const vec3< F32 > &  fwdDirection,
const vec3< F32 > &  upDirection = WORLD_Y_AXIS 
)

Sets a new, local only, direction for the current component based on the specified world forward direction.

Definition at line 420 of file TransformComponent.cpp.

◆ setOffset()

void Divide::TransformComponent::setOffset ( bool  state,
const mat4< F32 > &  offset = mat4<F32>() 
)
noexcept

Definition at line 119 of file TransformComponent.cpp.

◆ setPosition() [1/4]

void Divide::TransformComponent::setPosition ( const vec3< F32 > &  position)
overridevirtual

Component <-> Transform interface.

Implements Divide::ITransform.

Definition at line 137 of file TransformComponent.cpp.

◆ setPosition() [2/4]

virtual void Divide::ITransform::setPosition ( const vec3< F32 > &  position)
virtual

Set the local X,Y and Z position.

Implements Divide::ITransform.

◆ setPosition() [3/4]

void Divide::TransformComponent::setPosition ( F32  x,
F32  y,
F32  z 
)
overridevirtual

Set the local X,Y and Z position.

Implements Divide::ITransform.

Definition at line 142 of file TransformComponent.cpp.

◆ setPosition() [4/4]

virtual void Divide::ITransform::setPosition ( F32  x,
F32  y,
F32  z 
)
virtual

Set the local X,Y and Z position.

Implements Divide::ITransform.

◆ setPositionX()

void Divide::TransformComponent::setPositionX ( F32  positionX)
overridevirtual

Set the object's position on the X axis.

Implements Divide::ITransform.

Definition at line 425 of file TransformComponent.cpp.

◆ setPositionY()

void Divide::TransformComponent::setPositionY ( F32  positionY)
overridevirtual

Set the object's position on the Y axis.

Implements Divide::ITransform.

Definition at line 435 of file TransformComponent.cpp.

◆ setPositionZ()

void Divide::TransformComponent::setPositionZ ( F32  positionZ)
overridevirtual

Set the object's position on the Z axis.

Implements Divide::ITransform.

Definition at line 445 of file TransformComponent.cpp.

◆ setRotation() [1/6]

void Divide::TransformComponent::setRotation ( Angle::DEGREES< F32 pitch,
Angle::DEGREES< F32 yaw,
Angle::DEGREES< F32 roll 
)
overridevirtual

Set the local orientation using the Euler system. The angles can be in either degrees(default) or radians

Implements Divide::ITransform.

Definition at line 188 of file TransformComponent.cpp.

◆ setRotation() [2/6]

virtual void Divide::ITransform::setRotation ( Angle::DEGREES< F32 pitch,
Angle::DEGREES< F32 yaw,
Angle::DEGREES< F32 roll 
)
virtual

Set the local orientation using the Euler system. The angles can be in either degrees(default) or radians

Implements Divide::ITransform.

◆ setRotation() [3/6]

void Divide::TransformComponent::setRotation ( const Quaternion< F32 > &  quat)
overridevirtual

Set the local orientation so that it matches the specified quaternion.

Implements Divide::ITransform.

Definition at line 168 of file TransformComponent.cpp.

◆ setRotation() [4/6]

virtual void Divide::ITransform::setRotation ( const Quaternion< F32 > &  quat)
virtual

Set the local orientation so that it matches the specified quaternion.

Implements Divide::ITransform.

◆ setRotation() [5/6]

void Divide::TransformComponent::setRotation ( const vec3< F32 > &  axis,
Angle::DEGREES< F32 degrees 
)
overridevirtual

Set the local orientation using the Axis-Angle system. The angle can be in either degrees(default) or radians

Implements Divide::ITransform.

Definition at line 178 of file TransformComponent.cpp.

◆ setRotation() [6/6]

virtual void Divide::ITransform::setRotation ( const vec3< F32 > &  axis,
Angle::DEGREES< F32 degrees 
)
virtual

Set the local orientation using the Axis-Angle system. The angle can be in either degrees(default) or radians

Implements Divide::ITransform.

◆ setRotationX()

void Divide::TransformComponent::setRotationX ( Angle::DEGREES< F32 angle)
overridevirtual

Set the rotation on the X axis (Axis-Angle used) by the specified angle (either degrees or radians)

Implements Divide::ITransform.

Definition at line 380 of file TransformComponent.cpp.

◆ setRotationY()

void Divide::TransformComponent::setRotationY ( Angle::DEGREES< F32 angle)
overridevirtual

Set the rotation on the Y axis (Axis-Angle used) by the specified angle (either degrees or radians)

Implements Divide::ITransform.

Definition at line 390 of file TransformComponent.cpp.

◆ setRotationZ()

void Divide::TransformComponent::setRotationZ ( Angle::DEGREES< F32 angle)
overridevirtual

Set the rotation on the Z axis (Axis-Angle used) by the specified angle (either degrees or radians)

Implements Divide::ITransform.

Definition at line 400 of file TransformComponent.cpp.

◆ setScale() [1/4]

void Divide::TransformComponent::setScale ( const vec3< F32 > &  amount)
overridevirtual

Set the local X,Y and Z scale factors.

Implements Divide::ITransform.

Definition at line 152 of file TransformComponent.cpp.

◆ setScale() [2/4]

virtual void Divide::ITransform::setScale ( const vec3< F32 > &  amount)
virtual

Set the local X,Y and Z scale factors.

Implements Divide::ITransform.

◆ setScale() [3/4]

void Divide::ITransform::setScale ( F32  amount)
inline

Set an uniform scale on all three axis.

Definition at line 124 of file TransformInterface.inl.

◆ setScale() [4/4]

void Divide::ITransform::setScale ( F32  x,
F32  y,
F32  z 
)
inline

Set a scaling factor for each axis.

Definition at line 126 of file TransformInterface.inl.

◆ setScaleX()

void Divide::TransformComponent::setScaleX ( F32  amount)
overridevirtual

Set the scaling factor on the X axis.

Implements Divide::ITransform.

Definition at line 260 of file TransformComponent.cpp.

◆ setScaleY()

void Divide::TransformComponent::setScaleY ( F32  amount)
overridevirtual

Set the scaling factor on the Y axis.

Implements Divide::ITransform.

Definition at line 275 of file TransformComponent.cpp.

◆ setScaleZ()

void Divide::TransformComponent::setScaleZ ( F32  amount)
overridevirtual

Set the scaling factor on the Z axis.

Implements Divide::ITransform.

Definition at line 290 of file TransformComponent.cpp.

◆ setTransform()

void Divide::TransformComponent::setTransform ( const TransformValues values)

Definition at line 481 of file TransformComponent.cpp.

◆ setTransformDirty() [1/2]

void Divide::TransformComponent::setTransformDirty ( TransformType  type)
protectednoexcept

Definition at line 126 of file TransformComponent.cpp.

◆ setTransformDirty() [2/2]

void Divide::TransformComponent::setTransformDirty ( U32  typeMask)
protectednoexcept

Definition at line 131 of file TransformComponent.cpp.

◆ setTransforms()

void Divide::TransformComponent::setTransforms ( const mat4< F32 > &  transform)

Definition at line 490 of file TransformComponent.cpp.

◆ translate()

void Divide::TransformComponent::translate ( const vec3< F32 > &  axisFactors)
overridevirtual

Add the specified translation factors to the current local position.

Implements Divide::ITransform.

Definition at line 198 of file TransformComponent.cpp.

◆ updateCachedValues()

void Divide::TransformComponent::updateCachedValues ( )
protected

Definition at line 838 of file TransformComponent.cpp.

◆ updateLocalMatrix()

void Divide::TransformComponent::updateLocalMatrix ( D64  interpolationFactor)
protected

Definition at line 599 of file TransformComponent.cpp.

◆ updateLocalMatrixInterpolated()

void Divide::TransformComponent::updateLocalMatrixInterpolated ( D64  interpolationFactor)
private

Definition at line 528 of file TransformComponent.cpp.

◆ updateLocalMatrixLocked()

void Divide::TransformComponent::updateLocalMatrixLocked ( )
private

Definition at line 510 of file TransformComponent.cpp.

Friends And Related Function Documentation

◆ Attorney::TransformComponentSGN

friend class Attorney::TransformComponentSGN
friend

Definition at line 54 of file TransformComponent.h.

◆ ECSSystem

template<typename T , typename U >
friend class ECSSystem
friend

Definition at line 193 of file TransformComponent.h.

◆ TransformSystem

Definition at line 53 of file TransformComponent.h.

Member Data Documentation

◆ _cacheDirty

bool Divide::TransformComponent::_cacheDirty = true
private

Definition at line 235 of file TransformComponent.h.

◆ _localMatrixLock

SharedMutex Divide::TransformComponent::_localMatrixLock {}
mutableprivate

Definition at line 238 of file TransformComponent.h.

◆ _lock

SharedMutex Divide::TransformComponent::_lock {}
mutableprivate

Definition at line 239 of file TransformComponent.h.

◆ _parentUsageContext

NodeUsageContext Divide::TransformComponent::_parentUsageContext
private

Definition at line 233 of file TransformComponent.h.

◆ _prevTransformValues

TransformValues Divide::TransformComponent::_prevTransformValues
private

Definition at line 228 of file TransformComponent.h.

◆ _transformInterface

Transform Divide::TransformComponent::_transformInterface
private

Definition at line 231 of file TransformComponent.h.

◆ _transformOffset

std::pair<bool, mat4<F32> > Divide::TransformComponent::_transformOffset
private

Definition at line 223 of file TransformComponent.h.

◆ _transformStack

TransformStack Divide::TransformComponent::_transformStack {}
private

Definition at line 230 of file TransformComponent.h.

◆ _transformUpdatedMask

std::atomic_uint Divide::TransformComponent::_transformUpdatedMask {}
private

Definition at line 227 of file TransformComponent.h.

◆ _transformValuesInterpolated

TransformValues Divide::TransformComponent::_transformValuesInterpolated
private

Definition at line 229 of file TransformComponent.h.

◆ _uniformScaled

bool Divide::TransformComponent::_uniformScaled = true
private

Definition at line 236 of file TransformComponent.h.


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