#include <object.h>


Public Member Functions | |
| cObject () | |
| virtual | ~cObject () |
| void | Step (const int iCurTime, const float fPhysStepTime, const bool bIncResyncCounterLow=false) |
| void | SaveResyncData (cFIFO &pFIFO) |
| server only | |
| void | LoadResyncData (cFIFO &pFIFO) |
| client only, ignored if resync considered old (or too new in case locaction change has not arrived over tcp yet | |
| void | SetController (cObjectController *pObjectController) |
| void | SetParentLocation (cLocation *pParentLocation) |
| cLocation * | GetParentLocation () |
| void | _HackForgetParentLocation () |
| don't use this directly ! only to be used for efficient mass delete from location | |
| int | GetID () |
| void | SetID (const int iID) |
| registers object in cResyncReceiver* gpResyncReceiver if available | |
Static Public Member Functions | |
| static void | SkipResyncData (cFIFO &pFIFO) |
| static void | LuaRegister (lua_State *L) |
| lua binding | |
Public Attributes | |
| cOdeObject * | mpPhysicForm |
| mass,collision geometry,... | |
| cObjectController * | mpController |
| autopilot,... | |
| int | miLastChangeTime |
| object wich are not "changed" don't need to be resynced so often. | |
| int | miResyncCounterHigh |
| changed on major events like location change, etc | |
| uint32 | miResyncCounterLow |
| avoids problems with udp resync packets arriving late | |
| float | mfMaxSpeed |
| float | mfBoundingRad |
| float | mfDistToLocationCenter |
| bool | mbResynced |
| true by default, if this is false no resyncs for this obj will be sent at all | |
| Vector3 | mvPos |
| Vector3 | mvVel |
| Vector3 | mvAccel |
| Quaternion | mqRot |
| Quaternion | mqTurn |
| cGfx3D * | mpGfx3D |
| not owned by object : destroy this yourself, position/rotation is updated in Step() | |
Private Attributes | |
| cLocation * | mpParentLocation |
| defines the parent coordinate system | |
| std::list< cObject * >::iterator | _mLocationInsertPos |
| int | miID |
Definition at line 32 of file object.h.
| cObject::cObject | ( | ) |
Definition at line 14 of file object.cpp.
| cObject::~cObject | ( | ) | [virtual] |
Definition at line 33 of file object.cpp.
References mpPhysicForm, SetController(), SetID(), and SetParentLocation().
| void cObject::Step | ( | const int | iCurTime, | |
| const float | fPhysStepTime, | |||
| const bool | bIncResyncCounterLow = false | |||
| ) |
fPhysStepTime is used for simple physics iCurTime is intended to be used for setting miLastChangeTime on collision/physical interaction
< for 2d Tracking
Definition at line 63 of file object.cpp.
References assert, cLocation::mfBoundingRad, mfBoundingRad, Lugre::cGfx3D::mfCustomBoundingRadius, mfDistToLocationCenter, mfMaxSpeed, miLastChangeTime, miResyncCounterLow, mpController, mpGfx3D, mpParentLocation, mpPhysicForm, mqRot, mqTurn, mvAccel, mvPos, mvVel, Lugre::cGfx3D::SetOrientation(), Lugre::cGfx3D::SetPosition(), and cObjectController::Step().
| void cObject::SaveResyncData | ( | cFIFO & | pFIFO | ) |
server only
Definition at line 141 of file object.cpp.
References miID, miResyncCounterHigh, miResyncCounterLow, mqRot, mqTurn, mvAccel, mvPos, mvVel, Lugre::cFIFO::Push(), Lugre::cFIFO::PushUint16(), and Lugre::cFIFO::PushUint32().
Referenced by cLocation::SendResyncs(), and cLocation::StoreResyncs().
| void cObject::LoadResyncData | ( | cFIFO & | pFIFO | ) |
client only, ignored if resync considered old (or too new in case locaction change has not arrived over tcp yet
Definition at line 153 of file object.cpp.
References kResyncMessageLen, miResyncCounterHigh, miResyncCounterLow, mqRot, mqTurn, mvAccel, mvPos, mvVel, Lugre::cFIFO::Pop(), Lugre::cFIFO::PopUint16(), Lugre::cFIFO::PopUint32(), and Lugre::cFIFO::Skip().
Referenced by cResyncReceiver::ReceiveResyncs(), and cResyncReceiver::ReceiveResyncsFromFIFO().
| void cObject::SkipResyncData | ( | cFIFO & | pFIFO | ) | [static] |
Definition at line 166 of file object.cpp.
References kResyncMessageLen, and Lugre::cFIFO::Skip().
Referenced by cResyncReceiver::ReceiveResyncs(), and cResyncReceiver::ReceiveResyncsFromFIFO().
| void cObject::SetController | ( | cObjectController * | pObjectController | ) |
Definition at line 42 of file object.cpp.
References cObjectController::Lock(), mpController, and cObjectController::Release().
Referenced by cObject_L::SetController(), and ~cObject().
| void cObject::SetParentLocation | ( | cLocation * | pParentLocation | ) |
executed in constant time (thanks to keeping insert position) server should increase miResyncCounterHigh and inform client using reliable (tcp) connection
Definition at line 126 of file object.cpp.
References _mLocationInsertPos, cLocation::mlObjects, and mpParentLocation.
Referenced by cObject_L::SetParentLocation(), and ~cObject().
| cLocation* cObject::GetParentLocation | ( | ) | [inline] |
| void cObject::_HackForgetParentLocation | ( | ) | [inline] |
don't use this directly ! only to be used for efficient mass delete from location
Definition at line 61 of file object.h.
References mpParentLocation.
Referenced by cLocation::DeleteAllObjects().
| int cObject::GetID | ( | ) | [inline] |
Definition at line 63 of file object.h.
References miID.
Referenced by cLocation_L::Intersect2DRect(), and cLocation_L::IntersectSphere().
| void cObject::SetID | ( | const int | iID | ) |
registers object in cResyncReceiver* gpResyncReceiver if available
Definition at line 134 of file object.cpp.
References cResyncReceiver::AddObject(), gpResyncReceiver, miID, and cResyncReceiver::RemoveObject().
Referenced by cObject_L::SetID(), and ~cObject().
| void cObject::LuaRegister | ( | lua_State * | L | ) | [static] |
lua binding
Definition at line 115 of file object_L.cpp.
References PROFILE.
Referenced by SFZ_RegisterLuaPlugin().
| cOdeObject* cObject::mpPhysicForm |
mass,collision geometry,...
Definition at line 33 of file object.h.
Referenced by cObject_L::SetPhysicForm(), Step(), and ~cObject().
object wich are not "changed" don't need to be resynced so often.
Definition at line 35 of file object.h.
Referenced by cLocation::SendResyncs(), Step(), and cLocation::StoreResyncs().
changed on major events like location change, etc
Definition at line 36 of file object.h.
Referenced by LoadResyncData(), and SaveResyncData().
| uint32 cObject::miResyncCounterLow |
avoids problems with udp resync packets arriving late
Definition at line 37 of file object.h.
Referenced by LoadResyncData(), cObject_L::ResetResyncCounterLow(), SaveResyncData(), and Step().
| float cObject::mfMaxSpeed |
| float cObject::mfBoundingRad |
Definition at line 39 of file object.h.
Referenced by cLocation_L::Intersect2DRect(), cLocation_L::IntersectSphere(), and Step().
| bool cObject::mbResynced |
true by default, if this is false no resyncs for this obj will be sent at all
Definition at line 41 of file object.h.
Referenced by cLocation::SendResyncs(), and cLocation::StoreResyncs().
| Vector3 cObject::mvPos |
Definition at line 42 of file object.h.
Referenced by cLocation_L::Intersect2DRect(), cLocation_L::IntersectSphere(), LoadResyncData(), SaveResyncData(), cObjectController::Step(), and Step().
| Vector3 cObject::mvVel |
Definition at line 42 of file object.h.
Referenced by LoadResyncData(), SaveResyncData(), cObjectController::Step(), and Step().
| Vector3 cObject::mvAccel |
Definition at line 42 of file object.h.
Referenced by LoadResyncData(), SaveResyncData(), cObjectController::Step(), and Step().
| Quaternion cObject::mqRot |
Definition at line 43 of file object.h.
Referenced by LoadResyncData(), SaveResyncData(), and Step().
| Quaternion cObject::mqTurn |
Definition at line 43 of file object.h.
Referenced by LoadResyncData(), SaveResyncData(), and Step().
not owned by object : destroy this yourself, position/rotation is updated in Step()
Definition at line 44 of file object.h.
Referenced by cObject_L::SetGfx(), and Step().
cLocation* cObject::mpParentLocation [private] |
defines the parent coordinate system
Definition at line 71 of file object.h.
Referenced by _HackForgetParentLocation(), GetParentLocation(), SetParentLocation(), and Step().
std::list<cObject*>::iterator cObject::_mLocationInsertPos [private] |
int cObject::miID [private] |
1.5.6