WorldEntity Class Reference
[Game Data]

Represents objects in game, that can change theirs state (move). More...

#include <worldentity.h>

Inherits CommonEntity.

Inherited by BonusBox, Projectile, and Tank.

Inheritance diagram for WorldEntity:

Inheritance graph
[legend]
Collaboration diagram for WorldEntity:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WorldEntity ()
virtual ~WorldEntity ()=0
void shiftHistory ()
 Shifts interpolation history by one step.
virtual void createPresentPoint (int time_stamp)
 Creates from current available data new mPresentPoint.
void updateHistory (HistoryPoint *new_point)
 Adds new point to the history and present point.

Protected Attributes

GLVector3d mSpeed
 Vector of current speed.
double mWeight
 Weight of object in kg.
HistoryPointmPresentPoint
 Point in history, that is now valid.
HistoryPointmHistoryPoints [HISTORY_LENGTH]
 Here are cached some points of history.

Detailed Description

Represents objects in game, that can change theirs state (move).

Definition at line 17 of file worldentity.h.


Constructor & Destructor Documentation

WorldEntity::WorldEntity  ) 
 

Definition at line 4 of file worldentity.cpp.

References HISTORY_LENGTH, mHistoryPoints, and mSpeed.

WorldEntity::~WorldEntity  )  [pure virtual]
 

Definition at line 11 of file worldentity.cpp.


Member Function Documentation

void WorldEntity::createPresentPoint int  time_stamp  )  [virtual]
 

Creates from current available data new mPresentPoint.

Parameters:
time_stamp Defines the timestamp of the point being created

Reimplemented in Tank.

Definition at line 26 of file worldentity.cpp.

References CommonEntity::mID, HistoryPoint::mID, CommonEntity::mOrientation, HistoryPoint::mOrientation, CommonEntity::mPosition, HistoryPoint::mPosition, mPresentPoint, mSpeed, HistoryPoint::mSpeed, and HistoryPoint::mTimeStamp.

void WorldEntity::shiftHistory  ) 
 

Shifts interpolation history by one step.

Definition at line 15 of file worldentity.cpp.

References HISTORY_LENGTH, mHistoryPoints, and mPresentPoint.

Referenced by updateHistory().

void WorldEntity::updateHistory HistoryPoint new_point  ) 
 

Adds new point to the history and present point.

Changes the present history point to the new point and then shifts the history. WARNING! It doesn't delete the present point. This is behaviour that is expected as long as mPresentPoint and mHistoryPoints[0] points to the same objects (this is correct).

Parameters:
new_point Point that should be added as the beginning of history :P

Definition at line 38 of file worldentity.cpp.

References mPresentPoint, and shiftHistory().

Here is the call graph for this function:


Member Data Documentation

HistoryPoint* WorldEntity::mHistoryPoints[HISTORY_LENGTH] [protected]
 

Here are cached some points of history.

Definition at line 54 of file worldentity.h.

Referenced by shiftHistory(), and WorldEntity().

HistoryPoint* WorldEntity::mPresentPoint [protected]
 

Point in history, that is now valid.

Definition at line 53 of file worldentity.h.

Referenced by createPresentPoint(), Tank::createPresentPoint(), shiftHistory(), and updateHistory().

GLVector3d WorldEntity::mSpeed [protected]
 

Vector of current speed.

Definition at line 48 of file worldentity.h.

Referenced by createPresentPoint(), Tank::createPresentPoint(), Projectile::initByID(), and WorldEntity().

double WorldEntity::mWeight [protected]
 

Weight of object in kg.

Reimplemented in Tank.

Definition at line 50 of file worldentity.h.

Referenced by Projectile::initByID().


The documentation for this class was generated from the following files:
Generated on Wed Apr 12 14:48:18 2006 for bjs by  doxygen 1.4.5