diff --git a/Runtime/AutoMapper/CMappableObject.cpp b/Runtime/AutoMapper/CMappableObject.cpp index adc975a1e..e535dc4d8 100644 --- a/Runtime/AutoMapper/CMappableObject.cpp +++ b/Runtime/AutoMapper/CMappableObject.cpp @@ -50,7 +50,7 @@ zeus::CTransform CMappableObject::AdjustTransformForType() { orientation.origin = {-0.49f * doorCenterX, 0.f, -1.f * doorCenterZ}; orientation.rotateLocalY(zeus::degToRad(90.f)); return x10_transform * orientation; - } else if (x0_type >= EMappableObjectType::BlueDoor || x0_type <= EMappableObjectType::PlasmaDoorFloor2) { + } else if (x0_type >= EMappableObjectType::BlueDoor && x0_type <= EMappableObjectType::PlasmaDoorFloor2) { return x10_transform; } return zeus::CTransform::Translate(x10_transform.origin); diff --git a/Runtime/Character/CBodyState.cpp b/Runtime/Character/CBodyState.cpp index 5f986e4c6..29beef12b 100644 --- a/Runtime/Character/CBodyState.cpp +++ b/Runtime/Character/CBodyState.cpp @@ -1888,13 +1888,13 @@ CBSWallWalkerLocomotion::CBSWallWalkerLocomotion(CActor& actor) : CBSBiPedLocomo float CBSWallWalkerLocomotion::ApplyLocomotionPhysics(float dt, CBodyController& bc) { if (TCastToPtr 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) diff --git a/Runtime/Collision/CCollidableOBBTree.cpp b/Runtime/Collision/CCollidableOBBTree.cpp index ca9dc0a1e..2737a6e0c 100644 --- a/Runtime/Collision/CCollidableOBBTree.cpp +++ b/Runtime/Collision/CCollidableOBBTree.cpp @@ -17,7 +17,9 @@ bool CCollidableOBBTree::LineIntersectsLeaf(const COBBTree::CLeafData& leaf, CRa for (int i = 0; i < leaf.GetSurfaceVector().size(); ++i) { u16 surfIdx = leaf.GetSurfaceVector()[i]; CCollisionSurface surface = x10_tree->GetSurface(surfIdx); - if (info.GetMaterialFilter().Passes(GetMaterial())) { + CMaterialList matList = GetMaterial(); + matList.Add(surface.GetSurfaceFlags()); + if (info.GetMaterialFilter().Passes(matList)) { if (CollisionUtil::RayTriangleIntersection(info.GetRay().start, info.GetRay().dir, surface.GetVerts(), info.Magnitude())) { intersectIdx = surfIdx; diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index 43cb7d505..f5ea9d8b3 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -4210,19 +4210,15 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) { case EPlayerOrbitState::NoOrbit: /* Disabled transitions directly from NoOrbit to OrbitObject for better keyboard handling */ #if 0 - if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input)) - { - SetOrbitTargetId(x33c_orbitNextTargetId, mgr); - if (x310_orbitTargetId != kInvalidUniqueId) - { - if (ValidateAimTargetId(x310_orbitTargetId, mgr)) - ResetAimTargetPrediction(x310_orbitTargetId); - SetOrbitState(EPlayerOrbitState::OrbitObject, mgr); - UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); - } - } - else - { + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input)) { + SetOrbitTargetId(x33c_orbitNextTargetId, mgr); + if (x310_orbitTargetId != kInvalidUniqueId) { + if (ValidateAimTargetId(x310_orbitTargetId, mgr)) + ResetAimTargetPrediction(x310_orbitTargetId); + SetOrbitState(EPlayerOrbitState::OrbitObject, mgr); + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } + } else { #else m_deferredOrbitObject = ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input); #endif @@ -4231,7 +4227,7 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) { if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitClose, input)) OrbitPoint(EPlayerOrbitType::Close, mgr); #if 0 - } + } #endif break; case EPlayerOrbitState::Grapple: diff --git a/Runtime/World/CScriptEffect.cpp b/Runtime/World/CScriptEffect.cpp index b79aa5caa..6cf3fdf84 100644 --- a/Runtime/World/CScriptEffect.cpp +++ b/Runtime/World/CScriptEffect.cpp @@ -59,7 +59,7 @@ CScriptEffect::CScriptEffect(TUniqueId uid, std::string_view name, const CEntity newXf.origin = zeus::CVector3f::skZero; x104_particleSystem->SetOrientation(newXf); x104_particleSystem->SetGlobalTranslation(xf.origin); - x104_particleSystem->SetLocalScale(scale); + x104_particleSystem->SetGlobalScale(scale); x104_particleSystem->SetParticleEmission(active); x104_particleSystem->SetModulationColor(lParms.GetNoLightsAmbient()); x104_particleSystem->SetModelsUseLights(x138_actorLights != nullptr); @@ -72,7 +72,7 @@ CScriptEffect::CScriptEffect(TUniqueId uid, std::string_view name, const CEntity newXf.origin = zeus::CVector3f::skZero; xf4_electric->SetOrientation(newXf); xf4_electric->SetGlobalTranslation(xf.origin); - xf4_electric->SetLocalScale(scale); + xf4_electric->SetGlobalScale(scale); xf4_electric->SetParticleEmission(active); } xe7_29_drawEnabled = true; @@ -94,7 +94,7 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt newXf.origin = zeus::CVector3f::skZero; x104_particleSystem->SetOrientation(newXf); x104_particleSystem->SetGlobalTranslation(GetTranslation()); - x104_particleSystem->SetLocalScale(scale); + x104_particleSystem->SetGlobalScale(scale); x104_particleSystem->SetParticleEmission(oldActive); x104_particleSystem->SetModulationColor(color); x104_particleSystem->SetModelsUseLights(x138_actorLights != nullptr); @@ -108,7 +108,7 @@ void CScriptEffect::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSt newXf.origin = zeus::CVector3f::skZero; xf4_electric->SetOrientation(newXf); xf4_electric->SetGlobalTranslation(GetTranslation()); - xf4_electric->SetLocalScale(scale); + xf4_electric->SetGlobalScale(scale); xf4_electric->SetParticleEmission(oldActive); xf4_electric->SetModulationColor(color); } diff --git a/Runtime/World/CWallWalker.cpp b/Runtime/World/CWallWalker.cpp index 1c0eed7f4..3fe063805 100644 --- a/Runtime/World/CWallWalker.cpp +++ b/Runtime/World/CWallWalker.cpp @@ -65,7 +65,9 @@ void CWallWalker::AlignToFloor(CStateManager& mgr, float radius, const zeus::CVe for (u16 i = 0; i < triArr.GetSize(); ++i) { u16 triIdx = triArr.GetAt(i); CCollisionSurface surf = leaf.GetOctTree().GetMasterListTriangle(triIdx); - if (std::fabs(surf.GetPlane().pointToPlaneDist(newPos)) < margin && PointOnSurface(surf, newPos)) { + float dist = std::fabs(surf.GetPlane().pointToPlaneDist(newPos)); + if (dist < margin && PointOnSurface(surf, newPos)) { + margin = dist; x568_alignNormal = surf; hasSurface = true; } diff --git a/amuse b/amuse index fc2f8542c..54ef2dd73 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit fc2f8542c1d822901e2f6048ded1714020287490 +Subproject commit 54ef2dd73bd606f00a27192f23e66fbc6d896207