Planeshift
|
Movement related class. More...
#include <linmove.h>
Public Member Functions | |
virtual void | AddVelocity (const csVector3 &vel) |
Adds on a velocity to this body in world coordinates. | |
virtual void | ClearPortalDisplacement () |
Clear the total displacement caused by space warping portals. | |
virtual void | ClearWorldVelocity () |
Resets the velocity of this body in world coordinates. | |
virtual csTicks | ClientTimeDiff () |
virtual int | ExtrapolatePosition (float delta) |
This function actually moves and rotates the mesh, relighting if necessary. | |
virtual const csVector3 | GetAngularVelocity () const |
Get the current angular velocity vector. | |
virtual void | GetAngularVelocity (csVector3 &v) const |
virtual void | GetCDDimensions (csVector3 &body, csVector3 &legs, csVector3 &shift) |
virtual void | GetDRData (bool &on_ground, csVector3 &pos, float &yrot, iSector *§or, csVector3 &vel, csVector3 &worldVel, float &ang_vel) |
Return all necessary data for Dead Reckoning. | |
const csVector3 | GetFullPosition () const |
virtual float | GetGravity () |
virtual void | GetLastClientPosition (csVector3 &pos, float &yrot, iSector *§or) |
virtual void | GetLastFullPosition (csVector3 &pos, float &yrot, iSector *§or) |
virtual void | GetLastPosition (csVector3 &pos, float &yrot, iSector *§or) const |
virtual csVector3 | GetPortalDisplacement () |
Get the total displacement caused by space warping portals. | |
const csVector3 | GetPosition () const |
virtual iSector * | GetSector () const |
virtual const csVector3 | GetVelocity () const |
virtual void | GetVelocity (csVector3 &v) const |
virtual float | GetYRotation () const |
virtual bool | InitCD (const csVector3 &body, const csVector3 &legs, const csVector3 &shift, iMeshWrapper *mesh) |
virtual bool | IsOnGround () const |
virtual bool | IsPath () const |
psLinearMovement (iObjectRegistry *object_reg) | |
virtual void | ResetGravity () |
virtual bool | RotateV (float delta) |
virtual void | SetAngularVelocity (const csVector3 &angle, const csVector3 &angle_to_reach) |
virtual void | SetAngularVelocity (const csVector3 &angle) |
virtual void | SetDeltaLimit (float deltaLimit) |
virtual void | SetDRData (bool on_ground, csVector3 &pos, float yrot, iSector *sector, csVector3 &vel, csVector3 &worldVel, float ang_vel) |
Sets all relevant dead reckoning data on this entity. | |
virtual void | SetFullPosition (const char *center_name, float yrot, iSector *sector) |
virtual void | SetFullPosition (const csVector3 &pos, float yrot, const iSector *sector) |
virtual void | SetGravity (float grav) |
virtual void | SetHugGround (bool hugGround) |
Set if pcmesh should be transformed to follow the contour of the ground. | |
virtual void | SetOnGround (bool onground) |
virtual void | SetPath (iPath *newpath) |
This function lets linmove store a ref to the supplied iPath. | |
virtual void | SetPathAction (int which, const char *action) |
This relates a particular action name to be used between two points in the path. | |
virtual void | SetPathSector (const char *sectorname) |
This sets the sector which will be used for the entire path. | |
virtual void | SetPathSpeed (float speed) |
This relates the movement of the entity along the path to the time values specified by the path. | |
virtual void | SetPathTime (float timeval) |
This function sets the current position on the path for use when time deltas are added later. | |
virtual void | SetPosition (const char *center_name, float yrot, iSector *sector) |
virtual void | SetPosition (const csVector3 &pos, float yrot, const iSector *sector) |
void | SetScale (float set_scale) |
virtual void | SetSoftDRData (bool on_ground, csVector3 &pos, float yrot, iSector *sector, csVector3 &vel, csVector3 &worldVel, float ang_vel) |
Sets dead reckoning data with 'soft' position updating. | |
virtual void | SetVelocity (const csVector3 &vel) |
Sets a velocity for this body in body coordinates. | |
virtual void | SetYRotation (float yrot) |
void | StackTrace (const char *error) |
Procedure used to dump stack in error situations. | |
virtual void | TickEveryFrame () |
virtual csTicks | TimeDiff (void) |
Returns the difference in time between now and when the last DR update or extrapolation took place. | |
virtual void | UpdateDR (csTicks delta) |
This function calls ExtrapolatePosition with a certain time delta or calculates the delta relative to the last update. | |
virtual void | UpdateDR () |
virtual void | UpdateDRDelta (csTicks ticksdelta) |
This function calls ExtrapolatePosition with a certain time but uses a fixed delta. | |
void | UseCD (bool cd) |
virtual | ~psLinearMovement () |
Protected Member Functions | |
int | FindSectors (const csVector3 &pos, float size, iSector **sectors) |
void | HugGround (const csVector3 &pos, iSector *sector) |
Transform pcmesh so that it follows the curvature of the ground at pos (sector) | |
int | MoveSprite (float delta) |
int | MoveV (float delta) |
void | OffsetSprite (float delta) |
Protected Attributes | |
float | angDelta |
csVector3 | angleToReach |
bool | angleToReachFlag |
csVector3 | angularVelocity |
csVector3 | bottomSize |
csBox3 | boundingBox |
csRef< iCollideSystem > | cdsys |
psCollisionDetection * | colldet |
float | deltaLimit |
csRef< iEngine > | engine |
float | gravity |
Speed affects all aspects of movement, including gravity. | |
bool | hugGround |
Should the model be tilted so it's aligned with the ground. | |
csVector3 | intervalSize |
Maximum interval at which to perform CD. | |
csTicks | lastClientDRUpdate |
csVector3 | lastClientPosition |
iSector * | lastClientSector |
float | lastClientYrot |
csTicks | lastDRUpdate |
csRef< iMeshWrapper > | mesh |
iObjectRegistry * | object_reg |
csVector3 | offset_err |
Error in terms of absolute position. | |
csVector3 | offset_rate |
Speed to bring error to ZERO within 1s. | |
csRef< iPath > | path |
csStringArray | path_actions |
csString | path_sector |
bool | path_sent |
float | path_speed |
float | path_time |
csVector3 | portalDisplaced |
The total change in displacement caused by space warping portals. | |
float | scale |
csVector3 | shift |
bool | stationary |
csVector3 | topSize |
csRef< iVirtualClock > | vc |
csVector3 | velBody |
csVector3 | velWorld |
float | xRot |
float | zRot |
Static Protected Attributes | |
static int | num_our_cd |
static csCollisionPair | our_cd_contact [1000] |
Movement related class.
This class handles everything related to moving, from collision detection to dead reckoning and actual entity movement.
psLinearMovement::psLinearMovement | ( | iObjectRegistry * | object_reg | ) |
virtual psLinearMovement::~psLinearMovement | ( | ) | [virtual] |
virtual void psLinearMovement::AddVelocity | ( | const csVector3 & | vel | ) | [virtual] |
Adds on a velocity to this body in world coordinates.
virtual void psLinearMovement::ClearPortalDisplacement | ( | ) | [virtual] |
Clear the total displacement caused by space warping portals.
virtual void psLinearMovement::ClearWorldVelocity | ( | ) | [virtual] |
Resets the velocity of this body in world coordinates.
virtual csTicks psLinearMovement::ClientTimeDiff | ( | ) | [inline, virtual] |
This function actually moves and rotates the mesh, relighting if necessary.
int psLinearMovement::FindSectors | ( | const csVector3 & | pos, |
float | size, | ||
iSector ** | sectors | ||
) | [protected] |
virtual const csVector3 psLinearMovement::GetAngularVelocity | ( | ) | const [virtual] |
Get the current angular velocity vector.
virtual void psLinearMovement::GetAngularVelocity | ( | csVector3 & | v | ) | const [virtual] |
virtual void psLinearMovement::GetCDDimensions | ( | csVector3 & | body, |
csVector3 & | legs, | ||
csVector3 & | shift | ||
) | [virtual] |
virtual void psLinearMovement::GetDRData | ( | bool & | on_ground, |
csVector3 & | pos, | ||
float & | yrot, | ||
iSector *& | sector, | ||
csVector3 & | vel, | ||
csVector3 & | worldVel, | ||
float & | ang_vel | ||
) | [virtual] |
Return all necessary data for Dead Reckoning.
const csVector3 psLinearMovement::GetFullPosition | ( | ) | const |
virtual float psLinearMovement::GetGravity | ( | ) | [virtual] |
virtual void psLinearMovement::GetLastClientPosition | ( | csVector3 & | pos, |
float & | yrot, | ||
iSector *& | sector | ||
) | [virtual] |
virtual void psLinearMovement::GetLastFullPosition | ( | csVector3 & | pos, |
float & | yrot, | ||
iSector *& | sector | ||
) | [virtual] |
virtual void psLinearMovement::GetLastPosition | ( | csVector3 & | pos, |
float & | yrot, | ||
iSector *& | sector | ||
) | const [virtual] |
virtual csVector3 psLinearMovement::GetPortalDisplacement | ( | ) | [virtual] |
Get the total displacement caused by space warping portals.
const csVector3 psLinearMovement::GetPosition | ( | ) | const |
virtual iSector* psLinearMovement::GetSector | ( | ) | const [virtual] |
virtual void psLinearMovement::GetVelocity | ( | csVector3 & | v | ) | const [virtual] |
virtual const csVector3 psLinearMovement::GetVelocity | ( | ) | const [virtual] |
virtual float psLinearMovement::GetYRotation | ( | ) | const [virtual] |
void psLinearMovement::HugGround | ( | const csVector3 & | pos, |
iSector * | sector | ||
) | [protected] |
Transform pcmesh so that it follows the curvature of the ground at pos (sector)
virtual bool psLinearMovement::InitCD | ( | const csVector3 & | body, |
const csVector3 & | legs, | ||
const csVector3 & | shift, | ||
iMeshWrapper * | mesh | ||
) | [virtual] |
virtual bool psLinearMovement::IsOnGround | ( | ) | const [virtual] |
virtual bool psLinearMovement::IsPath | ( | ) | const [virtual] |
void psLinearMovement::OffsetSprite | ( | float | delta | ) | [protected] |
virtual void psLinearMovement::ResetGravity | ( | ) | [virtual] |
virtual bool psLinearMovement::RotateV | ( | float | delta | ) | [virtual] |
virtual void psLinearMovement::SetAngularVelocity | ( | const csVector3 & | angle, |
const csVector3 & | angle_to_reach | ||
) | [virtual] |
virtual void psLinearMovement::SetAngularVelocity | ( | const csVector3 & | angle | ) | [virtual] |
virtual void psLinearMovement::SetDeltaLimit | ( | float | deltaLimit | ) | [virtual] |
virtual void psLinearMovement::SetDRData | ( | bool | on_ground, |
csVector3 & | pos, | ||
float | yrot, | ||
iSector * | sector, | ||
csVector3 & | vel, | ||
csVector3 & | worldVel, | ||
float | ang_vel | ||
) | [virtual] |
Sets all relevant dead reckoning data on this entity.
virtual void psLinearMovement::SetFullPosition | ( | const csVector3 & | pos, |
float | yrot, | ||
const iSector * | sector | ||
) | [virtual] |
virtual void psLinearMovement::SetFullPosition | ( | const char * | center_name, |
float | yrot, | ||
iSector * | sector | ||
) | [virtual] |
virtual void psLinearMovement::SetGravity | ( | float | grav | ) | [virtual] |
virtual void psLinearMovement::SetHugGround | ( | bool | hugGround | ) | [virtual] |
Set if pcmesh should be transformed to follow the contour of the ground.
virtual void psLinearMovement::SetOnGround | ( | bool | onground | ) | [virtual] |
virtual void psLinearMovement::SetPath | ( | iPath * | newpath | ) | [virtual] |
This function lets linmove store a ref to the supplied iPath.
If this path is present, it will be used for movement instead of linear velocity vector.
virtual void psLinearMovement::SetPathAction | ( | int | which, |
const char * | action | ||
) | [virtual] |
This relates a particular action name to be used between two points in the path.
This allows linmove to automatically switch a bird from "fly" to "glide", for example, during downward segments of the flight path.
virtual void psLinearMovement::SetPathSector | ( | const char * | sectorname | ) | [virtual] |
This sets the sector which will be used for the entire path.
virtual void psLinearMovement::SetPathSpeed | ( | float | speed | ) | [virtual] |
This relates the movement of the entity along the path to the time values specified by the path.
Speed=0 makes the entity stationary. Speed=1 is normal traversal of the path.
virtual void psLinearMovement::SetPathTime | ( | float | timeval | ) | [virtual] |
This function sets the current position on the path for use when time deltas are added later.
virtual void psLinearMovement::SetPosition | ( | const csVector3 & | pos, |
float | yrot, | ||
const iSector * | sector | ||
) | [virtual] |
virtual void psLinearMovement::SetPosition | ( | const char * | center_name, |
float | yrot, | ||
iSector * | sector | ||
) | [virtual] |
void psLinearMovement::SetScale | ( | float | set_scale | ) | [inline] |
virtual void psLinearMovement::SetSoftDRData | ( | bool | on_ground, |
csVector3 & | pos, | ||
float | yrot, | ||
iSector * | sector, | ||
csVector3 & | vel, | ||
csVector3 & | worldVel, | ||
float | ang_vel | ||
) | [virtual] |
Sets dead reckoning data with 'soft' position updating.
Rather than immediately set the new position, the difference between the current position and the new position is put into a position error variable. Over a 1-second interval the MoveV routine will offset the position so that the position error becomes zero.
virtual void psLinearMovement::SetVelocity | ( | const csVector3 & | vel | ) | [virtual] |
Sets a velocity for this body in body coordinates.
virtual void psLinearMovement::SetYRotation | ( | float | yrot | ) | [virtual] |
void psLinearMovement::StackTrace | ( | const char * | error | ) |
Procedure used to dump stack in error situations.
virtual void psLinearMovement::TickEveryFrame | ( | ) | [virtual] |
virtual csTicks psLinearMovement::TimeDiff | ( | void | ) | [virtual] |
Returns the difference in time between now and when the last DR update or extrapolation took place.
virtual void psLinearMovement::UpdateDR | ( | csTicks | delta | ) | [virtual] |
This function calls ExtrapolatePosition with a certain time delta or calculates the delta relative to the last update.
This allows all entities linmoves to be synchronized to the same ticks, even if updates are all happening at different times.
virtual void psLinearMovement::UpdateDR | ( | ) | [virtual] |
virtual void psLinearMovement::UpdateDRDelta | ( | csTicks | ticksdelta | ) | [virtual] |
This function calls ExtrapolatePosition with a certain time but uses a fixed delta.
This allows all entities linmoves to be synchronized to the same ticks, even if updates are all happening at different times.
void psLinearMovement::UseCD | ( | bool | cd | ) |
float psLinearMovement::angDelta [protected] |
csVector3 psLinearMovement::angleToReach [protected] |
bool psLinearMovement::angleToReachFlag [protected] |
csVector3 psLinearMovement::angularVelocity [protected] |
csVector3 psLinearMovement::bottomSize [protected] |
csBox3 psLinearMovement::boundingBox [protected] |
csRef<iCollideSystem> psLinearMovement::cdsys [protected] |
psCollisionDetection* psLinearMovement::colldet [protected] |
float psLinearMovement::deltaLimit [protected] |
csRef<iEngine> psLinearMovement::engine [protected] |
float psLinearMovement::gravity [protected] |
bool psLinearMovement::hugGround [protected] |
csVector3 psLinearMovement::intervalSize [protected] |
csTicks psLinearMovement::lastClientDRUpdate [protected] |
csVector3 psLinearMovement::lastClientPosition [protected] |
iSector* psLinearMovement::lastClientSector [protected] |
float psLinearMovement::lastClientYrot [protected] |
csTicks psLinearMovement::lastDRUpdate [protected] |
csRef<iMeshWrapper> psLinearMovement::mesh [protected] |
int psLinearMovement::num_our_cd [static, protected] |
iObjectRegistry* psLinearMovement::object_reg [protected] |
csVector3 psLinearMovement::offset_err [protected] |
csVector3 psLinearMovement::offset_rate [protected] |
csCollisionPair psLinearMovement::our_cd_contact[1000] [static, protected] |
csRef<iPath> psLinearMovement::path [protected] |
csStringArray psLinearMovement::path_actions [protected] |
csString psLinearMovement::path_sector [protected] |
bool psLinearMovement::path_sent [protected] |
float psLinearMovement::path_speed [protected] |
float psLinearMovement::path_time [protected] |
csVector3 psLinearMovement::portalDisplaced [protected] |
float psLinearMovement::scale [protected] |
csVector3 psLinearMovement::shift [protected] |
bool psLinearMovement::stationary [protected] |
csVector3 psLinearMovement::topSize [protected] |
csRef<iVirtualClock> psLinearMovement::vc [protected] |
csVector3 psLinearMovement::velBody [protected] |
csVector3 psLinearMovement::velWorld [protected] |
float psLinearMovement::xRot [protected] |
float psLinearMovement::zRot [protected] |