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

The U4DEntityManager Class manages the rendering, space update, physics, collision and visibility for all objects in a game. More...

Public Member Functions

 U4DEntityManager ()
 class constructor
 
 ~U4DEntityManager ()
 class destructor
 
 U4DEntityManager (const U4DEntityManager &value)
 copy constructor
 
U4DEntityManageroperator= (const U4DEntityManager &value)
 copy constructor
 
void render (id< MTLCommandBuffer > uCommandBuffer)
 Renders the entities in the scenegraph. More...
 
void update (float dt)
 Updates the state of each entity. More...
 
void determineVisibility ()
 determines if the current entity is within the camera frustum More...
 
void setRootEntity (U4DVisibleEntity *uRootEntity)
 sets the root entity More...
 
void loadIntoCollisionEngine (U4DDynamicAction *uModel)
 loads the 3D model into the collision engine More...
 
void loadIntoPhysicsEngine (U4DDynamicAction *uModel, float dt)
 loads the 3D model into the physics engine More...
 
void loadIntoVisibilityManager (U4DModel *uModel)
 loads the 3d model into the visibility manager More...
 
void changeVisibilityInterval (float uValue)
 change the current visibility interval. The default is 0.5. More...
 

Public Attributes

U4DEntityrootEntity
 pointer to the root entity. This entity represents the root node in the scenegraph
 

Detailed Description

The U4DEntityManager Class manages the rendering, space update, physics, collision and visibility for all objects in a game.

Member Function Documentation

◆ changeVisibilityInterval()

void U4DEngine::U4DEntityManager::changeVisibilityInterval ( float  uValue)

change the current visibility interval. The default is 0.5.

This interval determines how fast the BVH is computed to determine which 3D models are within the camera frustum. The lower this interval, the faster the BVH is computed.

Parameters
uValuetime interval.

◆ determineVisibility()

void U4DEngine::U4DEntityManager::determineVisibility ( )

determines if the current entity is within the camera frustum

any 3D model outside of the frustum are not rendered

◆ loadIntoCollisionEngine()

void U4DEngine::U4DEntityManager::loadIntoCollisionEngine ( U4DDynamicAction uModel)

loads the 3D model into the collision engine

Parameters
uModelpointer to the 3d model

◆ loadIntoPhysicsEngine()

void U4DEngine::U4DEntityManager::loadIntoPhysicsEngine ( U4DDynamicAction uModel,
float  dt 
)

loads the 3D model into the physics engine

Parameters
uModelpointer to the 3d model
dttime-step

◆ loadIntoVisibilityManager()

void U4DEngine::U4DEntityManager::loadIntoVisibilityManager ( U4DModel uModel)

loads the 3d model into the visibility manager

the visibility manager determines if a 3d model is within the camera frustum

Parameters
uModelpointer to the 3d model

◆ render()

void U4DEngine::U4DEntityManager::render ( id< MTLCommandBuffer >  uCommandBuffer)

Renders the entities in the scenegraph.

It calls the individual render method of each entity in the scenegraph

Parameters
uRenderEncoderMetal encoder object for the current entity

◆ setRootEntity()

void U4DEngine::U4DEntityManager::setRootEntity ( U4DVisibleEntity uRootEntity)

sets the root entity

the root entity represents the root node in the scenegraph

Parameters
uRootEntitypointer to the root parent entity

◆ update()

void U4DEngine::U4DEntityManager::update ( float  dt)

Updates the state of each entity.

It updates the space matrix and calls the physics engine and collision system to evaluate each entity.

Parameters
dttime-step value