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

The U4DScene class represents the scene (universe) object of the game. A scene can have multiple worlds. A world represents the View Component of the Model-View-Controller pattern. More...

Public Member Functions

 U4DScene ()
 class constructor
 
virtual ~U4DScene ()
 class destructor
 
 U4DScene (const U4DScene &value)
 copy constructor
 
U4DSceneoperator= (const U4DScene &value)
 copy constructor
 
virtual void init ()
 init method.
 
U4DSceneStateManagergetSceneStateManager ()
 Gets the pointer to the scene manager.
 
virtual void loadComponents (U4DWorld *uGameWorld, U4DGameLogicInterface *uGameLogic) final
 sets the pointer for the world, controller and logic classes More...
 
virtual void loadComponents (U4DWorld *uGameWorld, U4DWorld *uLoadingWorld, U4DGameLogicInterface *uGameLogic) final
 sets the pointer for the world, controller and logic classes and the loading world More...
 
virtual void update (float dt) final
 Method in charge of updating the states of each entity. More...
 
virtual void render (id< MTLCommandBuffer > uCommandBuffer) final
 Renders the current entity. More...
 
U4DControllerInterfacegetGameController ()
 
void determineVisibility ()
 determines if the current entity is within the camera frustum More...
 
float getGlobalTime ()
 Returns the global time. More...
 
void loadMainWorldInBackground ()
 Initiates world in the background while the loading world is playing.
 
void initializeMultithreadofComponents ()
 Initiates the multi-thread of the world and loading-world objects.
 
void setAnchorMouse (bool uValue)
 Anchor mouse to center of screen.
 
bool getAnchorMouse ()
 get if mouse should be anhored to the center of the screen
 

Public Attributes

U4DControllerInterfacegameController
 pointer to the game controller interface
 
U4DWorldgameWorld
 pointer to the world class
 
U4DWorldloadingWorld
 pointer to the world class representing the loading world
 
bool componentsMultithreadLoaded
 Used to confirm if the loading and world scene are loading simultaneously.
 
U4DGameLogicInterfacegameLogic
 pointer to the game model(logic) interface
 
U4DSceneStateManagersceneStateManager
 Pointer to the scene state manager.
 

Detailed Description

The U4DScene class represents the scene (universe) object of the game. A scene can have multiple worlds. A world represents the View Component of the Model-View-Controller pattern.

Member Function Documentation

◆ determineVisibility()

void U4DEngine::U4DScene::determineVisibility ( )

determines if the current entity is within the camera frustum

any 3D model outside of the frustum are not rendered

◆ getGlobalTime()

float U4DEngine::U4DScene::getGlobalTime ( )

Returns the global time.

Returns
The global time since the game started. Mainly used for the shaders

◆ loadComponents() [1/2]

void U4DEngine::U4DScene::loadComponents ( U4DWorld uGameWorld,
U4DGameLogicInterface uGameLogic 
)
finalvirtual

sets the pointer for the world, controller and logic classes

Parameters
uGameWorldpointer to the world object
uGameLogicpointer to the game logic interface

◆ loadComponents() [2/2]

void U4DEngine::U4DScene::loadComponents ( U4DWorld uGameWorld,
U4DWorld uLoadingWorld,
U4DGameLogicInterface uGameLogic 
)
finalvirtual

sets the pointer for the world, controller and logic classes and the loading world

Parameters
uGameWorldpointer to the world object
uLoadingWorldpointer to the loading world object
uGameLogicpointer to the game logic interface

◆ render()

void U4DEngine::U4DScene::render ( id< MTLCommandBuffer >  uCommandBuffer)
finalvirtual

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

Parameters
uRenderEncoderMetal encoder object for the current entity

◆ update()

void U4DEngine::U4DScene::update ( float  dt)
finalvirtual

Method in charge of updating the states of each entity.

Parameters
dttime value