29 #include "../../idlib/precompiled.h"
32 #include "../Game_local.h"
49 state.onGround =
false;
50 groundEntityPtr =
NULL;
57 if ( groundTrace.
fraction == 1.0f ) {
58 state.onGround =
false;
59 groundEntityPtr =
NULL;
65 if ( ( groundTrace.
c.
normal * -gravityNormal ) < minFloorCosine ) {
66 state.onGround =
false;
70 state.onGround =
true;
73 self->
Collide( groundTrace, state.velocity );
78 groundEntityPtr.GetEntity()->GetImpactInfo(
self, groundTrace.
c.
id, groundTrace.
c.
point, &info );
80 groundEntityPtr.GetEntity()->ApplyImpulse(
self, 0, groundTrace.
c.
point, state.velocity / ( info.
invMass * 10.0f ) );
97 for( i = 0; i < 3; i++ ) {
131 idVec3 up, down, noStepPos, noStepVel, stepPos, stepVel;
142 noStepVel = velocity;
143 result1 =
SlideMove( noStepPos, noStepVel, delta );
144 if ( result1 ==
MM_OK ) {
145 velocity = noStepVel;
168 velocity = noStepVel;
181 velocity = noStepVel;
188 result2 =
SlideMove( stepPos, stepVel, delta );
191 velocity = noStepVel;
201 nostepdist = ( noStepPos -
start ).LengthSqr();
202 stepdist = ( stepPos -
start ).LengthSqr();
205 velocity = noStepVel;
449 idVec3 masterOrigin, oldOrigin;
453 timeStep =
MS2SEC( timeStepMSec );
461 self->GetMasterPosition( masterOrigin, masterAxis );
494 if ( upspeed < 0.0
f ) {
638 self->GetMasterPosition( masterOrigin, masterAxis );
682 self->GetMasterPosition( masterOrigin, masterAxis );
744 self->GetMasterPosition( masterOrigin, masterAxis );
void UseFlyMove(bool force)
monsterMoveResult_t moveResult
void SetAxis(const idMat3 &newAxis, int id=-1)
void SetMaxStepHeight(const float newMaxStepHeight)
bool Evaluate(int timeStepMSec, int endTimeMSec)
void WriteObject(const idClass *obj)
bool EvaluateContacts(void)
void ReadFromSnapshot(const idBitMsgDelta &msg)
idMat3 Transpose(void) const
bool IsType(const idTypeInfo &c) const
bool IsOutsideWorld(void) const
const idMat3 & GetAxis(void) const
void SetOrigin(const idVec3 &newOrigin, int id=-1)
void WriteBits(int value, int numBits)
void ReadBool(bool &value)
void ApplyImpulse(const int id, const idVec3 &point, const idVec3 &impulse)
monsterMoveResult_t SlideMove(idVec3 &start, idVec3 &velocity, const idVec3 &delta)
void UseVelocityMove(bool force)
const idVec3 & GetOrigin(void) const
int ReadBits(int numBits) const
void SetDelta(const idVec3 &d)
const int MONSTER_VELOCITY_EXPONENT_BITS
const idVec3 & GetPushedLinearVelocity(const int id=0) const
void WriteVec3(const idVec3 &vec)
int GetRestStartTime(void) const
void WriteBool(const bool value)
float GetMaxStepHeight(void) const
const int MONSTER_VELOCITY_MANTISSA_BITS
void void void Warning(const char *fmt,...) const id_attribute((format(printf
monsterMoveResult_t StepMove(idVec3 &start, idVec3 &velocity, const idVec3 &delta)
void Restore(idRestoreGame *savefile)
void ReadFloat(float &value)
virtual bool Collide(const trace_t &collision, const idVec3 &velocity)
void Rotate(const idRotation &rotation, int id=-1)
void WriteDeltaFloat(float oldValue, float newValue)
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
void idPhysics_Monster_RestorePState(idRestoreGame *savefile, monsterPState_t &state)
const float MONSTER_VELOCITY_MAX
void WriteFloat(const float value)
void idPhysics_Monster_SavePState(idSaveGame *savefile, const monsterPState_t &state)
void UpdateTime(int endTimeMSec)
idEntity * blockingEntity
void GetImpactInfo(const int id, const idVec3 &point, impactInfo_t *info) const
float ReadDeltaFloat(float oldValue) const
static int BitsForInteger(int i)
const char * ToString(int precision=2) const
void WriteInt(const int value)
void SetPushed(int deltaTime)
void ForceDeltaMove(bool force)
idEntity * entities[MAX_GENTITIES]
void WriteToSnapshot(idBitMsgDelta &msg) const
void CheckGround(monsterPState_t &state)
void ProjectOntoPlane(const idVec3 &normal, const float overBounce=1.0f)
END_CLASS const float OVERCLIP
const idMat3 & ToMat3(void) const
const int MONSTER_VELOCITY_TOTAL_BITS
void Translate(const idVec3 &translation, int id=-1)
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
bool OnGround(void) const
void SetLinearVelocity(const idVec3 &newLinearVelocity, int id=0)
void ReadVec3(idVec3 &vec)
const char * c_str(void) const
float ReadFloat(void) const
monsterMoveResult_t GetMoveResult(void) const
void ActivateContactEntities(void)
idEntity * GetSlideMoveEntity(void) const
bool Translation(trace_t &results, const idVec3 &start, const idVec3 &end, const idClipModel *mdl, const idMat3 &trmAxis, int contentMask, const idEntity *passEntity)
const idVec3 & GetLinearVelocity(int id=0) const
static const float M_MS2SEC
void Save(idSaveGame *savefile) const
void ReadObject(idClass *&obj)
static int BitsForFloat(float f)
void SetMaster(idEntity *master, const bool orientated=true)
bool IsAtRest(void) const