Skip to content
Carl Hewett edited this page Jun 3, 2016 · 9 revisions

This class keeps track of all entities (classes derived from Entity). Anything in here will automatically be updated each step and be rendered if possible.

Class EntityManager

Camera& getGameCamera()

Get the camera displaying on the screen.

bool addObject(Object& object)

Add an object to the manager. It will not be copied, but of course you don't need to worry about deconstructing from Lua while it is in the entity manager. Returns false on failure.

Object& removeObjectByIndex(unsigned int index)

Remove an object from the manager. The index is 0-based! Returns a reference to the removed object.

bool removeObject(Object&)

Remove an object. Returns false on failure.

{Object}& getObjects()

Get an array of all objects.

bool addLight(Light& light)

Add a light to the manager. It will not be copied, but of course you don't need to worry about deconstructing from Lua while it is in the entity manager. Returns false on failure.

Light& removeLightByIndex(unsigned int index)

Remove a light from the manager. The index is 0-based! Returns a reference to the removed light.

bool removeLight(Light&)

Remove an light. Returns false on failure.

{Light}& getLights()

Get an array of all lights.

setPhysicsTimePerStep(float time)

Set the number of seconds elapsed per frame. Useful for slow motion or speeding up everything. Only affects physics!

float getPhysicsTimePerStep()

Get the number of seconds elapsing per frame in the physics engine.