29 #ifndef __PHYSICS_AF_H__
30 #define __PHYSICS_AF_H__
147 virtual void Evaluate(
float invTimeStep );
174 virtual void Evaluate(
float invTimeStep );
191 const float angle1,
const float angle2,
const idVec3 &body1Axis );
212 virtual void Evaluate(
float invTimeStep );
230 virtual void Evaluate(
float invTimeStep );
248 const float angle1,
const float angle2 );
273 virtual void Evaluate(
float invTimeStep );
291 virtual void Evaluate(
float invTimeStep );
308 virtual void Evaluate(
float invTimeStep );
352 virtual void Evaluate(
float invTimeStep );
370 virtual void Evaluate(
float invTimeStep );
397 virtual void Evaluate(
float invTimeStep );
421 virtual void Evaluate(
float invTimeStep );
438 virtual void Evaluate(
float invTimeStep );
461 virtual void Evaluate(
float invTimeStep );
492 virtual void Evaluate(
float invTimeStep );
514 virtual void Evaluate(
float invTimeStep );
533 virtual void Evaluate(
float invTimeStep );
564 virtual void Evaluate(
float invTimeStep );
575 const float pyramidAngle1,
const float pyramidAngle2,
const idVec3 &
body1Axis );
596 virtual void Evaluate(
float invTimeStep );
607 void SetSuspension(
const float up,
const float down,
const float k,
const float d,
const float f );
638 virtual void Evaluate(
float invTimeStep );
684 void SetFriction(
float linear,
float angular,
float contact );
778 void Factor(
void )
const;
779 void Solve(
int auxiliaryIndex = 0 )
const;
831 int GetBodyId(
const char *bodyName )
const;
897 void SetMass(
float mass,
int id = -1 );
898 float GetMass(
int id = -1 )
const;
906 bool Evaluate(
int timeStepMSec,
int endTimeMSec );
1033 void Evolve(
float timeStep );
void AddForce(const int id, const idVec3 &point, const idVec3 &force)
virtual void Save(idSaveGame *saveFile) const
void SetSelfCollision(const bool enable)
void SetBouncyness(float bounce)
idAFBody * GetBody1(void) const
void GetImpactInfo(const int id, const idVec3 &point, impactInfo_t *info) const
~idAFConstraint_UniversalJoint(void)
virtual void GetCenter(idVec3 ¢er)
void ForceBodyId(idAFBody *body, int newId)
virtual void Translate(const idVec3 &translation)
idList< idAFBody * > bodies
void SetSteerAngle(const float degrees)
void InverseWorldSpatialInertiaMultiply(idVecX &dst, const float *v) const
virtual void Rotate(const idRotation &rotation)
virtual void GetForce(idAFBody *body, idVec6 &force)
float GetFriction(void) const
virtual void Rotate(const idRotation &rotation)
virtual void Rotate(const idRotation &rotation)
idAFConstraint * boxConstraint
void SetAnchor(const idVec3 &worldPosition)
idList< idAFConstraint * > constraints
idMatX inverseWorldSpatialInertia
virtual void DebugDraw(void)
void SetMotorForce(const float force)
void SetPyramidLimit(const idVec3 &pyramidAxis, const idVec3 &baseAxis, const float angle1, const float angle2, const idVec3 &body1Axis)
int AddBody(idAFBody *body)
virtual void Save(idSaveGame *saveFile) const
void SetPhysics(idPhysics_AF *p)
virtual void Evaluate(float invTimeStep)
virtual void Evaluate(float invTimeStep)
int GetNumConstraints(void) const
void SetupContactConstraints(void)
void DebugDraw(const idVec4 &color) const
virtual void GetCenter(idVec3 ¢er)
idAFBody * GetBody2(void) const
virtual void Translate(const idVec3 &translation)
void SetDefaultFriction(float linear, float angular, float contact)
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
bool GetContactMotorDirection(idVec3 &dir) const
virtual void Restore(idRestoreGame *saveFile)
void SetContactFrictionDent(const float dent, const float start, const float end)
void SetSteerSpeed(const float speed)
virtual void SetBody2(idAFBody *body)
void ApplyImpulse(const int id, const idVec3 &point, const idVec3 &impulse)
idClipModel * GetClipModel(int id=0) const
int GetNumBodies(void) const
idAFConstraint * GetConstraint(const char *constraintName) const
struct AFBodyPState_s AFBodyPState_t
virtual void DebugDraw(void)
int GetConstraintId(idAFConstraint *constraint) const
virtual void Translate(const idVec3 &translation)
void SetComeToRest(bool enable)
idAFConstraint_Hinge * hinge
virtual void DebugDraw(void)
int maxSubTreeAuxiliaryIndex
void lock(CURL *handle, curl_lock_data data, curl_lock_access access, void *useptr)
idAFConstraint_BallAndSocketJoint(const idStr &name, idAFBody *body1, idAFBody *body2)
void VerifyContactConstraints(void)
void SetAnchor(const idVec3 &pyramidAxis)
idAFConstraint_ConeLimit * coneLimit
void SetDensity(float density, const idMat3 &inertiaScale=mat3_identity)
bool GetFrictionDirection(idVec3 &dir) const
idVec3 GetAxis(void) const
virtual void Translate(const idVec3 &translation)
virtual void GetForce(idAFBody *body, idVec6 &force)
void SetContactMotorDirection(const idVec3 &dir)
const idVecX & GetMultiplier(void)
void SetWorldOrigin(const idVec3 &origin)
idAFConstraint_HingeSteering(void)
void ApplyFriction(float timeStep, float endTimeMSec)
void SetRelativeOrigin(const idVec3 &origin)
float GetInverseMass(void) const
bool TestIfAtRest(float timeStep)
virtual void Rotate(const idRotation &rotation)
void Save(idSaveGame *savefile) const
float GetFriction(void) const
void Solve(int auxiliaryIndex=0) const
virtual void Translate(const idVec3 &translation)
virtual void Evaluate(float invTimeStep)
const idBounds & GetBounds(int id=-1) const
GLenum GLenum GLenum GLenum GLenum scale
idMat3 Transpose(void) const
void SetPushed(int deltaTime)
virtual void Rotate(const idRotation &rotation)
virtual void Rotate(const idRotation &rotation)
void SetSteerAngle(const float degrees)
void Setup(const char *name, idAFBody *body, const idVec3 &origin, const idMat3 &axis, idClipModel *clipModel)
virtual void Translate(const idVec3 &translation)
virtual void Translate(const idVec3 &translation)
void SetForcePushable(const bool enable)
struct AFCollision_s AFCollision_t
idAFBody * GetBody(const char *bodyName) const
const idMat3 & GetWorldAxis(void) const
virtual void Translate(const idVec3 &translation)
const idVec3 & GetCenterOfMass(void) const
virtual void Evaluate(float invTimeStep)
idAFConstraint_HingeFriction * fc
idList< idAFConstraint * > constraints
virtual void Save(idSaveGame *saveFile) const
void SetShafts(const idVec3 &cardanShaft1, const idVec3 &cardanShaft2)
virtual void DebugDraw(void)
virtual void Restore(idRestoreGame *saveFile)
idAFConstraint_ConeLimit * coneLimit
bool Add(idPhysics_AF *phys, float invTimeStep)
const idVec3 & SubVec3(int index) const
float GetMass(int id=-1) const
void SetFriction(const float f)
virtual void ApplyFriction(float invTimeStep)
const idVec3 GetWheelOrigin(void) const
virtual void Evaluate(float invTimeStep)
virtual void ApplyFriction(float invTimeStep)
idList< idAFConstraint * > auxiliaryConstraints
idAFConstraint_Fixed(const idStr &name, idAFBody *body1, idAFBody *body2)
virtual void ApplyFriction(float invTimeStep)
idMat3 GetInverseWorldInertia(void) const
float GetContactFrictionScale(void) const
float GetContactMotorForce(void) const
void SortBodies_r(idList< idAFBody * > &sortedList, idAFBody *body)
float GetAngle(void) const
idList< idAFBody * > sortedBodies
void Setup(idAFConstraint_BallAndSocketJoint *cc)
void Setup(idAFBody *b1, idAFBody *b2, const idVec3 &pyramidAnchor, const idVec3 &pyramidAxis, const idVec3 &baseAxis, const float pyramidAngle1, const float pyramidAngle2, const idVec3 &body1Axis)
idAFConstraint_BallAndSocketJointFriction(void)
idClipModel * GetClipModel(void) const
void SetEpsilon(const float e)
float contactMotorVelocity
void AddForce(const idVec3 &point, const idVec3 &force)
virtual void Rotate(const idRotation &rotation)
float GetFriction(void) const
const idMat3 & GetAxis(int id=0) const
idAFConstraint_HingeSteering * steering
void SetMaster(idEntity *master, const bool orientated=true)
bool Add(idPhysics_AF *phys, float invTimeStep)
virtual void ApplyFriction(float invTimeStep)
float contactFrictionDentStart
void SetAxis(const idVec3 &ax)
idAFConstraint_Line(const idStr &name, idAFBody *body1, idAFBody *body2)
virtual void Rotate(const idRotation &rotation)
idList< idAFConstraint_Contact * > contactConstraints
int GetClipMask(void) const
idAFConstraint_HingeFriction(void)
const idVec3 & GetAngularVelocity(int id=0) const
virtual void ApplyFriction(float invTimeStep)
void SetAnchor(const idVec3 &coneAnchor)
virtual void Rotate(const idRotation &rotation)
void SetSuspension(const float up, const float down, const float k, const float d, const float f)
virtual void DebugDraw(void)
void SetFriction(float linear, float angular, float contact)
void AddFrameConstraint(idAFConstraint *constraint)
bool Evaluate(int timeStepMSec, int endTimeMSec)
virtual void Translate(const idVec3 &translation)
virtual void ApplyFriction(float invTimeStep)
virtual void ApplyFriction(float invTimeStep)
struct idAFConstraint::constraintFlags_s fl
void SetConeLimit(const idVec3 &coneAxis, const float coneAngle)
virtual void ApplyFriction(float invTimeStep)
virtual void Evaluate(float invTimeStep)
void AddFrameConstraints(void)
void DeleteBody(const char *bodyName)
virtual void Restore(idRestoreGame *saveFile)
void SetClipMask(const int mask)
void SetAnchor(const idVec3 &worldPosition)
const idBounds & GetAbsBounds(int id=-1) const
idAFConstraint_BallAndSocketJoint * joint
void SetLimit(const float minLength, const float maxLength)
void SetWorldAxis(const idMat3 &axis)
void ApplyContactForces(void)
bool Add(idPhysics_AF *phys, float invTimeStep)
void SetFrictionDirection(const idVec3 &dir)
void SetTimeScale(const float ts)
idVec3 GetAnchor(void) const
virtual void Restore(idRestoreGame *saveFile)
virtual void Evaluate(float invTimeStep)
void SetTimeScaleRamp(const float start, const float end)
idVec3 GetAnchor(void) const
virtual void GetCenter(idVec3 ¢er)
float contactFrictionDentEnd
virtual void Rotate(const idRotation &rotation)
idAFConstraint_Slider(const idStr &name, idAFBody *body1, idAFBody *body2)
void SetMass(float mass, int id=-1)
void WriteToSnapshot(idBitMsgDelta &msg) const
virtual void Restore(idRestoreGame *saveFile)
void SetSteerSpeed(const float speed)
bool EvaluateContacts(void)
virtual void Rotate(const idRotation &rotation)
void SetContents(int contents, int id=-1)
void SetPlane(const idVec3 &normal, const idVec3 &anchor)
virtual void ApplyFriction(float invTimeStep)
void SetAnchor(const idVec3 &worldAnchor1, const idVec3 &worldAnchor2)
int GetNumClipModels(void) const
bool Add(idPhysics_AF *phys, float invTimeStep)
virtual void Restore(idRestoreGame *saveFile)
void SetOrigin(const idVec3 &newOrigin, int id=-1)
CLASS_PROTOTYPE(idPhysics_AF)
float GetJointFrictionScale(void) const
idVec3 GetAnchor(void) const
float contactFrictionScale
int GetContents(int id=-1) const
virtual void Translate(const idVec3 &translation)
virtual void Save(idSaveGame *saveFile) const
void Restore(idRestoreGame *savefile)
virtual void GetCenter(idVec3 ¢er)
virtual void DebugDraw(void)
idVec6 & GetResponseForce(int index)
idVec2 suspendAcceleration
virtual void Evaluate(float invTimeStep)
virtual void ApplyFriction(float invTimeStep)
virtual void ApplyFriction(float invTimeStep)
void CheckForCollisions(float timeStep)
void PrimaryForces(float timeStep)
void SetFriction(const float f)
virtual void Evaluate(float invTimeStep)
idAFConstraint_PyramidLimit * pyramidLimit
virtual void DebugDraw(void)
virtual void Translate(const idVec3 &translation)
void SetContactMotorVelocity(float vel)
void SetLimitEpsilon(const float e)
void CalculateForces(float timeStep) const
virtual void Evaluate(float invTimeStep)
void SetSuspendSpeed(const idVec2 &velocity, const idVec2 &acceleration)
void SetClipModel(idClipModel *clipModel)
virtual void ApplyFriction(float invTimeStep)
virtual void Save(idSaveGame *saveFile) const
virtual void Restore(idRestoreGame *saveFile)
bool IsAtRest(void) const
void Save(idSaveGame *saveFile)
int ClipContents(const idClipModel *model) const
virtual void Rotate(const idRotation &rotation)
idAFConstraint_UniversalJoint * joint
virtual void Save(idSaveGame *saveFile) const
idAFConstraint_Suspension(void)
const idVec3 & GetLinearVelocity(int id=0) const
const idVec3 & GetPushedLinearVelocity(const int id=0) const
float jointFrictionDentStart
float GetBouncyness(void) const
~idAFConstraint_BallAndSocketJoint(void)
virtual void Translate(const idVec3 &translation)
void Response(const idAFConstraint *constraint, int row, int auxiliaryIndex) const
void SetSelfCollision(const bool enable)
void SetCollision(const bool enable)
virtual void Translate(const idVec3 &translation)
virtual void Restore(idRestoreGame *saveFile)
virtual void DebugDraw(void)
virtual void Evaluate(float invTimeStep)
idAFConstraint_Hinge(const idStr &name, idAFBody *body1, idAFBody *body2)
void SetAxis(const idMat3 &newAxis, int id=-1)
virtual void Translate(const idVec3 &translation)
void SetEpsilon(const float e)
idList< AFCollision_t > collisions
void SetLinearVelocity(const idVec3 &newLinearVelocity, int id=0)
void SetLinearVelocity(const idVec3 &linear) const
void SetAnchor(const idVec3 &worldPosition)
idAFConstraint_BallAndSocketJointFriction * fc
void LockWorldConstraints(const bool lock)
void SetLimit(const idVec3 &axis, const float angle, const idVec3 &body1Axis)
void AuxiliaryForces(float timeStep)
const idVec3 & GetPushedAngularVelocity(const int id=0) const
void SetJointFrictionDent(const float dent, const float start, const float end)
void ClearExternalForce(void)
float contactFrictionDentScale
virtual ~idAFConstraint(void)
virtual void Evaluate(float invTimeStep)
virtual void Translate(const idVec3 &translation)
bool ApplyCollisions(float timeStep)
virtual void Save(idSaveGame *saveFile) const
idAFConstraint_UniversalJointFriction(void)
idAFConstraint_Spring(const idStr &name, idAFBody *body1, idAFBody *body2)
void SetAxis(const idVec3 &axis)
idList< idAFTree * > trees
void EnableMotor(const bool enable)
void SetAngularVelocity(const idVec3 &angular) const
idAFConstraint_Hinge * hinge
bool worldConstraintsLocked
idList< contactInfo_t > contacts
virtual void DebugDraw(void)
int GetBodyId(idAFBody *body) const
void ClipTranslation(trace_t &results, const idVec3 &translation, const idClipModel *model) const
void SetLimitEpsilon(const float e)
void Evolve(float timeStep)
void SetEpsilon(const float e)
void ClipRotation(trace_t &results, const idRotation &rotation, const idClipModel *model) const
bool Add(idPhysics_AF *phys, float invTimeStep)
virtual void Save(idSaveGame *saveFile) const
void SetEpsilon(const float e)
void SetRelativeAxis(const idMat3 &axis)
idAFConstraint_PyramidLimit * pyramidLimit
void SetSuspendTolerance(const float noMoveTime, const float translationTolerance, const float rotationTolerance)
idMat3 inverseInertiaTensor
void Setup(idAFBody *b1, idAFBody *b2, const idVec3 &coneAnchor, const idVec3 &coneAxis, const float coneAngle, const idVec3 &body1Axis)
void ReadFromSnapshot(const idBitMsgDelta &msg)
void SetSteerAngle(const float degrees)
void UpdateClipModels(void)
void AddConstraint(idAFConstraint *constraint)
virtual void Evaluate(float invTimeStep)
void SetConeLimit(const idVec3 &coneAxis, const float coneAngle, const idVec3 &body1Axis)
GLenum GLenum GLvoid * row
const idVec3 & GetWorldOrigin(void) const
idAFConstraint_PyramidLimit(void)
virtual void Save(idSaveGame *saveFile) const
void SetContactMotorForce(float force)
virtual void Restore(idRestoreGame *saveFile)
bool Add(idPhysics_AF *phys, float invTimeStep)
virtual void Translate(const idVec3 &translation)
void Setup(idAFConstraint_Hinge *cc)
idList< idAFConstraint * > frameConstraints
void SetJointFrictionScale(const float scale)
virtual void ApplyFriction(float invTimeStep)
float GetContactFriction(void) const
idAFConstraint_ConeLimit(void)
virtual void GetCenter(idVec3 ¢er)
virtual void SetBody1(idAFBody *body)
virtual void Save(idSaveGame *saveFile) const
idList< int > contactBodies
idAFConstraint * primaryConstraint
virtual void GetCenter(idVec3 ¢er)
void UpdateTime(int endTimeMSec)
virtual void Rotate(const idRotation &rotation)
void Translate(const idVec3 &translation, int id=-1)
void DeleteConstraint(const char *constraintName)
const idVec3 & GetAngularVelocity(void) const
idAFBody * GetMasterBody(void) const
idAFConstraint_CylindricalJoint(const idStr &name, idAFBody *body1, idAFBody *body2)
float jointFrictionDentScale
void SetSpring(const float stretch, const float compress, const float damping, const float restLength)
void SetSuspendTime(const float minTime, const float maxTime)
void GetAxis(idVec3 &a1, idVec3 &a2) const
idAFConstraint_Plane(const idStr &name, idAFBody *body1, idAFBody *body2)
~idAFConstraint_Hinge(void)
virtual void ApplyFriction(float invTimeStep)
void SetClipModel(idClipModel *model, float density, int id=0, bool freeOld=true)
void GetShafts(idVec3 &cardanShaft1, idVec3 &cardanShaft2)
virtual void GetForce(idAFBody *body, idVec6 &force)
void AddPushVelocity(const idVec6 &pushVelocity)
bool IsPushable(void) const
struct idAFBody::bodyFlags_s fl
idList< idAFConstraint * > primaryConstraints
virtual void DebugDraw(void)
constraintType_t GetType(void) const
virtual void DebugDraw(void)
void Setup(idAFConstraint_Hinge *cc)
virtual void Restore(idRestoreGame *saveFile)
void SetPyramidLimit(const idVec3 &pyramidAxis, const idVec3 &baseAxis, const float angle1, const float angle2)
float contactFrictionDent
virtual void SetBody1(idAFBody *body)
void SetAngularVelocity(const idVec3 &newAngularVelocity, int id=0)
virtual void Restore(idRestoreGame *saveFile)
virtual void DebugDraw(void)
const idStr & GetName(void) const
idVec3 GetPointVelocity(const idVec3 &point) const
idAFConstraint_UniversalJoint(const idStr &name, idAFBody *body1, idAFBody *body2)
void SetFriction(const float f)
virtual void Evaluate(float invTimeStep)
struct AFPState_s AFPState_t
void Rotate(const idRotation &rotation, int id=-1)
virtual void ApplyFriction(float invTimeStep)
void RemoveFrameConstraints(void)
void SetBody1Axis(const idVec3 &body1Axis)
void SetBody1Axis(const idVec3 &body1Axis)
virtual void GetCenter(idVec3 ¢er)
virtual void Rotate(const idRotation &rotation)
float jointFrictionDentEnd
virtual void Evaluate(float invTimeStep)
float suspensionKCompress
virtual void ApplyFriction(float invTimeStep)
void SetMotorVelocity(const float vel)
void EvaluateConstraints(float timeStep)
idAFConstraint_UniversalJointFriction * fc
virtual void Evaluate(float invTimeStep)
idEntity * SetupCollisionForBody(idAFBody *body) const
void EvaluateBodies(float timeStep)
const idVec3 & GetLinearVelocity(void) const
bool CollisionImpulse(float timeStep, idAFBody *body, trace_t &collision)
idList< idAFBody * > children
void SetContactFrictionScale(const float scale)
bool IsClosedLoop(const idAFBody *body1, const idAFBody *body2) const
int GetRestStartTime(void) const
virtual void Rotate(const idRotation &rotation)
virtual void Evaluate(float invTimeStep)
virtual void GetForce(idAFBody *body, idVec6 &force)
void SetLimitEpsilon(const float e)
float GetContactMotorVelocity(void) const
void Setup(idAFConstraint_UniversalJoint *cc)
void Restore(idRestoreGame *saveFile)
const idVec3 & GetOrigin(int id=0) const
const idStr & GetName(void) const
virtual void Rotate(const idRotation &rotation)
virtual void ApplyFriction(float invTimeStep)
virtual void SetBody2(idAFBody *body)
virtual void DebugDraw(void)
virtual void Save(idSaveGame *saveFile) const
bool spatialInertiaSparse
virtual void Rotate(const idRotation &rotation)
idAFConstraint_ConeLimit * coneLimit
void SetMaxSubTreeAuxiliaryIndex(void)
virtual void Translate(const idVec3 &translation)
int GetBodyContactConstraints(const int id, idAFConstraint_Contact *contacts[], int maxContacts) const