EntityRepresentation is the base class for all representations. A representation is added as a dependant to an entity using the attach method.
Create an EntityRepresentation.
repManager |
an instance of RepresentationManager |
collisionFunc |
A function to be evaluated when a collision is detected. The function is passed the representation, entity and an array with the colliding entities. |
Call entity.detach(representation) to remove the relation with the entity and clear.
Private method to allow for interpolation we can preUpdate the new positions that will be assigned in the next time step (dt).
Synchronously add the entity and the representation to the relevant managers.
delay |
A delay for the addition of the representation. Typically used for the addition of the entity after the latency used for jitlib NodeProxy instantiation. |
Returns true or false
Add to the RepresentationManager
Returns the current speed of the entity.
Returns true or false
Sound or visual
Get the data from the entity and store it in the relevant variables.
The method that receives the messages when the entity is changed.
Always use detach on the entity to remove a representation. Remove the representation from the representation manager. Used internally.