summaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-04 17:38:41 +0200
committeraap <aap@papnet.eu>2020-06-04 17:38:41 +0200
commit3e36428568d1b26306a9639ed04aa49b578ac74e (patch)
tree8faf914355af8f1507e5a90426a16338fa55b5e4 /src/entities
parentMerge branch 'master' into miami (diff)
downloadre3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar
re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.gz
re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.bz2
re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.lz
re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.xz
re3-3e36428568d1b26306a9639ed04aa49b578ac74e.tar.zst
re3-3e36428568d1b26306a9639ed04aa49b578ac74e.zip
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;