Untold Engine
Beta v0.0.16
docs
|
The U4DEntity class is a Super-Class for all the entities in a game, such as 3D models, buttons, fonts, etc. More...
Inherits U4DEngine::U4DEntityNode< U4DEntity >.
Inherited by U4DEngine::U4DCamera, U4DEngine::U4DDirectionalLight, U4DEngine::U4DLayer, U4DEngine::U4DParticle, U4DEngine::U4DPointLight, and U4DEngine::U4DVisibleEntity.
Public Member Functions | |
U4DEntity () | |
Entity Constructor. It creates the entity with the local orientation set to zero and local position set to the origin. The forwad vector is set to (0.0,0.0,-1.0). Parent and Next pointer set to null. | |
~U4DEntity () | |
Entity Destructor. | |
U4DEntity (const U4DEntity &value) | |
Entity Copy Constructor. | |
U4DEntity & | operator= (const U4DEntity &value) |
Entity Copy Constructor. More... | |
void | setName (std::string uName) |
Method which sets the name of the Entity. More... | |
std::string | getName () |
Method which returns the name of the Entity. More... | |
void | setEntityType (ENTITYTYPE uType) |
Method which sets the type of the Entity. More... | |
ENTITYTYPE | getEntityType () |
Method which returns the type of the Entity. More... | |
void | setLocalSpace (U4DDualQuaternion &uLocalSpace) |
Method which sets the local space of the Entity. More... | |
void | setLocalSpace (U4DMatrix4n &uMatrix) |
Method which sets the local space of the Entity. More... | |
U4DDualQuaternion | getLocalSpace () |
U4DDualQuaternion | getAbsoluteSpace () |
Method which returns the absolute space of the Entity. More... | |
U4DQuaternion | getLocalSpaceOrientation () |
Method which returns the local orientation space of the Entity. More... | |
U4DQuaternion | getLocalSpacePosition () |
Method which returns the local position space of the Entity. More... | |
U4DQuaternion | getAbsoluteSpaceOrientation () |
Method which returns the absolute orientation space of the Entity. More... | |
U4DQuaternion | getAbsoluteSpacePosition () |
Method which returns the absolute position space of the Entity. More... | |
void | setLocalSpaceOrientation (U4DQuaternion &uOrientation) |
Method which sets the local space orientation of the Entity. More... | |
void | setLocalSpacePosition (U4DQuaternion &uPosition) |
Method which sets the local space position of the Entity. More... | |
U4DVector3n | getLocalOrientation () |
Method which returns the Local orientation of the Entity. More... | |
U4DVector3n | getLocalPosition () |
Method which returns the local position of the Entity. More... | |
U4DVector3n | getAbsoluteOrientation () |
Method which returns the absolute orientation of the Entity. More... | |
U4DVector3n | getAbsolutePosition () |
Method which returns the absolute position of the Entity. More... | |
U4DVector3n | getEntityForwardVector () |
Method which returns the forwad vector of the Entity. More... | |
void | setEntityForwardVector (U4DVector3n &uForwardVector) |
Method which sets the forward vectof of the Entity. The default value is (0.0,0.0,-1.0) More... | |
U4DMatrix3n | getAbsoluteMatrixOrientation () |
Method which returns the absolute orientation of the Entity. More... | |
U4DMatrix3n | getLocalMatrixOrientation () |
Method which returns the local orientation of the Entity. More... | |
void | translateTo (U4DVector3n &translation) |
Method which translates entity to a new position. More... | |
void | translateTo (float x, float y, float z) |
Method which translates entity to a new position. More... | |
void | translateTo (U4DVector2n &translation) |
Method which translates entity to a new position. More... | |
void | translateBy (float x, float y, float z) |
Method which translates entity by certain amount. More... | |
void | translateBy (U4DVector3n &translation) |
Method which translates entity by a certain amount. More... | |
void | rotateTo (U4DQuaternion &rotation) |
Method which rotates entity to a new orientation. More... | |
void | rotateBy (U4DQuaternion &rotation) |
Method which rotates entity by a certain amount. More... | |
void | rotateTo (float angle, U4DVector3n &axis) |
Method which rotates entity to a new orientation. More... | |
void | rotateBy (float angle, U4DVector3n &axis) |
Method which rotates entity by certain amount. More... | |
void | rotateTo (float angleX, float angleY, float angleZ) |
Method which rotates entity to a new orientation. More... | |
void | rotateBy (float angleX, float angleY, float angleZ) |
Method which rotates entity by a certain amount. More... | |
void | rotateAboutAxis (float angle, U4DVector3n &axisOrientation, U4DVector3n &axisPosition) |
Method which rotates entity about an axis. More... | |
void | rotateAboutAxis (U4DQuaternion &uOrientation, U4DVector3n &axisPosition) |
Method which rotates entity about an axis. More... | |
virtual void | viewInDirection (U4DVector3n &uDestinationPoint) |
Method which sets the view direction of the entity. More... | |
virtual U4DVector3n | getViewInDirection () |
Method which rotates the view direction of the entiy. More... | |
virtual void | render (id< MTLRenderCommandEncoder > uRenderEncoder) |
Renders the current entity. More... | |
virtual void | update (double dt) |
Updates the state of each entity. More... | |
virtual void | updateAllUniforms () |
void | setZDepth (int uZDepth) |
Loads all rendering information for the entiy / virtual void loadRenderingInformation(){};. More... | |
int | getZDepth () |
Gets the z-depth value used for rendering ordering. More... | |
virtual bool | changeState (INPUTELEMENTACTION uInputAction, U4DVector2n uPosition) |
virtual U4DRenderEntity * | getRenderEntity () |
Public Member Functions inherited from U4DEngine::U4DEntityNode< U4DEntity > | |
U4DEntityNode () | |
Constructor for the class. | |
U4DEntityNode (std::string uNodeName) | |
~U4DEntityNode () | |
Destructor for the class. | |
void | addChild (U4DEntity *uChild) |
Method which adds a child node to a scenegraph. More... | |
void | addChild (U4DEntity *uChild, U4DEntity *uNext) |
void | addChild (U4DEntity *uChild, int uZDepth) |
Method which adds a child entity to a scenegraph at a particular location. More... | |
void | removeChild (U4DEntity *uChild) |
Method which removes a child node from the scenegraph. More... | |
void | changeLastDescendant (U4DEntity *uNewLastDescendant) |
Method which changes the node's last descendant in the scenegraph. More... | |
U4DEntity * | getFirstChild () |
Method which returns the node's first child in the scenegraph. More... | |
U4DEntity * | getLastChild () |
Method which returns the node's last child in the scenegraph. More... | |
U4DEntity * | getNextSibling () |
Method which returns the node's next sibling in the scenegraph. More... | |
U4DEntity * | getPrevSibling () |
Method which returns the node's previous sibling in the scenegraph. More... | |
U4DEntity * | prevInPreOrderTraversal () |
Method which returns the node's previous sibling in pre-order traversal order. More... | |
U4DEntity * | nextInPreOrderTraversal () |
Method which returns the node's next pointer in pre-order traversal order. More... | |
bool | isLeaf () |
Method which returns true if the node represents a leaf node in the scenegraph. More... | |
bool | isRoot () |
Method which returns true if the node represents a root node in the scenegraph. More... | |
U4DEntity * | getParent () |
Gets the parent to the entity. More... | |
U4DEntity * | getRootParent () |
Gets the root parent (top parent in the scenegraph) of the entity. More... | |
U4DEntity * | searchChild (std::string uName) |
Public Attributes | |
U4DDualQuaternion | localSpace |
Local Space of the entity. | |
U4DDualQuaternion | absoluteSpace |
Absolute Space of the entity. | |
U4DTransformation * | transformation |
U4DTransformation object pointer in charge of translating/rotating the entity. | |
U4DVector3n | entityForwardVector |
Forward vector of the entity. This is used to compute the view-direction vector. | |
int | zDepth |
z-depth used for rendering ordering | |
Public Attributes inherited from U4DEngine::U4DEntityNode< U4DEntity > | |
U4DEntity * | parent |
Tree parent pointer. | |
U4DEntity * | prevSibling |
Tree previous sibling pointer. | |
U4DEntity * | next |
Tree next pointer. | |
U4DEntity * | lastDescendant |
Tree last descendant pointer. | |
Protected Attributes | |
U4DVector3n | localOrientation |
Entity local orientation. | |
U4DVector3n | localPosition |
Entity local position. | |
U4DVector3n | absoluteOrientation |
Entity absolute orientation. | |
U4DVector3n | absolutePosition |
Entity absolute position. | |
The U4DEntity class is a Super-Class for all the entities in a game, such as 3D models, buttons, fonts, etc.
U4DMatrix3n U4DEngine::U4DEntity::getAbsoluteMatrixOrientation | ( | ) |
Method which returns the absolute orientation of the Entity.
U4DVector3n U4DEngine::U4DEntity::getAbsoluteOrientation | ( | ) |
Method which returns the absolute orientation of the Entity.
U4DVector3n U4DEngine::U4DEntity::getAbsolutePosition | ( | ) |
Method which returns the absolute position of the Entity.
U4DDualQuaternion U4DEngine::U4DEntity::getAbsoluteSpace | ( | ) |
Method which returns the absolute space of the Entity.
U4DQuaternion U4DEngine::U4DEntity::getAbsoluteSpaceOrientation | ( | ) |
Method which returns the absolute orientation space of the Entity.
U4DQuaternion U4DEngine::U4DEntity::getAbsoluteSpacePosition | ( | ) |
Method which returns the absolute position space of the Entity.
U4DVector3n U4DEngine::U4DEntity::getEntityForwardVector | ( | ) |
Method which returns the forwad vector of the Entity.
ENTITYTYPE U4DEngine::U4DEntity::getEntityType | ( | ) |
Method which returns the type of the Entity.
U4DMatrix3n U4DEngine::U4DEntity::getLocalMatrixOrientation | ( | ) |
Method which returns the local orientation of the Entity.
U4DVector3n U4DEngine::U4DEntity::getLocalOrientation | ( | ) |
Method which returns the Local orientation of the Entity.
U4DVector3n U4DEngine::U4DEntity::getLocalPosition | ( | ) |
Method which returns the local position of the Entity.
U4DQuaternion U4DEngine::U4DEntity::getLocalSpaceOrientation | ( | ) |
Method which returns the local orientation space of the Entity.
U4DQuaternion U4DEngine::U4DEntity::getLocalSpacePosition | ( | ) |
Method which returns the local position space of the Entity.
std::string U4DEngine::U4DEntity::getName | ( | ) |
Method which returns the name of the Entity.
|
inlinevirtual |
Method which rotates the view direction of the entiy.
Reimplemented in U4DEngine::U4DModel, U4DEngine::U4DParticleSystem, U4DEngine::U4DCamera, and U4DEngine::U4DDirectionalLight.
int U4DEngine::U4DEntity::getZDepth | ( | ) |
Gets the z-depth value used for rendering ordering.
Entity Copy Constructor.
value | Entity to copy to |
|
inlinevirtual |
Renders the current entity.
Updates the space matrix, any rendering flags, bones and shadows properties. It encodes the pipeline, buffers and issues the draw command
uRenderEncoder | Metal encoder object for the current entity |
Reimplemented in U4DEngine::U4DModel, U4DEngine::U4DParticleSystem, U4DEngine::U4DWorld, U4DEngine::U4DText, U4DEngine::U4DVisibleEntity, U4DEngine::U4DSprite, U4DEngine::U4DImage, U4DEngine::U4DSkybox, and U4DEngine::U4DLayer.
void U4DEngine::U4DEntity::rotateAboutAxis | ( | float | angle, |
U4DVector3n & | axisOrientation, | ||
U4DVector3n & | axisPosition | ||
) |
Method which rotates entity about an axis.
angle | Angle representing rotation |
axisOrientation | Axis of rotation |
axisPosition | Position of rotation axis |
void U4DEngine::U4DEntity::rotateAboutAxis | ( | U4DQuaternion & | uOrientation, |
U4DVector3n & | axisPosition | ||
) |
Method which rotates entity about an axis.
uOrientation | Orientation to rotate |
axisPosition | Position of axis |
void U4DEngine::U4DEntity::rotateBy | ( | float | angle, |
U4DVector3n & | axis | ||
) |
Method which rotates entity by certain amount.
angle | Angle of rotation |
axis | Axis of rotation |
void U4DEngine::U4DEntity::rotateBy | ( | float | angleX, |
float | angleY, | ||
float | angleZ | ||
) |
Method which rotates entity by a certain amount.
angleX | Angle of rotation along x-axis |
angleY | Angle of rotation along y-axis |
angleZ | Angle of rotation along z-axis |
void U4DEngine::U4DEntity::rotateBy | ( | U4DQuaternion & | rotation | ) |
Method which rotates entity by a certain amount.
rotation | Quaternion representing orientation |
void U4DEngine::U4DEntity::rotateTo | ( | float | angle, |
U4DVector3n & | axis | ||
) |
Method which rotates entity to a new orientation.
angle | Angle of rotation |
axis | Asis of rotation |
void U4DEngine::U4DEntity::rotateTo | ( | float | angleX, |
float | angleY, | ||
float | angleZ | ||
) |
Method which rotates entity to a new orientation.
angleX | Angle of rotation along the x-axis |
angleY | Angle of rotation along the y-axis |
angleZ | Angle of rotation along the z-axis |
void U4DEngine::U4DEntity::rotateTo | ( | U4DQuaternion & | rotation | ) |
Method which rotates entity to a new orientation.
rotation | Quaternion representing orientation |
void U4DEngine::U4DEntity::setEntityForwardVector | ( | U4DVector3n & | uForwardVector | ) |
Method which sets the forward vectof of the Entity. The default value is (0.0,0.0,-1.0)
uForwardVector | Forward vector for entity |
void U4DEngine::U4DEntity::setEntityType | ( | ENTITYTYPE | uType | ) |
Method which sets the type of the Entity.
uType | Type of the Entity |
void U4DEngine::U4DEntity::setLocalSpace | ( | U4DDualQuaternion & | uLocalSpace | ) |
Method which sets the local space of the Entity.
uLocalSpace | Local space of the Entity in Dual-Quaternion form |
void U4DEngine::U4DEntity::setLocalSpace | ( | U4DMatrix4n & | uMatrix | ) |
Method which sets the local space of the Entity.
uMatrix | Local space of the Entity in 4x4 Matrix form |
void U4DEngine::U4DEntity::setLocalSpaceOrientation | ( | U4DQuaternion & | uOrientation | ) |
Method which sets the local space orientation of the Entity.
uOrientation | Local space orientation for the Entity |
void U4DEngine::U4DEntity::setLocalSpacePosition | ( | U4DQuaternion & | uPosition | ) |
Method which sets the local space position of the Entity.
uPosition | Local space position for the Entity |
void U4DEngine::U4DEntity::setName | ( | std::string | uName | ) |
Method which sets the name of the Entity.
uName | Name for the Entity |
void U4DEngine::U4DEntity::setZDepth | ( | int | uZDepth | ) |
Loads all rendering information for the entiy / virtual void loadRenderingInformation(){};.
/** @brief Sets the z-depth value used for rendering ordering @param uZDepth z-depth value. Default is 100
void U4DEngine::U4DEntity::translateBy | ( | float | x, |
float | y, | ||
float | z | ||
) |
Method which translates entity by certain amount.
x | Translaiion along x-coordinate |
y | Translation along y-coordinate |
z | Translation along z-coordinate |
void U4DEngine::U4DEntity::translateBy | ( | U4DVector3n & | translation | ) |
Method which translates entity by a certain amount.
translation | 3D vector offset translation |
void U4DEngine::U4DEntity::translateTo | ( | float | x, |
float | y, | ||
float | z | ||
) |
Method which translates entity to a new position.
x | Translation along x-coordinate |
y | Translation along y-coordinate |
z | Tranalation along z-coordinate |
void U4DEngine::U4DEntity::translateTo | ( | U4DVector2n & | translation | ) |
Method which translates entity to a new position.
Translation | 2D vector translation |
void U4DEngine::U4DEntity::translateTo | ( | U4DVector3n & | translation | ) |
Method which translates entity to a new position.
translation | 3D vector translation |
|
inlinevirtual |
Updates the state of each entity.
dt | time-step value |
Reimplemented in U4DEngine::U4DParticleSystem, U4DEngine::U4DModel, U4DEngine::U4DJoystick, U4DEngine::U4DBoundingVolume, U4DEngine::U4DCamera, U4DEngine::U4DButton, U4DEngine::U4DWorld, U4DEngine::U4DVisibleEntity, and U4DEngine::U4DLayer.
|
inlinevirtual |
Reimplemented in U4DEngine::U4DModel, and U4DEngine::U4DVisibleEntity.
|
inlinevirtual |
Method which sets the view direction of the entity.
uDestinationPoint | View direction of entity |
Reimplemented in U4DEngine::U4DModel, U4DEngine::U4DParticleSystem, U4DEngine::U4DCamera, and U4DEngine::U4DDirectionalLight.