diff options
author | aap <aap@papnet.eu> | 2019-07-07 11:13:12 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-07 11:13:12 +0200 |
commit | 219a65b81a1141d6475fc48bdc6251bd20e44a70 (patch) | |
tree | 46cd85dd7b14ab85d23b0b39ffda41e08c1416a7 /src/entities/Physical.h | |
parent | made code use TimeStepIn(Milli)Seconds; purged unnecessary inlines (diff) | |
download | re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.tar re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.tar.gz re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.tar.bz2 re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.tar.lz re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.tar.xz re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.tar.zst re3-219a65b81a1141d6475fc48bdc6251bd20e44a70.zip |
Diffstat (limited to 'src/entities/Physical.h')
-rw-r--r-- | src/entities/Physical.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/entities/Physical.h b/src/entities/Physical.h index 0104268a..81d3d649 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -81,6 +81,7 @@ public: void AddCollisionRecord_Treadable(CEntity *ent); bool GetHasCollidedWith(CEntity *ent); void RemoveRefsToEntity(CEntity *ent); + static void PlacePhysicalRelativeToOtherPhysical(CPhysical *other, CPhysical *phys, CVector localPos); float GetDistanceSq(void) { return m_vecMoveSpeed.MagnitudeSqr() * sq(CTimer::GetTimeStep()); } // get speed of point p relative to entity center @@ -104,8 +105,8 @@ public: bIsInSafePosition = false; } - const CVector& GetMoveSpeed() { return m_vecMoveSpeed; } - const CVector& GetTurnSpeed() { return m_vecTurnSpeed; } + const CVector &GetMoveSpeed() { return m_vecMoveSpeed; } + const CVector &GetTurnSpeed() { return m_vecTurnSpeed; } void ApplyMoveSpeed(void); void ApplyTurnSpeed(void); @@ -120,7 +121,9 @@ public: void ApplyFrictionMoveForce(const CVector &j) { ApplyFrictionMoveForce(j.x, j.y, j.z); } void ApplyFrictionTurnForce(float jx, float jy, float jz, float rx, float ry, float rz); void ApplyFrictionTurnForce(const CVector &j, const CVector &p) { ApplyFrictionTurnForce(j.x, j.y, j.z, p.x, p.y, p.z); } - void ApplySpringCollision(float f1, CVector &v, CVector &p, float f2, float f3); + // springRatio: 1.0 fully extended, 0.0 fully compressed + bool ApplySpringCollision(float springConst, CVector &springDir, CVector &point, float springRatio, float bias); + bool ApplySpringDampening(float damping, CVector &springDir, CVector &point, CVector &speed); void ApplyGravity(void); void ApplyFriction(void); void ApplyAirResistance(void); |