CSCI 3081 - Drone Delivery System
|
A movable object in a scene. Entities have position, direction and size. More...
#include <entity.h>
Public Member Functions | |
virtual | ~IEntity () |
The destructor. | |
virtual int | GetId () const =0 |
virtual const std::string & | GetName ()=0 |
virtual const std::vector< float > & | GetPosition () const =0 |
virtual const std::vector< float > & | GetDirection () const =0 |
virtual float | GetRadius () const =0 |
virtual const picojson::object & | GetDetails ()=0 |
virtual int | GetVersion () const =0 |
virtual bool | IsDynamic () const =0 |
A movable object in a scene. Entities have position, direction and size.
Defines the common characteristics of an Entity.
All entities that you create must implement this interface.
|
pure virtual |
Returns the entity's details. The returned picojson::object should be a copy of the json that was passed in when the entity was created. Details are also used to send additional information to other subsystems (e.g. mesh, scale, rotation, etc...).
Implemented in csci3081::EntityBase.
|
pure virtual |
Returns the entity's direction. The vector should be a unit length vector.
Implemented in csci3081::EntityBase.
|
pure virtual |
Returns the unique entity id. Each Entity should have a unique ID.
Implemented in csci3081::EntityBase.
|
pure virtual |
Returns the name of an entity. (Should match the "name" field of the json that was passed in when the entity was created)
Implemented in csci3081::EntityBase.
|
pure virtual |
Returns the entity's position. The returned vector should have three values which correspond to the x, y, z, position of the entity.
Implemented in csci3081::EntityBase.
|
pure virtual |
Returns the entity's radius. Entities are bounded by a sphere used for calculating proximity to boundaries or other entities.
Implemented in csci3081::EntityBase.
|
pure virtual |
Get version can be used to see whether or not a variable other than position or direction has changed.
Implemented in csci3081::EntityBase.
|
pure virtual |
This method specifies whether or not the entity is static (doesn't change) or moves. It should return true if you want the entities position/orientation to be updated in the visualization.
Combining GetVersion() with a non-dynamic entity allows the entity to be updated less often than on a frame by frame basis for other subsystems. For example, we may want to update a dynamic object every frame, while it is more efficient to update a static object only when the version changes.
Implemented in csci3081::EntityBase.