summaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/Entity.h2
-rw-r--r--src/entities/Physical.cpp12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index f506017a..c3e4cc3b 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -30,7 +30,7 @@ enum eEntityStatus : uint8
STATUS_PLANE,
STATUS_PLAYER_REMOTE,
STATUS_PLAYER_DISABLED,
- STATUS_12, // TODO: what is this? used in CPhysical::ApplyAirResistance
+ STATUS_GHOST
};
class CEntity : public CPlaceable
diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp
index 1f62ef64..a5a1f110 100644
--- a/src/entities/Physical.cpp
+++ b/src/entities/Physical.cpp
@@ -458,6 +458,7 @@ CPhysical::ApplyFrictionTurnForce(float jx, float jy, float jz, float px, float
m_vecTurnFriction += turnimpulse*(1.0f/m_fTurnMass);
}
+bool debugSprings;
bool
CPhysical::ApplySpringCollision(float springConst, CVector &springDir, CVector &point, float springRatio, float bias)
{
@@ -467,6 +468,10 @@ CPhysical::ApplySpringCollision(float springConst, CVector &springDir, CVector &
float impulse = -GRAVITY*m_fMass*step * springConst * compression * bias*2.0f;
ApplyMoveForce(springDir*impulse);
ApplyTurnForce(springDir*impulse, point);
+if(debugSprings){
+printf("spring : %.3f %.3f %.3f\n", springDir.x*impulse, springDir.y*impulse, springDir.z*impulse);
+printf("speed: %.3f %.3f %.3f\n", m_vecMoveSpeed.x, m_vecMoveSpeed.y, m_vecMoveSpeed.z);
+}
}
return true;
}
@@ -484,6 +489,11 @@ CPhysical::ApplySpringCollisionAlt(float springConst, CVector &springDir, CVecto
impulse *= 0.75f;
ApplyMoveForce(forceDir*impulse);
ApplyTurnForce(forceDir*impulse, point);
+if(debugSprings){
+printf("spring alt: %.3f %.3f %.3f %.3f\n", forceDir.x*impulse, forceDir.y*impulse, forceDir.z*impulse, springRatio);
+printf("speed: %.3f %.3f %.3f\n", m_vecMoveSpeed.x, m_vecMoveSpeed.y, m_vecMoveSpeed.z);
+printf("pos: %.3f %.3f %.3f\n", GetPosition().x, GetPosition().y, GetPosition().z);
+}
}
return true;
}
@@ -531,7 +541,7 @@ void
CPhysical::ApplyAirResistance(void)
{
if(m_fAirResistance > 0.1f){
- if(GetStatus() != STATUS_12){
+ if(GetStatus() != STATUS_GHOST){
float f = Pow(m_fAirResistance, CTimer::GetTimeStep());
m_vecMoveSpeed *= f;
m_vecTurnSpeed *= f;