Aether3D Game Engine
Public Types | Public Member Functions | List of all members
ae3d::Scene Class Reference

Contains game objects in a transform hierarchy. More...

#include <Scene.hpp>

Public Types

enum  DeserializeResult { Success, ParseError }
 Result of GetSerialized.
 

Public Member Functions

void Add (class GameObject *gameObject)
 Adds a game object into the scene if it does not exist there already.
 
void Remove (GameObject *gameObject)
 
void Render ()
 Renders the scene.
 
void SetSkybox (class TextureCube *skyTexture)
 
std::string GetSerialized () const
 
DeserializeResult Deserialize (const FileSystem::FileContentsData &serialized, std::vector< GameObject > &outGameObjects, std::map< std::string, class Texture2D * > &outTexture2Ds, std::map< std::string, class Material * > &outMaterials, std::vector< class Mesh * > &outMeshes) const
 

Detailed Description

Contains game objects in a transform hierarchy.

Member Function Documentation

DeserializeResult ae3d::Scene::Deserialize ( const FileSystem::FileContentsData serialized,
std::vector< GameObject > &  outGameObjects,
std::map< std::string, class Texture2D * > &  outTexture2Ds,
std::map< std::string, class Material * > &  outMaterials,
std::vector< class Mesh * > &  outMeshes 
) const

Deserializes a scene additively from file contents. Must be called after renderer is initialized.

Parameters
serializedSerialized scene contents.
outGameObjectsReturns game objects that were created from serialized scene contents.
outTexture2DsReturns texture 2Ds that were created from serialized scene contents. Caller is responsible for freeing the memory.
outMaterialsReturns materials that were created. Caller is responsible for freeing the memory.
outMeshesReturns meshes that were created. Caller is responsible for freeing the memory.
Returns
Result. Parsing stops on first error and successfully loaded game objects are returned.
std::string ae3d::Scene::GetSerialized ( ) const
Returns
Scene's contents in a textual format that can be saved into file etc.
void ae3d::Scene::Remove ( GameObject gameObject)
Parameters
gameObjectGame object to remove. Does nothing if it is null or doesn't exist in the scene.
void ae3d::Scene::SetSkybox ( class TextureCube skyTexture)
Parameters
skyTextureSkybox texture.

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