TDME2 1.9.121
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
Object3DBase Class Reference

Object3D base class. More...

#include <tdme/engine/subsystems/rendering/Object3DBase.h>

Inheritance diagram for Object3DBase:
Inheritance graph
Collaboration diagram for Object3DBase:
Collaboration graph

Public Member Functions

ModelgetModel ()
 
virtual void computeTransformations (int contextIdx, int64_t lastFrameAtTime, int64_t currentFrameAtTime)
 Pre render step, computes transformations. More...
 
int getNodeCount () const
 
void getTriangles (vector< Triangle > &triangles, int nodeIdx=-1)
 Retrieves list of triangles of all or given nodes. More...
 
Object3DBase_TransformedFacesIteratorgetTransformedFacesIterator ()
 
Object3DNodeMeshgetMesh (const string &nodeId)
 Returns object3d node mesh object. More...
 
virtual void initialize ()
 Initiates this object3d. More...
 
virtual void dispose ()
 Disposes this object3d. More...
 
int getInstances ()
 
int getCurrentInstance ()
 
void setCurrentInstance (int currentInstance)
 Set current instance. More...
 
bool getInstanceEnabled ()
 
void setInstanceEnabled (bool enabled)
 Set current instance enabled. More...
 
void setAnimation (const string &id, float speed=1.0f)
 Sets up a base animation to play. More...
 
void setAnimationSpeed (float speed)
 Set up animation speed. More...
 
void addOverlayAnimation (const string &id)
 Overlays a animation above the base animation. More...
 
void removeOverlayAnimation (const string &id)
 Removes a overlay animation. More...
 
void removeOverlayAnimationsFinished ()
 Removes all finished overlay animations. More...
 
void removeOverlayAnimations ()
 Removes all overlay animations. More...
 
const string getAnimation ()
 
float getAnimationTime ()
 Returns current base animation time. More...
 
bool hasOverlayAnimation (const string &id)
 Returns if there is currently running a overlay animation with given id. More...
 
float getOverlayAnimationTime (const string &id)
 Returns current overlay animation time. More...
 
const Matrix4x4 getNodeTransformationsMatrix (const string &id)
 Returns transformation matrix for given node. More...
 
void setNodeTransformationsMatrix (const string &id, const Matrix4x4 &matrix)
 Set transformation matrix for given node. More...
 
void unsetNodeTransformationsMatrix (const string &id)
 Unset transformation matrix for given node. More...
 
const Matrix4x4getTransformationsMatrix () const
 

Protected Member Functions

 Object3DBase (Model *model, bool useManagers, Engine::AnimationProcessingTarget animationProcessingTarget, int instances)
 Private constructor. More...
 
virtual ~Object3DBase ()
 Destructor. More...
 

Protected Attributes

Modelmodel
 
vector< Object3DNode * > object3dNodes
 
bool usesManagers
 
int instances
 
int enabledInstances
 
vector< Object3DAnimation * > instanceAnimations
 
vector< bool > instanceEnabled
 
vector< TransformationsinstanceTransformations
 
int currentInstance
 
Engine::AnimationProcessingTarget animationProcessingTarget
 

Private Attributes

Object3DBase_TransformedFacesIteratortransformedFacesIterator { nullptr }
 

Friends

class Object3DNode
 
class Object3DNodeMesh
 
class Object3DBase_TransformedFacesIterator
 
class ModelUtilitiesInternal
 
class tdme::engine::subsystems::skinning::SkinningShader
 

Detailed Description

Object3D base class.

Author
Andreas Drewke

Definition at line 37 of file Object3DBase.h.

Constructor & Destructor Documentation

◆ Object3DBase()

Object3DBase ( Model model,
bool  useManagers,
Engine::AnimationProcessingTarget  animationProcessingTarget,
int  instances 
)
protected

Private constructor.

Parameters
modelmodel
useManagersuse mesh and object 3d node renderer model manager
animationProcessingTargetanimation processing target
instancesinstances to compute and render by duplication

Definition at line 62 of file Object3DBase.cpp.

◆ ~Object3DBase()

~Object3DBase ( )
protectedvirtual

Destructor.

Definition at line 84 of file Object3DBase.cpp.

Member Function Documentation

◆ addOverlayAnimation()

void addOverlayAnimation ( const string &  id)
inline

Overlays a animation above the base animation.

Parameters
idid

Definition at line 191 of file Object3DBase.h.

◆ computeTransformations()

virtual void computeTransformations ( int  contextIdx,
int64_t  lastFrameAtTime,
int64_t  currentFrameAtTime 
)
inlinevirtual

Pre render step, computes transformations.

Parameters
contextIdxcontext index
lastFrameAtTimetime of last animation computation
currentFrameAtTimetime of current animation computation

Reimplemented in Object3D.

Definition at line 89 of file Object3DBase.h.

◆ dispose()

void dispose ( )
virtual

Disposes this object3d.

Reimplemented in Object3D, and Object3DInternal.

Definition at line 192 of file Object3DBase.cpp.

◆ getAnimation()

const string getAnimation ( )
inline
Returns
active animation setup id

Definition at line 220 of file Object3DBase.h.

◆ getAnimationTime()

float getAnimationTime ( )
inline

Returns current base animation time.

Returns
0.0 <= time <= 1.0

Definition at line 228 of file Object3DBase.h.

◆ getCurrentInstance()

int getCurrentInstance ( )
inline
Returns
current instance

Definition at line 143 of file Object3DBase.h.

◆ getInstanceEnabled()

bool getInstanceEnabled ( )
inline
Returns
current instance enabled

Definition at line 158 of file Object3DBase.h.

◆ getInstances()

int getInstances ( )
inline
Returns
maximum of instances

Definition at line 136 of file Object3DBase.h.

◆ getMesh()

Object3DNodeMesh * getMesh ( const string &  nodeId)

Returns object3d node mesh object.

Parameters
nodeIdnode id
Returns
object3d node mesh object

Definition at line 140 of file Object3DBase.cpp.

◆ getModel()

Model * getModel ( )
inline
Returns
model

Definition at line 79 of file Object3DBase.h.

◆ getNodeCount()

int getNodeCount ( ) const
Returns
node count

Definition at line 94 of file Object3DBase.cpp.

◆ getNodeTransformationsMatrix()

const Matrix4x4 getNodeTransformationsMatrix ( const string &  id)
inline

Returns transformation matrix for given node.

Parameters
idnode id
Returns
transformation matrix or identity matrix if not found

Definition at line 255 of file Object3DBase.h.

◆ getOverlayAnimationTime()

float getOverlayAnimationTime ( const string &  id)
inline

Returns current overlay animation time.

Parameters
idid
Returns
0.0 <= time <= 1.0

Definition at line 246 of file Object3DBase.h.

◆ getTransformationsMatrix()

const Matrix4x4 & getTransformationsMatrix ( ) const
inline
Returns
this transformations matrix

Definition at line 279 of file Object3DBase.h.

◆ getTransformedFacesIterator()

Object3DBase_TransformedFacesIterator * getTransformedFacesIterator ( )
Returns
transformed faces iterator

Definition at line 132 of file Object3DBase.cpp.

◆ getTriangles()

void getTriangles ( vector< Triangle > &  triangles,
int  nodeIdx = -1 
)

Retrieves list of triangles of all or given nodes.

Parameters
trianglestriangles
nodeIdxnode index or -1 for all nodes

Definition at line 98 of file Object3DBase.cpp.

◆ hasOverlayAnimation()

bool hasOverlayAnimation ( const string &  id)
inline

Returns if there is currently running a overlay animation with given id.

Parameters
idid
Returns
animation is running

Definition at line 237 of file Object3DBase.h.

◆ initialize()

void initialize ( )
virtual

Initiates this object3d.

Reimplemented in Object3D, and Object3DInternal.

Definition at line 151 of file Object3DBase.cpp.

◆ removeOverlayAnimation()

void removeOverlayAnimation ( const string &  id)
inline

Removes a overlay animation.

Parameters
idid

Definition at line 199 of file Object3DBase.h.

◆ removeOverlayAnimations()

void removeOverlayAnimations ( )
inline

Removes all overlay animations.

Definition at line 213 of file Object3DBase.h.

◆ removeOverlayAnimationsFinished()

void removeOverlayAnimationsFinished ( )
inline

Removes all finished overlay animations.

Definition at line 206 of file Object3DBase.h.

◆ setAnimation()

void setAnimation ( const string &  id,
float  speed = 1.0f 
)
inline

Sets up a base animation to play.

Parameters
idid
speedspeed whereas 1.0 is default speed

Definition at line 175 of file Object3DBase.h.

◆ setAnimationSpeed()

void setAnimationSpeed ( float  speed)
inline

Set up animation speed.

Parameters
speedspeed whereas 1.0 is default speed

Definition at line 183 of file Object3DBase.h.

◆ setCurrentInstance()

void setCurrentInstance ( int  currentInstance)
inline

Set current instance.

Parameters
currentinstance

Definition at line 151 of file Object3DBase.h.

◆ setInstanceEnabled()

void setInstanceEnabled ( bool  enabled)
inline

Set current instance enabled.

Parameters
enabledinstance enabled

Definition at line 166 of file Object3DBase.h.

◆ setNodeTransformationsMatrix()

void setNodeTransformationsMatrix ( const string &  id,
const Matrix4x4 matrix 
)
inline

Set transformation matrix for given node.

Parameters
idnode id
matrixtransformation matrix

Definition at line 264 of file Object3DBase.h.

◆ unsetNodeTransformationsMatrix()

void unsetNodeTransformationsMatrix ( const string &  id)
inline

Unset transformation matrix for given node.

Parameters
idnode id

Definition at line 272 of file Object3DBase.h.

Friends And Related Function Documentation

◆ ModelUtilitiesInternal

friend class ModelUtilitiesInternal
friend

Definition at line 42 of file Object3DBase.h.

◆ Object3DBase_TransformedFacesIterator

Definition at line 41 of file Object3DBase.h.

◆ Object3DNode

friend class Object3DNode
friend

Definition at line 39 of file Object3DBase.h.

◆ Object3DNodeMesh

friend class Object3DNodeMesh
friend

Definition at line 40 of file Object3DBase.h.

◆ tdme::engine::subsystems::skinning::SkinningShader

Definition at line 43 of file Object3DBase.h.

Member Data Documentation

◆ animationProcessingTarget

Engine::AnimationProcessingTarget animationProcessingTarget
protected

Definition at line 58 of file Object3DBase.h.

◆ currentInstance

int currentInstance
protected

Definition at line 57 of file Object3DBase.h.

◆ enabledInstances

int enabledInstances
protected

Definition at line 53 of file Object3DBase.h.

◆ instanceAnimations

vector<Object3DAnimation*> instanceAnimations
protected

Definition at line 54 of file Object3DBase.h.

◆ instanceEnabled

vector<bool> instanceEnabled
protected

Definition at line 55 of file Object3DBase.h.

◆ instances

int instances
protected

Definition at line 52 of file Object3DBase.h.

◆ instanceTransformations

vector<Transformations> instanceTransformations
protected

Definition at line 56 of file Object3DBase.h.

◆ model

Model* model
protected

Definition at line 49 of file Object3DBase.h.

◆ object3dNodes

vector<Object3DNode*> object3dNodes
protected

Definition at line 50 of file Object3DBase.h.

◆ transformedFacesIterator

Object3DBase_TransformedFacesIterator* transformedFacesIterator { nullptr }
private

Definition at line 46 of file Object3DBase.h.

◆ usesManagers

bool usesManagers
protected

Definition at line 51 of file Object3DBase.h.


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