Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DStaticAction Class Reference

The U4DStaticAction class represents actions such as collision detections applied to a 3D model entity. More...

Inherited by U4DEngine::U4DDynamicAction.

Public Member Functions

 U4DStaticAction (U4DModel *uU4DModel)
 Constructor for the class.
 
 ~U4DStaticAction ()
 Destructor for the class.
 
 U4DStaticAction (const U4DStaticAction &value)
 Copy constructor.
 
U4DStaticActionoperator= (const U4DStaticAction &value)
 Copy constructor. More...
 
void initMass (float uMass)
 Method which sets the mass of the model. More...
 
void initCenterOfMass (U4DVector3n &uCenterOfMass)
 Method which sets the center of mass of the model. More...
 
void initCoefficientOfRestitution (float uValue)
 Method which sets the coefficient of restitution of the model. More...
 
void initInertiaTensorType (INERTIATENSORTYPE uInertiaTensorType)
 Method which sets the Interta tensor type of the model. More...
 
void initAsPlatform (bool uValue)
 Method which sets the model as a platform. More...
 
void setNarrowPhaseBoundingVolumeVisibility (bool uValue)
 Methods which sets the visibility of the Narrow-Phase bounding volume. More...
 
void setBroadPhaseBoundingVolumeVisibility (bool uValue)
 Methods which sets the visibility of the Broad-Phase bounding volume. More...
 
void setCollisionNormalFaceDirection (U4DVector3n &uNormalFaceDirection)
 Method which sets the collision normal face direction. More...
 
void setCollisionPenetrationDepth (float uPenetrationDepth)
 Method which sets the collision penetration depth. More...
 
void setNormalForce (U4DVector3n &uNormalForce)
 Method which sets the Normal force. More...
 
void setModelHasCollided (bool uValue)
 Method which informs the engine that the model has collided. More...
 
void setModelHasCollidedBroadPhase (bool uValue)
 Method which informs the engine that the model has collided in broad phase stage. More...
 
void enableCollisionBehavior ()
 Enables the model to detect collisions. More...
 
void pauseCollisionBehavior ()
 Pauses the ability of the model to detect collisions.
 
void resumeCollisionBehavior ()
 Resumes the ability for the model to detect collisions. More...
 
bool isCollisionBehaviorEnabled ()
 Method which returns if the model can detect collisions. More...
 
void computeInertiaTensor ()
 Computes the inertia tensor of the model geometry.
 
void updateConvexHullVertices ()
 Method which updates the convex-hull vertices of the model.
 
void addCollisionContactPoint (U4DVector3n &uContactPoint)
 Method which adds collision contact points to a container. More...
 
void clearConvexHullVertices ()
 Method which clears all convex-hull vertices.
 
void clearCollisionInformation ()
 Method which clears all collision information.
 
float getMass () const
 Method which returns the mass of the model. More...
 
U4DVector3n getCenterOfMass ()
 Method which returns the center of mass of the model. More...
 
float getCoefficientOfRestitution ()
 Method which returns the coefficient of restitution of the model. More...
 
INERTIATENSORTYPE getInertiaTensorType ()
 Method which returns the inertia tensor type of the model. More...
 
bool getIsPlatform ()
 Method which returns if the model should be seens as a platform by the collision detection system. More...
 
U4DMatrix3n getMomentOfInertiaTensor ()
 Method which returns a 3x3 matrix representing the moment of inertia tensor. More...
 
U4DMatrix3n getInverseMomentOfInertiaTensor ()
 Method which returns a 3x3 matrix representing the inverse moment of inertia tensor. More...
 
std::vector< U4DVector3n > & getConvexHullVertices ()
 Method which returns the convex-hull vertices. More...
 
int getConvexHullVerticesCount ()
 Method which returns the convex-hull vertices count. More...
 
U4DBoundingVolumegetNarrowPhaseBoundingVolume ()
 Method which returns the narrow-phase bounding volume. More...
 
bool getNarrowPhaseBoundingVolumeVisibility ()
 Method which returns if the engine should render the narrow-phase bounding volume. More...
 
U4DBoundingVolumegetBroadPhaseBoundingVolume ()
 Method which returns the broad-phase bounding volume. More...
 
bool getBroadPhaseBoundingVolumeVisibility ()
 Method which returns if the engine should render the broad-phase bounding volume. More...
 
U4DVector3n getNormalForce ()
 Method which returns a 3D vector representing the Normal force. More...
 
std::vector< U4DVector3ngetCollisionContactPoints ()
 Method which returns the collision contact points. More...
 
void clearCollisionContactPoints ()
 Method which clears all collision contact points.
 
U4DVector3n getCollisionNormalFaceDirection ()
 Method which returns the collision normal face direction vector. More...
 
float getCollisionPenetrationDepth ()
 Method which returns the collision penetration depth. More...
 
bool getModelHasCollided ()
 Method which returns true if the model has collided. More...
 
bool getModelHasCollidedBroadPhase ()
 Method which returns true if the model has collided in Broad Phase stage. More...
 
void setCollisionFilterCategory (int uFilterCategory)
 Sets the filter category for collision. More...
 
void setCollisionFilterMask (int uFilterMask)
 Set the filter mask for collision. More...
 
void setCollisionFilterGroupIndex (signed int uGroupIndex)
 Sets the group filter for collisions. More...
 
int getCollisionFilterCategory ()
 Get the collision filter category for the entity. More...
 
int getCollisionFilterMask ()
 Get the collision filter mask for the entity
More...
 
signed int getCollisionFilterGroupIndex ()
 Get the filter group index
More...
 
void setIsCollisionSensor (bool uValue)
 Sets the entity as a collision sensor. More...
 
bool getIsCollisionSensor ()
 Is the entity a collision sensor. More...
 
void addToCollisionList (U4DStaticAction *uModel)
 Add all the 3D models the entity is currently colliding. More...
 
void addToBroadPhaseCollisionList (U4DStaticAction *uModel)
 Add all the 3D models the entity is currently colliding in broad phase collision. More...
 
std::vector< U4DStaticAction * > getCollisionList ()
 Gets a list of all entities currently colliding with the entity. More...
 
std::vector< U4DStaticAction * > getBroadPhaseCollisionList ()
 Gets a list of all entities currently colliding (broad phase stage) with the entity. More...
 
void setCollidingTag (std::string uCollidingTag)
 Sets a collision tag. More...
 
std::string getCollidingTag ()
 Gets the collision tag. More...
 
void clearCollisionList ()
 Clears the collision list. More...
 
void clearBroadPhaseCollisionList ()
 Clears the collision list. More...
 

Public Attributes

U4DModelmodel
 

Protected Attributes

std::string name
 Name of the entity.
 

Detailed Description

The U4DStaticAction class represents actions such as collision detections applied to a 3D model entity.

Member Function Documentation

◆ addCollisionContactPoint()

void U4DEngine::U4DStaticAction::addCollisionContactPoint ( U4DVector3n uContactPoint)

Method which adds collision contact points to a container.

Parameters
uContactPointcollision contact points to add to container

◆ addToBroadPhaseCollisionList()

void U4DEngine::U4DStaticAction::addToBroadPhaseCollisionList ( U4DStaticAction uModel)

Add all the 3D models the entity is currently colliding in broad phase collision.

The collision list keeps a list of all the 3D entities currently colliding with this entity

Parameters
uModel3d model currently colliding

◆ addToCollisionList()

void U4DEngine::U4DStaticAction::addToCollisionList ( U4DStaticAction uModel)

Add all the 3D models the entity is currently colliding.

The collision list keeps a list of all the 3D entities currently colliding with this entity

Parameters
uModel3d model currently colliding

◆ clearBroadPhaseCollisionList()

void U4DEngine::U4DStaticAction::clearBroadPhaseCollisionList ( )

Clears the collision list.

The collision list keeps a list of all the 3D entities currently colliding with this entity during broad phase stage

◆ clearCollisionList()

void U4DEngine::U4DStaticAction::clearCollisionList ( )

Clears the collision list.

The collision list keeps a list of all the 3D entities currently colliding with this entity

◆ enableCollisionBehavior()

void U4DEngine::U4DStaticAction::enableCollisionBehavior ( )

Enables the model to detect collisions.

enables the model to collide with other convex objects.

◆ getBroadPhaseBoundingVolume()

U4DBoundingVolume * U4DEngine::U4DStaticAction::getBroadPhaseBoundingVolume ( )

Method which returns the broad-phase bounding volume.

Returns
Returns the broad-phase bounding volume

◆ getBroadPhaseBoundingVolumeVisibility()

bool U4DEngine::U4DStaticAction::getBroadPhaseBoundingVolumeVisibility ( )

Method which returns if the engine should render the broad-phase bounding volume.

Returns
Returns true if the engine should render the broad-phase bounding volume

◆ getBroadPhaseCollisionList()

std::vector< U4DStaticAction * > U4DEngine::U4DStaticAction::getBroadPhaseCollisionList ( )

Gets a list of all entities currently colliding (broad phase stage) with the entity.

The collision list keeps a list of all the 3D entities currently colliding with this entity

Returns
vector with a list of entities

◆ getCenterOfMass()

U4DVector3n U4DEngine::U4DStaticAction::getCenterOfMass ( )

Method which returns the center of mass of the model.

Returns
Returns the center of mass of the model

◆ getCoefficientOfRestitution()

float U4DEngine::U4DStaticAction::getCoefficientOfRestitution ( )

Method which returns the coefficient of restitution of the model.

Returns
Returns the coefficient of restitution of the model

◆ getCollidingTag()

std::string U4DEngine::U4DStaticAction::getCollidingTag ( )

Gets the collision tag.

The collision tag can be used to determine exactly who is the entity colliding with

Returns
tag name

◆ getCollisionContactPoints()

std::vector< U4DVector3n > U4DEngine::U4DStaticAction::getCollisionContactPoints ( )

Method which returns the collision contact points.

Returns
Returns the collision contact points

◆ getCollisionFilterCategory()

int U4DEngine::U4DStaticAction::getCollisionFilterCategory ( )

Get the collision filter category for the entity.

The filter category refers to "I am of type..."

Returns
filter category

◆ getCollisionFilterGroupIndex()

signed int U4DEngine::U4DStaticAction::getCollisionFilterGroupIndex ( )

Get the filter group index

If both group index values are the same and positive, then both entities will collide. if both group index values are the same and negative, they the entities do not collide. if either entity has a group index of zero, then the category/mask rule is used. if both entities group index are non-zero but different, the category/mask rule is used.

Returns
filter group

◆ getCollisionFilterMask()

int U4DEngine::U4DStaticAction::getCollisionFilterMask ( )

Get the collision filter mask for the entity

the filter mask refers to "I collide with types of..."

Returns
filter mask

◆ getCollisionList()

std::vector< U4DStaticAction * > U4DEngine::U4DStaticAction::getCollisionList ( )

Gets a list of all entities currently colliding with the entity.

The collision list keeps a list of all the 3D entities currently colliding with this entity

Returns
vector with a list of entities

◆ getCollisionNormalFaceDirection()

U4DVector3n U4DEngine::U4DStaticAction::getCollisionNormalFaceDirection ( )

Method which returns the collision normal face direction vector.

Returns
Returns 3D vector representing the collision normal face direction vector

◆ getCollisionPenetrationDepth()

float U4DEngine::U4DStaticAction::getCollisionPenetrationDepth ( )

Method which returns the collision penetration depth.

Returns
Returns the collision penetration depth

◆ getConvexHullVertices()

std::vector< U4DVector3n > & U4DEngine::U4DStaticAction::getConvexHullVertices ( )

Method which returns the convex-hull vertices.

Returns
Returns the convex-hull vertices

◆ getConvexHullVerticesCount()

int U4DEngine::U4DStaticAction::getConvexHullVerticesCount ( )

Method which returns the convex-hull vertices count.

Returns
Return the convex-hull vertices count

◆ getInertiaTensorType()

INERTIATENSORTYPE U4DEngine::U4DStaticAction::getInertiaTensorType ( )

Method which returns the inertia tensor type of the model.

Returns
Returns the inertia tensor type. i.e., cubic, spherical or cylindrical

◆ getInverseMomentOfInertiaTensor()

U4DMatrix3n U4DEngine::U4DStaticAction::getInverseMomentOfInertiaTensor ( )

Method which returns a 3x3 matrix representing the inverse moment of inertia tensor.

Returns
Returns a 3x3 matrix representing the inverse moment of inertia tensor

◆ getIsCollisionSensor()

bool U4DEngine::U4DStaticAction::getIsCollisionSensor ( )

Is the entity a collision sensor.

When an entity is set as a sensor, the engine will not compute a collision response for the entity. That is, it will not compute the resultant velocity and position

Returns
true if the entity is a collision sensor

◆ getIsPlatform()

bool U4DEngine::U4DStaticAction::getIsPlatform ( )

Method which returns if the model should be seens as a platform by the collision detection system.

Returns
Returns true if the model is a platform

◆ getMass()

float U4DEngine::U4DStaticAction::getMass ( ) const

Method which returns the mass of the model.

Returns
Returns the mass of the model

◆ getModelHasCollided()

bool U4DEngine::U4DStaticAction::getModelHasCollided ( )

Method which returns true if the model has collided.

Returns
Returns true if the model has collided

◆ getModelHasCollidedBroadPhase()

bool U4DEngine::U4DStaticAction::getModelHasCollidedBroadPhase ( )

Method which returns true if the model has collided in Broad Phase stage.

Returns
Returns true if the model has collided

◆ getMomentOfInertiaTensor()

U4DMatrix3n U4DEngine::U4DStaticAction::getMomentOfInertiaTensor ( )

Method which returns a 3x3 matrix representing the moment of inertia tensor.

Returns
Returns a 3x3 matrix representing the moment of inertia tensor

◆ getNarrowPhaseBoundingVolume()

U4DBoundingVolume * U4DEngine::U4DStaticAction::getNarrowPhaseBoundingVolume ( )

Method which returns the narrow-phase bounding volume.

Returns
Returns the narrow-phase bounding volume

◆ getNarrowPhaseBoundingVolumeVisibility()

bool U4DEngine::U4DStaticAction::getNarrowPhaseBoundingVolumeVisibility ( )

Method which returns if the engine should render the narrow-phase bounding volume.

Returns
Returns true if the engine should render the narrow-phase bounding volume

◆ getNormalForce()

U4DVector3n U4DEngine::U4DStaticAction::getNormalForce ( )

Method which returns a 3D vector representing the Normal force.

Returns
Returns a 3D vector representing the normal force

◆ initAsPlatform()

void U4DEngine::U4DStaticAction::initAsPlatform ( bool  uValue)

Method which sets the model as a platform.

Parameters
uValueSet to true if the collision detection system should treat this model as a floor/ground

◆ initCenterOfMass()

void U4DEngine::U4DStaticAction::initCenterOfMass ( U4DVector3n uCenterOfMass)

Method which sets the center of mass of the model.

Parameters
uCenterOfMassCenter of mass of the static model

◆ initCoefficientOfRestitution()

void U4DEngine::U4DStaticAction::initCoefficientOfRestitution ( float  uValue)

Method which sets the coefficient of restitution of the model.

Parameters
uValueCoefficient of restitution of the static model

◆ initInertiaTensorType()

void U4DEngine::U4DStaticAction::initInertiaTensorType ( INERTIATENSORTYPE  uInertiaTensorType)

Method which sets the Interta tensor type of the model.

Parameters
uInertiaTensorTypeInertia Tensor type. i.e., cubic, spherical or cylindrical

◆ initMass()

void U4DEngine::U4DStaticAction::initMass ( float  uMass)

Method which sets the mass of the model.

Parameters
uMassMass of the static model

◆ isCollisionBehaviorEnabled()

bool U4DEngine::U4DStaticAction::isCollisionBehaviorEnabled ( )

Method which returns if the model can detect collisions.

Returns
Returns true if the model can detect collisions

◆ operator=()

U4DStaticAction & U4DEngine::U4DStaticAction::operator= ( const U4DStaticAction value)

Copy constructor.

Parameters
value3D Static model object to copy to
Returns
Returns a copy of the 3D static model

◆ resumeCollisionBehavior()

void U4DEngine::U4DStaticAction::resumeCollisionBehavior ( )

Resumes the ability for the model to detect collisions.

informs the collision engine to re-start collision detection with this object.

◆ setBroadPhaseBoundingVolumeVisibility()

void U4DEngine::U4DStaticAction::setBroadPhaseBoundingVolumeVisibility ( bool  uValue)

Methods which sets the visibility of the Broad-Phase bounding volume.

Parameters
uValueThe engine will render the broad-phase bounding volume if set to true

◆ setCollidingTag()

void U4DEngine::U4DStaticAction::setCollidingTag ( std::string  uCollidingTag)

Sets a collision tag.

The collision tag can be used to determine exactly who is the entity colliding with

Parameters
uCollidingTagtag name

◆ setCollisionFilterCategory()

void U4DEngine::U4DStaticAction::setCollisionFilterCategory ( int  uFilterCategory)

Sets the filter category for collision.

The filter category refers to "I am of type...".

Parameters
uFilterCategoryfilter category

◆ setCollisionFilterGroupIndex()

void U4DEngine::U4DStaticAction::setCollisionFilterGroupIndex ( signed int  uGroupIndex)

Sets the group filter for collisions.

If both group index values are the same and positive, then both entities will collide. if both group index values are the same and negative, they the entities do not collide. if either entity has a group index of zero, then the category/mask rule is used. if both entities group index are non-zero but different, the category/mask rule is used.

Parameters
intgroup index

◆ setCollisionFilterMask()

void U4DEngine::U4DStaticAction::setCollisionFilterMask ( int  uFilterMask)

Set the filter mask for collision.

The filter mask refers to "I collide with types..."

Parameters
uFilterMaskfilter mask

◆ setCollisionNormalFaceDirection()

void U4DEngine::U4DStaticAction::setCollisionNormalFaceDirection ( U4DVector3n uNormalFaceDirection)

Method which sets the collision normal face direction.

Parameters
uNormalFaceDirection3D vector representing the normal face direction

◆ setCollisionPenetrationDepth()

void U4DEngine::U4DStaticAction::setCollisionPenetrationDepth ( float  uPenetrationDepth)

Method which sets the collision penetration depth.

Parameters
uPenetrationDepthCollision penetration depth

◆ setIsCollisionSensor()

void U4DEngine::U4DStaticAction::setIsCollisionSensor ( bool  uValue)

Sets the entity as a collision sensor.

When an entity is set as a sensor, the engine will not compute a collision response for the entity. That is, it will not compute the resultant velocity and position

Parameters
uValuevalue

◆ setModelHasCollided()

void U4DEngine::U4DStaticAction::setModelHasCollided ( bool  uValue)

Method which informs the engine that the model has collided.

Parameters
uValueIf set to true, the model has collided

◆ setModelHasCollidedBroadPhase()

void U4DEngine::U4DStaticAction::setModelHasCollidedBroadPhase ( bool  uValue)

Method which informs the engine that the model has collided in broad phase stage.

Parameters
uValueIf set to true, the model has collided

◆ setNarrowPhaseBoundingVolumeVisibility()

void U4DEngine::U4DStaticAction::setNarrowPhaseBoundingVolumeVisibility ( bool  uValue)

Methods which sets the visibility of the Narrow-Phase bounding volume.

Parameters
uValueThe engine will render the narrow-phase bounding volume if set to true

◆ setNormalForce()

void U4DEngine::U4DStaticAction::setNormalForce ( U4DVector3n uNormalForce)

Method which sets the Normal force.

Parameters
uNormalForce3D vector representing the normal force