2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:07:42 +00:00

Various bug fixes

This commit is contained in:
Jack Andersen
2019-02-07 15:08:15 -10:00
parent 5600bf5172
commit 5f8b65e3b5
7 changed files with 27 additions and 27 deletions

View File

@@ -1888,13 +1888,13 @@ CBSWallWalkerLocomotion::CBSWallWalkerLocomotion(CActor& actor) : CBSBiPedLocomo
float CBSWallWalkerLocomotion::ApplyLocomotionPhysics(float dt, CBodyController& bc) {
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
float maxSpeed = bc.GetBodyStateInfo().GetMaxSpeed();
zeus::CVector3f x40 = bc.GetCommandMgr().GetMoveVector() * maxSpeed;
if ((zeus::CVector3f::getAngleDiff(bc.GetCommandMgr().GetFaceVector(), x40) < (M_PIF / 2.f)
? x40
zeus::CVector3f scaledMove = bc.GetCommandMgr().GetMoveVector() * maxSpeed;
if ((zeus::CVector3f::getAngleDiff(bc.GetCommandMgr().GetFaceVector(), scaledMove) < (M_PIF / 2.f)
? scaledMove
: bc.GetCommandMgr().GetFaceVector())
.canBeNormalized())
bc.FaceDirection3D(x40.normalized(), act->GetTransform().basis[1], dt);
zeus::CVector3f impulse = act->GetMoveToORImpulseWR(act->GetTransform().transposeRotate(x40 * dt), dt);
bc.FaceDirection3D(scaledMove.normalized(), act->GetTransform().basis[1], dt);
zeus::CVector3f impulse = act->GetMoveToORImpulseWR(act->GetTransform().transposeRotate(scaledMove * dt), dt);
impulse = act->GetMass() > FLT_EPSILON ? impulse / act->GetMass()
: zeus::CVector3f(0.f, act->GetVelocity().magnitude(), 0.f);
if (maxSpeed > FLT_EPSILON)