Wraith  0.1.5
Basic 3D game engine in C++

For updating the GameObject entity every frame. NOTE: GameObject Entity must be registered in order to process GameObject::update callback. More...

Collaboration diagram for Update:

Functions

void Updatable::submitUpdateRegistration ()
 Submit update registration to current scene. More...
 
void Updatable::submitUpdateDeregistration ()
 Submit update deregistration to current scene. More...
 
bool Updatable::isRegisteredForUpdate () const
 Query if this object is registered for update. More...
 
virtual void Updatable::update ()
 Update callback for this object. More...
 

Detailed Description

For updating the GameObject entity every frame. NOTE: GameObject Entity must be registered in order to process GameObject::update callback.

The Update callback is called by the current Scene every frame. Here is an example of Tank moving foward at a constant rate.

Tank::Tank()
{
_speed = 5.0f;
}
void Tank::Update() // The update callback
{
Vect moveOffset += Vect(0.0f, 0.0f, 1.0f) * _speed;
this->move(moveOffset);
}
void submitUpdateRegistration()
Submit update registration to current scene.
Definition: Updatable.cpp:24

Function Documentation

◆ isRegisteredForUpdate()

bool Updatable::isRegisteredForUpdate ( ) const
protected

Query if this object is registered for update.

Returns
True if registered for update, false if not.

◆ submitUpdateDeregistration()

void Updatable::submitUpdateDeregistration ( )
protected

Submit update deregistration to current scene.

.

◆ submitUpdateRegistration()

void Updatable::submitUpdateRegistration ( )
protected

Submit update registration to current scene.

◆ update()

void Updatable::update ( )
privatevirtual

Update callback for this object.

To be implemented by user in object derived from GameObject (NOT directly derived from Updatable). Called ONLY by current active scene.