Neo
0.5.0
Developer Documentation
|
The Scene class represents a scene in a Maratis level. More...
#include <Scene.h>
Classes | |
class | AdditionalData |
Public Member Functions | |
Scene (void) | |
~Scene (void) | |
AdditionalData * | getAdditionalData () |
void | setAdditionalData (AdditionalData *d) |
void | setName (const char *name) |
Sets the scene name. More... | |
const char * | getName (void) |
Returns the name of the scene. More... | |
Vector3 | getAmbientLight () |
void | setAmbientLight (Vector3 light) |
void | setDataMode (M_DATA_MODES dataMode) |
M_DATA_MODES | getDataMode (void) |
void | setScriptFilename (const char *scriptFilename) |
Sets the scenes script that will be executed. More... | |
const char * | getScriptFilename (void) |
Returns the filename of the script that is currently attached to this scene. More... | |
void | setGravity (const Vector3 &gravity) |
Sets the gravitational pull in this scene to the given value. More... | |
Vector3 | getGravity (void) const |
Returns the current gravity in a MVector3. More... | |
void | playLoopSounds (void) |
void | stopAllSounds (void) |
void | deleteObject (Object3d *object) |
Removes the given object from this scene and deletes its memory. More... | |
OCamera * | addNewCamera (void) |
Creates a new camera, adds it to the scene and returns it. More... | |
OCamera * | addNewCamera (const OCamera &camera) |
Copies the camera and adds the new instance to the scene. More... | |
OLight * | addNewLight (void) |
Creates a new light source and adds it to the scene. More... | |
Object3d * | addNewGroup (void) |
Object3d * | addNewGroup (const Object3d &object) |
OLight * | addNewLight (const OLight &light) |
Copies the light and adds the new instance to the scene. More... | |
OEntity * | addNewEntity (MeshRef *meshRef) |
OEntity * | addNewEntity (const OEntity &entity) |
OSound * | addNewSound (SoundRef *soundRef) |
OSound * | addNewSound (const OSound &sound) |
OText * | addNewText (FontRef *fontRef) |
OText * | addNewText (const OText &text) |
unsigned int | getObjectsNumber (void) |
Returns the number of objects in the scene. More... | |
unsigned int | getCamerasNumber (void) |
Returns the number of cameras in the scene. More... | |
unsigned int | getLightsNumber (void) |
Returns the number of lights in the scene. More... | |
unsigned int | getEntitiesNumber (void) |
Returns the number of entities in the scene. More... | |
unsigned int | getSoundsNumber (void) |
Returns the number of sounds in the scene. More... | |
unsigned int | getTextsNumber (void) |
Returns the number of text objects in the scene. More... | |
void | setCurrentCameraId (unsigned int id) |
unsigned int | getCurrentCameraId (void) |
void | setCurrentCamera (OCamera *c) |
OCamera * | getCurrentCamera (void) |
Returns the currently active camera from this scene. More... | |
void | setCurrentFrame (int currentFrame) |
int | getCurrentFrame (void) |
Object3d * | getObjectByName (const char *name) |
Returns the object with the given name or NULL if it is not found. More... | |
Object3d * | getObjectByHandle (unsigned long handle) |
Returns the object with the given ID or NULL if it is not found. More... | |
OLight * | getLightByName (const char *name) |
Returns the light with the given name or NULL if it is not found. More... | |
OCamera * | getCameraByName (const char *name) |
Returns the camera with the given name or NULL if it is not found. More... | |
OEntity * | getEntityByName (const char *name) |
Returns the entity with the given name or NULL if it is not found. More... | |
OSound * | getSoundByName (const char *name) |
Returns the sound with the given name or NULL if it is not found. More... | |
OText * | getTextByName (const char *name) |
Returns the text object with the given name or NULL if it is not found. More... | |
bool | getObjectIndex (const char *name, unsigned int *id) |
Searches the object with the given name and copies the ID. More... | |
Object3d * | getObjectByIndex (unsigned int index) |
OLight * | getLightByIndex (unsigned int index) |
OCamera * | getCameraByIndex (unsigned int index) |
OEntity * | getEntityByIndex (unsigned int index) |
OSound * | getSoundByIndex (unsigned int index) |
OText * | getTextByIndex (unsigned int index) |
void | begin (void) |
void | end (void) |
void | prepareCollisionShape (OEntity *entity) |
void | prepareCollisionObject (OEntity *entity) |
void | prepareConstraints (OEntity *entity) |
void | preparePhysics (void) |
void | updatePhysics (void) |
void | update (void) |
Updates the scene and all objects in it. More... | |
void | updateObjectsBehaviors (void) |
Updates all behaviors of objects in this scene. More... | |
void | drawObjectsBehaviors (void) |
Call draw for all behaviors in this scene. More... | |
void | updateObjectsMatrices (void) |
void | draw (OCamera *camera) |
Renders the scene to the screen. More... | |
The Scene class represents a scene in a Maratis level.
One level can have multiple independent scenes with objects and scripts. You can use this to overlay a scene over another to create ingame GUI or similar.
Neo::Scene::Scene | ( | void | ) |
Neo::Scene::~Scene | ( | void | ) |
OCamera* Neo::Scene::addNewCamera | ( | void | ) |
Copies the camera and adds the new instance to the scene.
camera | The camera to copy. |
Object3d* Neo::Scene::addNewGroup | ( | void | ) |
OLight* Neo::Scene::addNewLight | ( | void | ) |
Creates a new light source and adds it to the scene.
Copies the light and adds the new instance to the scene.
light | The light to copy from. |
void Neo::Scene::begin | ( | void | ) |
void Neo::Scene::deleteObject | ( | Object3d * | object | ) |
Removes the given object from this scene and deletes its memory.
object | The object to be removed. |
Should also remove all children!
void Neo::Scene::draw | ( | OCamera * | camera | ) |
Renders the scene to the screen.
This method takes the camera and renders everything from this point of view to the screen/buffer. This is done by using a subclass of RenderingContext to render.
camera | The camera to use. |
void Neo::Scene::drawObjectsBehaviors | ( | void | ) |
Call draw for all behaviors in this scene.
void Neo::Scene::end | ( | void | ) |
|
inline |
|
inline |
|
inline |
OCamera* Neo::Scene::getCameraByName | ( | const char * | name | ) |
Returns the camera with the given name or NULL if it is not found.
name | The cameras name. |
|
inline |
Returns the number of cameras in the scene.
OCamera* Neo::Scene::getCurrentCamera | ( | void | ) |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the number of entities in the scene.
|
inline |
OEntity* Neo::Scene::getEntityByName | ( | const char * | name | ) |
Returns the entity with the given name or NULL if it is not found.
name | The entities name. |
|
inline |
Returns the current gravity in a MVector3.
|
inline |
OLight* Neo::Scene::getLightByName | ( | const char * | name | ) |
Returns the light with the given name or NULL if it is not found.
name | The lights name. |
|
inline |
Returns the number of lights in the scene.
|
inline |
Returns the name of the scene.
|
inline |
Returns the object with the given ID or NULL if it is not found.
handle | The object handle. |
|
inline |
Object3d* Neo::Scene::getObjectByName | ( | const char * | name | ) |
Returns the object with the given name or NULL if it is not found.
name | The objects name. |
bool Neo::Scene::getObjectIndex | ( | const char * | name, |
unsigned int * | id | ||
) |
Searches the object with the given name and copies the ID.
The ID will be copied to the location where the pointer id points to.
Example:
name | The name of the object. |
id | Pointer to an unsigned int to retrieve the data. |
|
inline |
Returns the number of objects in the scene.
|
inline |
Returns the filename of the script that is currently attached to this scene.
|
inline |
OSound* Neo::Scene::getSoundByName | ( | const char * | name | ) |
Returns the sound with the given name or NULL if it is not found.
name | The sounds name. |
|
inline |
Returns the number of sounds in the scene.
|
inline |
OText* Neo::Scene::getTextByName | ( | const char * | name | ) |
Returns the text object with the given name or NULL if it is not found.
name | The objects name. |
|
inline |
Returns the number of text objects in the scene.
void Neo::Scene::playLoopSounds | ( | void | ) |
void Neo::Scene::prepareCollisionObject | ( | OEntity * | entity | ) |
void Neo::Scene::prepareCollisionShape | ( | OEntity * | entity | ) |
void Neo::Scene::prepareConstraints | ( | OEntity * | entity | ) |
void Neo::Scene::preparePhysics | ( | void | ) |
|
inline |
|
inline |
void Neo::Scene::setCurrentCamera | ( | OCamera * | c | ) |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the gravitational pull in this scene to the given value.
This new gravity is stored in a MVector3.
Example:
gravity |
void Neo::Scene::setName | ( | const char * | name | ) |
Sets the scene name.
The scene name is a property by which you can find a particular scene.
name | The new name which will be copied to an internal buffer. |
void Neo::Scene::setScriptFilename | ( | const char * | scriptFilename | ) |
Sets the scenes script that will be executed.
Sets the path to a script. Those script can contain game logics.
scriptFilename |
void Neo::Scene::stopAllSounds | ( | void | ) |
void Neo::Scene::update | ( | void | ) |
Updates the scene and all objects in it.
void Neo::Scene::updateObjectsBehaviors | ( | void | ) |
Updates all behaviors of objects in this scene.
void Neo::Scene::updateObjectsMatrices | ( | void | ) |
void Neo::Scene::updatePhysics | ( | void | ) |