U4DEngine::U4DDynamicModel class

The U4DDynamicModel class represents a 3D dynamic model entity.

Base classes

class U4DStaticModel
The U4DStaticModel class represents a 3D static model entity.

Derived classes

class U4DGameObject
The U4DGameObject class represents all characters in a game.

Constructors, destructors, conversion operators

U4DDynamicModel()
Constructor for the class.
~U4DDynamicModel()
Destructor for the class.
U4DDynamicModel(const U4DDynamicModel& value)
Copy constructor.

Public functions

auto operator=(const U4DDynamicModel& value) -> U4DDynamicModel&
Copy constructor.
void addForce(U4DVector3n& uForce)
Method which adds all the forces acting on the model.
void addMoment(U4DVector3n& uMoment)
Method which adds all the moments acting on the model.
void enableKineticsBehavior()
Method which enables kinetics behavior on the 3D model.
void pauseKineticsBehavior()
Method which pauses kinetics behavior on the 3D model.
void resumeKineticsBehavior()
Method which resumes kinetics behavior on the 3D model.
auto isKineticsBehaviorEnabled() -> bool virtual
Method which returns if kinetics behavior are allowed to act on the 3D model.
void clearForce()
Clears all forces acting on the 3D model.
void clearMoment()
Clears all moments acting on the 3D model.
void setVelocity(U4DVector3n& uVelocity)
Method which sets the velocity of the model.
void setAngularVelocity(U4DVector3n& uAngularVelocity)
Method which sets the angular velocity of the model.
void setTimeOfImpact(float uTimeOfImpact)
Method which sets the time of impact. i.e., the time the 3D model will collide with another 3D model.
void setAxisOfRotation(U4DVector3n& uAxisOfRotation)
Method which sets the axis of rotation for the 3D model.
void setAwake(bool uValue)
Method which sets if the 3D model is awake.
void setEquilibrium(bool uValue)
Method which sets if the 3D model is in equilibrium.
void setGravity(U4DVector3n& uGravity)
Method which sets the gravity force acting on the 3D model.
void setDragCoefficient(U4DVector2n& uDragCoefficient)
Method which sets the drag coefficient acting on the 3D model.
void computeModelKineticEnergy(float dt)
Method which determines the kinetic motion of the model.
void resetTimeOfImpact()
Method which reset the time of impact of the model.
void resetGravity()
Method which resets the gravivy force of the model to its default value. Default gravity is (0.0,-10.0,0.0)
void resetDragCoefficient()
Method which resets the drag coefficients to its default value. Default drag coefficient is (0.9,0.9)
auto getForce() -> U4DVector3n
Method which returns commulative forces acting on the model.
auto getMoment() -> U4DVector3n
Method which returns commulative moments acting on the model.
auto getVelocity() -> U4DVector3n
Method which returns the velocity of the model.
auto getAngularVelocity() -> U4DVector3n
Method which returns the angular velocity of the model.
auto getAwake() -> bool
Method which returns if the 3D model is awake.
auto getModelKineticEnergy() -> float
Method which returns the kinetic energy of the model.
auto getTimeOfImpact() -> float
Method which returns the collision time of impact of the model.
auto getAxisOfRotation() -> U4DVector3n
Method which returns the model axis of rotation.
auto getEquilibrium() -> bool
Method which returns if the model is in equilibrium.
auto getGravity() -> U4DVector3n
Method which returns the gravity force acting on the 3D model.
auto getDragCoefficient() -> U4DVector2n
Method which returns the drag coefficients acting on the 3D model.
void loadIntoCollisionEngine(U4DEntityManager* uEntityManager) virtual
Self load 3D model into the collision engine.
void loadIntoPhysicsEngine(U4DEntityManager* uEntityManager, float dt) virtual
Self load 3D model into the physics engine.
void loadIntoVisibilityManager(U4DEntityManager* uEntityManager) virtual
self load 3d model into the visibility manager
void cleanUp() virtual
clear collision information, resets time of impact, resets equilibrium, clears collision list

Protected variables

U4DVector3n velocity
Velocity of 3D model.
U4DVector3n acceleration
Acceleration of 3D model.
U4DVector3n force
Force of 3D model.
U4DVector3n angularVelocity
Angular velocity of 3D model.
U4DVector3n moment
Moment of 3D model.
U4DVector3n axisOfRotation
The axis of rotation of the 3D model.
U4DVector3n gravity
Gravity force of the 3D model.
U4DVector2n dragCoefficient
Drag force coefficient of the 3D model.
float modelKineticEnergy
Kinetic energy of the model.
float timeOfImpact
Time that the 3D model will impact with another object.
bool equilibrium
Equilibrium state of the model upon collision.
bool kineticsEnabled
Variable representing if kinetics behaviour enabled. i.e., if forces can act upon the 3D model.
bool isAwake
Variable representing if the model is awake.

Function documentation

void U4DEngine::U4DDynamicModel::addForce(U4DVector3n& uForce)

Method which adds all the forces acting on the model.

Parameters
uForce 3D vector representing a force

void U4DEngine::U4DDynamicModel::addMoment(U4DVector3n& uMoment)

Method which adds all the moments acting on the model.

Parameters
uMoment 3D vector representing a moment

void U4DEngine::U4DDynamicModel::enableKineticsBehavior()

Method which enables kinetics behavior on the 3D model.

It allows forces to act on the 3D model

bool U4DEngine::U4DDynamicModel::isKineticsBehaviorEnabled() virtual

Method which returns if kinetics behavior are allowed to act on the 3D model.

Returns Returns true if kinetics behavior are allowed to act on the 3D model

void U4DEngine::U4DDynamicModel::setVelocity(U4DVector3n& uVelocity)

Method which sets the velocity of the model.

Parameters
uVelocity 3D vector representing the velocity of the model

void U4DEngine::U4DDynamicModel::setAngularVelocity(U4DVector3n& uAngularVelocity)

Method which sets the angular velocity of the model.

Parameters
uAngularVelocity 3D vector representing the angular velocity of the model

void U4DEngine::U4DDynamicModel::setTimeOfImpact(float uTimeOfImpact)

Method which sets the time of impact. i.e., the time the 3D model will collide with another 3D model.

Parameters
uTimeOfImpact The time of impact

void U4DEngine::U4DDynamicModel::setAxisOfRotation(U4DVector3n& uAxisOfRotation)

Method which sets the axis of rotation for the 3D model.

Parameters
uAxisOfRotation 3D vector representing the axis of rotation for the model

void U4DEngine::U4DDynamicModel::setAwake(bool uValue)

Method which sets if the 3D model is awake.

Parameters
uValue Set to true if the 3D model is awake

void U4DEngine::U4DDynamicModel::setEquilibrium(bool uValue)

Method which sets if the 3D model is in equilibrium.

Parameters
uValue Set to true if the 3D model is in equilibrium

void U4DEngine::U4DDynamicModel::setGravity(U4DVector3n& uGravity)

Method which sets the gravity force acting on the 3D model.

Parameters
uGravity 3D vector representing the gravity force acting on the 3D model

void U4DEngine::U4DDynamicModel::setDragCoefficient(U4DVector2n& uDragCoefficient)

Method which sets the drag coefficient acting on the 3D model.

Parameters
uDragCoefficient 2D vector representing the drag coefficients

void U4DEngine::U4DDynamicModel::computeModelKineticEnergy(float dt)

Method which determines the kinetic motion of the model.

Parameters
dt time step value

U4DVector3n U4DEngine::U4DDynamicModel::getForce()

Method which returns commulative forces acting on the model.

Returns Returns commulative forces acting on the model

U4DVector3n U4DEngine::U4DDynamicModel::getMoment()

Method which returns commulative moments acting on the model.

Returns Returns commulative moments acting on the model

U4DVector3n U4DEngine::U4DDynamicModel::getVelocity()

Method which returns the velocity of the model.

Returns Returns the velocity of the model

U4DVector3n U4DEngine::U4DDynamicModel::getAngularVelocity()

Method which returns the angular velocity of the model.

Returns Returns the angular velocity of the model

bool U4DEngine::U4DDynamicModel::getAwake()

Method which returns if the 3D model is awake.

Returns returns true if the 3D model is awake

float U4DEngine::U4DDynamicModel::getModelKineticEnergy()

Method which returns the kinetic energy of the model.

Returns Returns the kinetic energy of the model

float U4DEngine::U4DDynamicModel::getTimeOfImpact()

Method which returns the collision time of impact of the model.

Returns Returns the time of impact

U4DVector3n U4DEngine::U4DDynamicModel::getAxisOfRotation()

Method which returns the model axis of rotation.

Returns Returns 3D vector representing the model axis of rotation

bool U4DEngine::U4DDynamicModel::getEquilibrium()

Method which returns if the model is in equilibrium.

Returns Returns true if the model is in equilibrium

U4DVector3n U4DEngine::U4DDynamicModel::getGravity()

Method which returns the gravity force acting on the 3D model.

Returns Returns a 3D vector representing the gravity force acting on the model

U4DVector2n U4DEngine::U4DDynamicModel::getDragCoefficient()

Method which returns the drag coefficients acting on the 3D model.

Returns Returns a 2D vector representing the drag coefficients acting on the model

void U4DEngine::U4DDynamicModel::loadIntoCollisionEngine(U4DEntityManager* uEntityManager) virtual

Self load 3D model into the collision engine.

Parameters
uEntityManager pointer to the entity manager

void U4DEngine::U4DDynamicModel::loadIntoPhysicsEngine(U4DEntityManager* uEntityManager, float dt) virtual

Self load 3D model into the physics engine.

Parameters
uEntityManager pointer to the entity manager
dt time step

void U4DEngine::U4DDynamicModel::loadIntoVisibilityManager(U4DEntityManager* uEntityManager) virtual

self load 3d model into the visibility manager

Parameters
uEntityManager pointer to the entity manager