U4DEngine::U4DGameObject class

The U4DGameObject class represents all characters in a game.

Base classes

class U4DDynamicModel
The U4DDynamicModel class represents a 3D dynamic model entity.

Constructors, destructors, conversion operators

U4DGameObject()
Constructor class.
~U4DGameObject()
Destructor class.
U4DGameObject(const U4DGameObject& value)
Copy constructor.

Public functions

auto operator=(const U4DGameObject& value) -> U4DGameObject&
Copy constructor.
void update(double dt) virtual
Method which updates the state of the game character.
auto getBoneRestPose(std::string uBoneName, U4DMatrix4n& uBoneRestPoseMatrix) -> bool
returns the rest pose of the bone. Note, an armature must be present
auto getBoneAnimationPose(std::string uBoneName, U4DAnimation* uAnimation, U4DMatrix4n& uBoneAnimationPoseMatrix) -> bool
returns the animation pose of the bone. Note, an armature must be present and an animation must currently be playing.
auto loadModel(const char* uModelName) -> bool
Method which loads Digital Asset data into the game character. Note, the mesh asset binary data must be loaded before calling this method.
auto loadAnimationToModel(U4DAnimation* uAnimation, const char* uAnimationName) -> bool
Method which loads Animation data into the game character. Note, the animation asset binary data must be loaded before calling this method.

Function documentation

void U4DEngine::U4DGameObject::update(double dt) virtual

Method which updates the state of the game character.

Parameters
dt Time-step value

bool U4DEngine::U4DGameObject::getBoneRestPose(std::string uBoneName, U4DMatrix4n& uBoneRestPoseMatrix)

returns the rest pose of the bone. Note, an armature must be present

Parameters
uBoneName name of the bone
uBoneRestPoseMatrix bone rest pose matrix
Returns returns true if the rootbone rest pose exists. The uBoneRestPoseMatrix will contain the bone rest pose

bool U4DEngine::U4DGameObject::getBoneAnimationPose(std::string uBoneName, U4DAnimation* uAnimation, U4DMatrix4n& uBoneAnimationPoseMatrix)

returns the animation pose of the bone. Note, an armature must be present and an animation must currently be playing.

Parameters
uBoneName name of the bone
uAnimation current animation being played
uBoneAnimationPoseMatrix bone animation pose matrix
Returns returns true along with the animation pose space of the bone. The uBoneAnimationPoseMatrix will contain the animation pose matrix.

bool U4DEngine::U4DGameObject::loadModel(const char* uModelName)

Method which loads Digital Asset data into the game character. Note, the mesh asset binary data must be loaded before calling this method.

Parameters
uModelName Name of the model in the Digital Asset File
Returns Returns true if the digital asset data was successfully loaded

bool U4DEngine::U4DGameObject::loadAnimationToModel(U4DAnimation* uAnimation, const char* uAnimationName)

Method which loads Animation data into the game character. Note, the animation asset binary data must be loaded before calling this method.

Parameters
uAnimation Pointer to the animation
uAnimationName Name of the animation
Returns Returns true if the animation was successfully loaded