Scene

A scene is a 3D space where you can place different objects, like primitives, terrains, lights and guis. It implements ISceneFactory, IStartable and IUpdateable services.

Constructors

this
this(string id)

Create a scene using a unique id.

Members

Functions

entity
T entity(string id)
initialize
typeof(this) initialize()

Initialize scene. Invoke start for all IStartable objects that have a start() method. Returns reference to this so it can be used in a stream.

remove
typeof(this) remove(T entity)

Remove a child entity using its reference. Returns reference to this so it can be used in a stream.

render
void render()

Render all renderable systems. It's called every frame after Scene.update.

spawn
T spawn(T entity, string id, void delegate(T) initMethod)

Spawn a scene entity using its reference. You can specify where to spawn. By default is set to scene tree.

spawn
T spawn(string id, void delegate(T) initMethod)

Spawn a scene entity using its ID. Second time you call this method for the same id, an assertion is produced. Returns new entity reference.

spawnOnce
T spawnOnce(T entity, string id, void delegate(T) initMethod)

Spawn a scene entity using its reference. Second time you call this method for the same id, nothing happens. Returns old/new entity reference.

spawnOnce
T spawnOnce(string id, void delegate(T) initMethod)

Spawn a scene entity using its ID. Second time you call this method for the same id, nothing happens. Returns old/new entity reference.

update
void update()

Update all entitys that have an update() method. These entitys must implement IUpdateable. It's called every frame.

Variables

camera
Camera camera;
cameraMap
Camera[string] cameraMap;
entityMap
Entity[string] entityMap;
id
string id;
initialized
bool initialized;
lightMap
Light[string] lightMap;
relativePath
string relativePath;
shaderMap
Shader[string] shaderMap;
startPoint
Vector3F startPoint;
startableMap
IStartable[string] startableMap;
updateableMap
IUpdateable[string] updateableMap;
world
World world;

Inherited Members

From ISceneFactory

create
Scene create(string relativePath)

* Create a new scene instance using relative path of the scene file.

release
void release(Scene scene)

* Release an existing scene from memory.

From IUpdateable

update
void update()

* Called every frame to update the current state of the scene entity.

Meta