#include <commonentity.h>
Inherited by LandscapeEntity, and WorldEntity.
Inheritance diagram for CommonEntity:


Public Member Functions | |
| CommonEntity () | |
| virtual | ~CommonEntity ()=0 |
| void | setID (int ID) |
| int | getID () |
| void | basicInit (int ID, GLVector3d position, GLQuaterniond orientation) |
| Makes basic initialzation of object - fills in ID, position and orientation. | |
| virtual bool | init () |
| Makes object-specific initialization. | |
| virtual void | destroy () |
| Makes object-specific actions when being removed from world. | |
| virtual void | render () |
| ClassType | getClassType () |
| Returns which descendant of CommonEntity this class is. | |
| void | tranformColModel () |
| Applies transformations to collision model. | |
| GLVector3d | getPosition () |
| Return position of object. | |
| void | setPosition (GLVector3d pos) |
| Sets the position of object. BE CAREFULL! | |
| GLQuaterniond | getOrientation () |
| Return orientation of object. | |
| void | setOrientation (GLQuaterniond orient) |
| Sets the orientation of object. BE CAREFULL! | |
Public Attributes | |
| CollisionModel | mColModel |
| Represents collision model of this object. | |
Protected Attributes | |
| GLVector3d | mPosition |
| Position of an object in the world. | |
| GLQuaterniond | mOrientation |
| Orientation of object in the world. | |
| int | mID |
| Unique indetificator of object in all world. Note that valid value is > 0. | |
| ClassType | mType |
| Determines which class this is. | |
| int | mSubType |
| Identifies subtype of thi object - eg. which type of tank is this. | |
Private Member Functions | |
| CommonEntity (const CommonEntity &) | |
| Private copy contstruktor - we don't want anybody to copy this. | |
This class is abstract ancestor of all objects in game, as moving as steady ones. It has methods that draws the object, object initialization, collision detection helpers,...
Definition at line 29 of file commonentity.h.
|
|
Definition at line 5 of file commonentity.cpp. References mID. |
|
|
Definition at line 10 of file commonentity.cpp. |
|
|
Private copy contstruktor - we don't want anybody to copy this.
Definition at line 59 of file commonentity.cpp. References DIE(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Makes basic initialzation of object - fills in ID, position and orientation.
Definition at line 15 of file commonentity.cpp. References mOrientation, mPosition, and setID(). Referenced by World::createBonusBox(). Here is the call graph for this function: ![]() |
|
|
Makes object-specific actions when being removed from world. This method is called from Wrld::delete* methods to allow objects to do their specific cleanup operations, when removed from world. Now this means also object destruction, but this may change in future, so use this method, NOT destructor! Definition at line 27 of file commonentity.cpp. |
|
|
Returns which descendant of CommonEntity this class is.
Definition at line 47 of file commonentity.cpp. References cInvalid, DIE(), LOGE, and mType. Referenced by World::deleteBonusBox(), World::deleteProjectile(), and World::deleteTank(). Here is the call graph for this function: ![]() |
|
|
Definition at line 42 of file commonentity.cpp. References mID. Referenced by World::addWorldEntity(), and World::delWorldEntity(). |
|
|
Return orientation of object.
Definition at line 116 of file commonentity.h. References mOrientation. |
|
|
Return position of object.
Definition at line 98 of file commonentity.h. References mPosition. Referenced by TaskSimulationServer::checkTerrainHeights(). |
|
|
Makes object-specific initialization. This method is intended to do stuff like initialization of 3D model... If it returns false, the object won't be added to list of objects and will be deleted. This method should have no paramters. Every inherited class can contain method bool initSpecific(), where can be used specific parameters for initialization.
Definition at line 22 of file commonentity.cpp. Referenced by World::createBonusBox(). |
|
|
Reimplemented in LandscapeEntity, and Tank. Definition at line 31 of file commonentity.cpp. Referenced by LayerGame::renderWorldEntities(). |
|
|
Definition at line 37 of file commonentity.cpp. References mID. Referenced by basicInit(). |
|
|
Sets the orientation of object. BE CAREFULL!
Definition at line 125 of file commonentity.h. References mOrientation. |
|
|
Sets the position of object. BE CAREFULL!
Definition at line 107 of file commonentity.h. References mPosition. Referenced by TaskSimulationServer::checkTerrainHeights(). |
|
|
Applies transformations to collision model.
Definition at line 86 of file commonentity.h. References CollisionModel::finishTransformations(), mColModel, mOrientation, mPosition, CollisionModel::resetTransformations(), CollisionModel::setRotation(), and CollisionModel::setTranslation(). Here is the call graph for this function: ![]() |
|
|
Represents collision model of this object.
Definition at line 81 of file commonentity.h. Referenced by TaskSimulationServer::checkTerrainHeights(), Tank::render(), and tranformColModel(). |
|
|
Unique indetificator of object in all world. Note that valid value is > 0.
Definition at line 138 of file commonentity.h. Referenced by CommonEntity(), WorldEntity::createPresentPoint(), Tank::createPresentPoint(), getID(), and setID(). |
|
|
Orientation of object in the world.
Definition at line 135 of file commonentity.h. Referenced by basicInit(), WorldEntity::createPresentPoint(), Tank::createPresentPoint(), getOrientation(), Projectile::initByID(), Tank::render(), setOrientation(), and tranformColModel(). |
|
|
Position of an object in the world.
Definition at line 132 of file commonentity.h. Referenced by basicInit(), WorldEntity::createPresentPoint(), Tank::createPresentPoint(), getPosition(), Tank::render(), setPosition(), and tranformColModel(). |
|
|
Identifies subtype of thi object - eg. which type of tank is this.
Definition at line 144 of file commonentity.h. Referenced by Tank::initByID(), and Projectile::initByID(). |
|
|
Determines which class this is.
Definition at line 141 of file commonentity.h. Referenced by BonusBox::BonusBox(), getClassType(), Projectile::Projectile(), and Tank::Tank(). |
1.4.5