CSCI 3081 - Drone Delivery System
Public Member Functions | List of all members
entity_project::IEntity Class Referenceabstract

A movable object in a scene. Entities have position, direction and size. More...

#include <entity.h>

Inheritance diagram for entity_project::IEntity:
Inheritance graph

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
 

Detailed Description

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.

Member Function Documentation

◆ GetDetails()

virtual const picojson::object& entity_project::IEntity::GetDetails ( )
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.

◆ GetDirection()

virtual const std::vector<float>& entity_project::IEntity::GetDirection ( ) const
pure virtual

Returns the entity's direction. The vector should be a unit length vector.

Implemented in csci3081::EntityBase.

◆ GetId()

virtual int entity_project::IEntity::GetId ( ) const
pure virtual

Returns the unique entity id. Each Entity should have a unique ID.

Implemented in csci3081::EntityBase.

◆ GetName()

virtual const std::string& entity_project::IEntity::GetName ( )
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.

◆ GetPosition()

virtual const std::vector<float>& entity_project::IEntity::GetPosition ( ) const
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.

◆ GetRadius()

virtual float entity_project::IEntity::GetRadius ( ) const
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.

◆ GetVersion()

virtual int entity_project::IEntity::GetVersion ( ) const
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.

◆ IsDynamic()

virtual bool entity_project::IEntity::IsDynamic ( ) const
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.


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