Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 78c0870

Browse files
committed
Cleanup on ACrab limb flail logic + making it work the same as AHuman
1 parent aac41d6 commit 78c0870

File tree

1 file changed

+11
-52
lines changed

1 file changed

+11
-52
lines changed

Entities/ACrab.cpp

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,58 +2538,17 @@ void ACrab::Update()
25382538
deltaTime);
25392539

25402540
}
2541-
}
2542-
// Not stable/standing, so make sure the end of limbs are moving around limply in a ragdoll fashion
2543-
else
2544-
{
2545-
// TODO: Make the limb atom groups fly around and react to terrain, without getting stuck etc
2546-
bool wrapped = false;
2547-
Vector limbPos;
2548-
if (m_pLFGLeg)
2549-
{
2550-
// m_pLFGFootGroup->SetLimbPos(m_pLFGLeg->GetAnklePos(), m_HFlipped);
2551-
m_pLFGFootGroup->FlailAsLimb(m_Pos,
2552-
m_pLFGLeg->GetParentOffset().GetXFlipped(m_HFlipped) * m_Rotation,
2553-
m_pLFGLeg->GetMaxLength(),
2554-
g_SceneMan.GetGlobalAcc() * g_TimerMan.GetDeltaTimeSecs(),
2555-
m_AngularVel,
2556-
m_pLFGLeg->GetMass(),
2557-
g_TimerMan.GetDeltaTimeSecs());
2558-
}
2559-
if (m_pLBGLeg)
2560-
{
2561-
// m_pLBGFootGroup->SetLimbPos(m_pLBGLeg->GetAnklePos(), m_HFlipped);
2562-
m_pLBGFootGroup->FlailAsLimb(m_Pos,
2563-
m_pLBGLeg->GetParentOffset().GetXFlipped(m_HFlipped) * m_Rotation,
2564-
m_pLBGLeg->GetMaxLength(),
2565-
g_SceneMan.GetGlobalAcc() * g_TimerMan.GetDeltaTimeSecs(),
2566-
m_AngularVel,
2567-
m_pLBGLeg->GetMass(),
2568-
g_TimerMan.GetDeltaTimeSecs());
2569-
}
2570-
if (m_pRFGLeg)
2571-
{
2572-
// m_pRFGFootGroup->SetLimbPos(m_pRFGLeg->GetAnklePos(), m_HFlipped);
2573-
m_pRFGFootGroup->FlailAsLimb(m_Pos,
2574-
m_pRFGLeg->GetParentOffset().GetXFlipped(m_HFlipped) * m_Rotation,
2575-
m_pRFGLeg->GetMaxLength(),
2576-
g_SceneMan.GetGlobalAcc() * g_TimerMan.GetDeltaTimeSecs(),
2577-
m_AngularVel,
2578-
m_pRFGLeg->GetMass(),
2579-
g_TimerMan.GetDeltaTimeSecs());
2580-
}
2581-
if (m_pRBGLeg)
2582-
{
2583-
// m_pRBGFootGroup->SetLimbPos(m_pRBGLeg->GetAnklePos(), m_HFlipped);
2584-
m_pRBGFootGroup->FlailAsLimb(m_Pos,
2585-
m_pRBGLeg->GetParentOffset().GetXFlipped(m_HFlipped) * m_Rotation,
2586-
m_pRBGLeg->GetMaxLength(),
2587-
g_SceneMan.GetGlobalAcc() * g_TimerMan.GetDeltaTimeSecs(),
2588-
m_AngularVel,
2589-
m_pRBGLeg->GetMass(),
2590-
g_TimerMan.GetDeltaTimeSecs());
2591-
}
2592-
}
2541+
} else {
2542+
// Not stable/standing, so make sure the end of limbs are moving around limply in a ragdoll fashion.
2543+
// TODO: Make the limb atom groups fly around and react to terrain, without getting stuck etc.
2544+
if (m_pLFGLeg) { m_pLFGFootGroup->FlailAsLimb(m_Pos, RotateOffset(m_pLFGLeg->GetParentOffset()), m_pLFGLeg->GetMaxLength(), m_PrevVel * m_pLFGLeg->GetJointStiffness(), m_AngularVel, m_pLFGLeg->GetMass(), deltaTime); }
2545+
2546+
if (m_pLBGLeg) { m_pLBGFootGroup->FlailAsLimb(m_Pos, RotateOffset(m_pLBGLeg->GetParentOffset()), m_pLBGLeg->GetMaxLength(), m_PrevVel * m_pLBGLeg->GetJointStiffness(), m_AngularVel, m_pLBGLeg->GetMass(), deltaTime); }
2547+
2548+
if (m_pRFGLeg) { m_pRFGFootGroup->FlailAsLimb(m_Pos, RotateOffset(m_pRFGLeg->GetParentOffset()), m_pRFGLeg->GetMaxLength(), m_PrevVel * m_pRFGLeg->GetJointStiffness(), m_AngularVel, m_pRFGLeg->GetMass(), deltaTime); }
2549+
2550+
if (m_pRBGLeg) { m_pRBGFootGroup->FlailAsLimb(m_Pos, RotateOffset(m_pRBGLeg->GetParentOffset()), m_pRBGLeg->GetMaxLength(), m_PrevVel * m_pRBGLeg->GetJointStiffness(), m_AngularVel, m_pRBGLeg->GetMass(), deltaTime); }
2551+
}
25932552

25942553
/////////////////////////////////
25952554
// Manage Attachable:s

0 commit comments

Comments
 (0)