Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CTransformMatrix Class Reference

This is an object class that describes a transform, but the input data is a matrix. More...

#include <Transform/CTransformMatrix.h>

Inheritance diagram for Skylicht::CTransformMatrix:
Skylicht::CTransformEuler Skylicht::CTransform Skylicht::CComponentSystem Skylicht::IActivatorObject

Public Member Functions

virtual void reset ()
virtual void initComponent ()
virtual void updateComponent ()
virtual core::vector3df getRelativePosition ()
core::vector3df getPosition ()
core::vector3df getRotation ()
core::vector3df getScale ()
virtual void setRelativeTransform (const core::matrix4 &mat)
virtual const core::matrix4 & getRelativeTransform ()
virtual void getRelativeTransform (core::matrix4 &matrix)
virtual CObjectSerializablecreateSerializable ()
Public Member Functions inherited from Skylicht::CTransformEuler
const core::vector3df & getPosition ()
void setPosition (const core::vector3df &pos)
const core::vector3df & getRotation ()
const core::vector3df & getScale ()
void setScale (const core::vector3df &scale)
void setRotation (const core::vector3df &eulerDeg)
void setRotation (const core::quaternion &q)
float getYaw ()
void setYaw (float deg)
float getPitch ()
void setPitch (float deg)
float getRoll ()
void setRoll (float deg)
void setOrientation (const core::vector3df &front, const core::vector3df &up)
void lookAt (const core::vector3df &position)
void getRotation (core::quaternion &q)
core::quaternion getRotationQuaternion ()
void getFront (core::vector3df &front)
core::vector3df getFront ()
void getUp (core::vector3df &up)
core::vector3df getUp ()
void getRight (core::vector3df &right)
core::vector3df getRight ()
virtual void loadSerializable (CObjectSerializable *object)
Public Member Functions inherited from Skylicht::CTransform
void attachTransform (CEntity *entity)
core::vector3df getWorldPosition ()
void setChanged (bool b)
bool hasChanged ()
bool isAttached ()
bool isWorldTransform ()
void setIsWorldTransform (bool b)
CTransform * getParent ()
CGameObject * getParentObject ()
CEntitygetParentEntity ()
core::matrix4 calcWorldTransform ()
void setWorldMatrix (const core::matrix4 &world)
Public Member Functions inherited from Skylicht::CComponentSystem
const char * getName ()
virtual void startComponent ()
virtual void endUpdate ()
virtual void onEnable (bool b)
virtual void onUpdateCullingLayer (u32 mask)
void setEnable (bool b)
bool isEnable ()
CGameObject * getGameObject ()
void setEnableSerializable (bool b)
bool isSerializable ()
void addLinkComponent (CComponentSystem *comp)
void removeAllLink ()
Public Member Functions inherited from Skylicht::IActivatorObject
virtual ~IActivatorObject ()
 Virtual destructor for polymorphic activator objects.

Additional Inherited Members

Static Public Member Functions inherited from Skylicht::CComponentSystem
static int useComponent (CComponentSystem *used)
Protected Member Functions inherited from Skylicht::CComponentSystem
void setOwner (CGameObject *obj)
Protected Attributes inherited from Skylicht::CTransformEuler
core::vector3df m_position
core::vector3df m_rotation
core::vector3df m_scale
core::matrix4 m_transform
bool m_matrixChanged
Protected Attributes inherited from Skylicht::CTransform
bool m_hasChanged
bool m_attached
bool m_isWorldTransform
Protected Attributes inherited from Skylicht::CComponentSystem
CGameObject * m_gameObject
bool m_enable
bool m_serializable
std::vector< CComponentSystem * > m_linkComponent

Detailed Description

This is an object class that describes a transform, but the input data is a matrix.

In some cases, when using third-party modules, converting a transform back to its position or rotation can have performance limitations. Therefore, it's better to use the matrix directly. For example, from the Bullet3 physics engine. And GameObjects with an attached Physics::CRigidbody component will have their transform converted to a matrix.

Although CTransformMatrix inherits from CTransformEuler, but some of the inherits member functions will not work like setPosition, setRotation, setScale...

You can call the setupMatrixTransform function from CGameObject to convert the transform from Euler to a Matrix.

Example code:

CGameObject* gameObject = zone->createEmptyObject();
gameObject->setupMatrixTransform();
CTransformMatrix* transform = gameObject->getTransformMatrix();
core::matrix4 mat;
mat.setTranslation(core::vector3df(-1.0f, 1.0f, 0.0f));
transform->setRelativeTransform(mat);
This object class stores information for a GameObject.
Definition CGameObject.h:52

Member Function Documentation

◆ createSerializable()

virtual CObjectSerializable * Skylicht::CTransformMatrix::createSerializable ( )
virtual

Reimplemented from Skylicht::CTransformEuler.

◆ getRelativePosition()

virtual core::vector3df Skylicht::CTransformMatrix::getRelativePosition ( )
inlinevirtual

Reimplemented from Skylicht::CTransformEuler.

◆ getRelativeTransform() [1/2]

virtual const core::matrix4 & Skylicht::CTransformMatrix::getRelativeTransform ( )
virtual

Reimplemented from Skylicht::CTransformEuler.

◆ getRelativeTransform() [2/2]

virtual void Skylicht::CTransformMatrix::getRelativeTransform ( core::matrix4 & matrix)
virtual

Reimplemented from Skylicht::CTransformEuler.

◆ initComponent()

virtual void Skylicht::CTransformMatrix::initComponent ( )
virtual

Reimplemented from Skylicht::CTransformEuler.

◆ reset()

virtual void Skylicht::CTransformMatrix::reset ( )
virtual

Reimplemented from Skylicht::CTransformEuler.

◆ setRelativeTransform()

virtual void Skylicht::CTransformMatrix::setRelativeTransform ( const core::matrix4 & mat)
virtual

Reimplemented from Skylicht::CTransformEuler.

◆ updateComponent()

virtual void Skylicht::CTransformMatrix::updateComponent ( )
virtual

Reimplemented from Skylicht::CTransformEuler.


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