From 9a1a434605aa2858cc7d26750777cf2d06f55833 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 1 Sep 2016 12:39:13 -0700 Subject: [PATCH] Add missing CPhysicsActor class member --- Runtime/MP1/CWarWasp.cpp | 4 ++-- Runtime/World/CPatterned.cpp | 5 +++-- Runtime/World/CPatternedInfo.cpp | 2 +- Runtime/World/CPatternedInfo.hpp | 2 +- Runtime/World/CPhysicsActor.cpp | 13 +++++++------ Runtime/World/CPhysicsActor.hpp | 7 ++++--- Runtime/World/ScriptLoader.cpp | 14 +++++++++----- specter | 2 +- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Runtime/MP1/CWarWasp.cpp b/Runtime/MP1/CWarWasp.cpp index b8df93c5e..13326d47a 100644 --- a/Runtime/MP1/CWarWasp.cpp +++ b/Runtime/MP1/CWarWasp.cpp @@ -9,8 +9,8 @@ CWarWasp::CWarWasp(TUniqueId uid, const std::string& name, const CEntityInfo& in CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor, CPatterned::EColliderType collider, const CDamageInfo& dInfo1, const CActorParameters& actorParms, ResId weapon, const CDamageInfo& dInfo2, ResId particle, u32 w3) - : CPatterned(EUnknown::ThirtyNine, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, collider, EBodyType::Three, - actorParms, false) + : CPatterned(EUnknown::ThirtyNine, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, + collider, EBodyType::Three, actorParms, false) { } diff --git a/Runtime/World/CPatterned.cpp b/Runtime/World/CPatterned.cpp index b84424640..c99f611fe 100644 --- a/Runtime/World/CPatterned.cpp +++ b/Runtime/World/CPatterned.cpp @@ -20,10 +20,11 @@ CPatterned::CPatterned(EUnknown, TUniqueId uid, const std::string& name, CPatter EBodyType, const CActorParameters& actorParms, bool) : CAi(uid, pInfo.xf8_active, name, info, xf, std::move(mData), zeus::CAABox(pInfo.xcc_bodyOrigin - zeus::CVector3f{pInfo.xc4_halfExtent, pInfo.xc4_halfExtent, 0.f}, - pInfo.xcc_bodyOrigin + zeus::CVector3f{pInfo.xc4_halfExtent, pInfo.xc4_halfExtent, pInfo.xc8_height}), + pInfo.xcc_bodyOrigin + zeus::CVector3f{pInfo.xc4_halfExtent, pInfo.xc4_halfExtent, + pInfo.xc8_height}), pInfo.x0_mass, pInfo.x54_healthInfo, pInfo.x5c_damageVulnerability, moveType == EMovementType::Flyer ? gkPatternedFlyerMaterialList : gkPatternedGroundMaterialList, - pInfo.xfc_stateMachineId, actorParms, pInfo.xd8_, 0.8f) + pInfo.xfc_stateMachineId, actorParms, pInfo.xd8_stepUpHeight, 0.8f) { } diff --git a/Runtime/World/CPatternedInfo.cpp b/Runtime/World/CPatternedInfo.cpp index 97105831d..a832cc9a0 100644 --- a/Runtime/World/CPatternedInfo.cpp +++ b/Runtime/World/CPatternedInfo.cpp @@ -25,7 +25,7 @@ CPatternedInfo::CPatternedInfo(CInputStream& in, u32 pcount) xc4_halfExtent(in.readFloatBig()), xc8_height(in.readFloatBig()), xcc_bodyOrigin(zeus::CVector3f::ReadBig(in)), - xd8_(in.readFloatBig()), + xd8_stepUpHeight(in.readFloatBig()), xdc_(in.readFloatBig()), xe0_(in.readFloatBig()), xe4_(in.readFloatBig()), diff --git a/Runtime/World/CPatternedInfo.hpp b/Runtime/World/CPatternedInfo.hpp index 2617be295..915fdb4f3 100644 --- a/Runtime/World/CPatternedInfo.hpp +++ b/Runtime/World/CPatternedInfo.hpp @@ -34,7 +34,7 @@ class CPatternedInfo float xc4_halfExtent; float xc8_height; zeus::CVector3f xcc_bodyOrigin; - float xd8_; + float xd8_stepUpHeight; float xdc_; float xe0_; float xe4_; diff --git a/Runtime/World/CPhysicsActor.cpp b/Runtime/World/CPhysicsActor.cpp index 004629468..26b313fa7 100644 --- a/Runtime/World/CPhysicsActor.cpp +++ b/Runtime/World/CPhysicsActor.cpp @@ -13,7 +13,8 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name , xf8_24_(true) , x150_momentum(moverData.x18_) , x1c0_collisionPrimitive(box, matList) - , x200_(xf.buildMatrix3f()) + , x1f4_translation(xf.origin) + , x200_orientation(xf.buildMatrix3f()) , x23c_stepUpHeight(stepUp) , x240_stepDownHeight(stepDown) { @@ -412,6 +413,11 @@ CPhysicsState::CPhysicsState(const zeus::CVector3f& translation, const zeus::CQu { } +void CPhysicsState::SetTranslation(const zeus::CVector3f& tr) +{ + x0_translation = tr; +} + void CPhysicsState::SetOrientation(const zeus::CQuaternion& orient) { xc_orientation = orient; @@ -422,11 +428,6 @@ const zeus::CQuaternion& CPhysicsState::GetOrientation() const return xc_orientation; } -void CPhysicsState::SetTranslation(const zeus::CVector3f& tr) -{ - x0_translation = tr; -} - const zeus::CVector3f& CPhysicsState::GetTranslation() const { return x0_translation; diff --git a/Runtime/World/CPhysicsActor.hpp b/Runtime/World/CPhysicsActor.hpp index e532c2067..2e751a8c4 100644 --- a/Runtime/World/CPhysicsActor.hpp +++ b/Runtime/World/CPhysicsActor.hpp @@ -96,15 +96,16 @@ protected: zeus::CAABox x1a4_baseBoundingBox; CCollidableAABox x1c0_collisionPrimitive; zeus::CVector3f x1e8_primitiveOffset; - zeus::CNUQuaternion x200_; + zeus::CVector3f x1f4_translation; + zeus::CNUQuaternion x200_orientation; zeus::CAxisAngle x210_; zeus::CAxisAngle x21c_; bool x234_ = false; float x238_ = 1000000.0f; float x23c_stepUpHeight; float x240_stepDownHeight; - float x244_restitutionCoefModifier; - float x248_collisionAccuracyModifier; + float x244_restitutionCoefModifier = 0.f; + float x248_collisionAccuracyModifier = 1.f; u32 x24c_; u32 x250_; public: diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 6eaa45458..765062892 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -1319,8 +1319,8 @@ CEntity* ScriptLoader::LoadWarWasp(CStateManager& mgr, CInputStream& in, CAnimRes res(aParms.GetACSFile(), aParms.GetCharacter(), scale, true, aParms.GetInitialAnimation()); CModelData mData(res); - return new MP1::CWarWasp(mgr.AllocateUniqueId(), *name, info, xf, std::move(mData), pInfo, flavor, collider, damageInfo1, actorParms, weaponDesc, - damageInfo2, particle, w1); + return new MP1::CWarWasp(mgr.AllocateUniqueId(), *name, info, xf, std::move(mData), pInfo, flavor, collider, + damageInfo1, actorParms, weaponDesc, damageInfo2, particle, w1); } CEntity* ScriptLoader::LoadSpacePirate(CStateManager& mgr, CInputStream& in, @@ -1342,13 +1342,17 @@ CEntity* ScriptLoader::LoadSpacePirate(CStateManager& mgr, CInputStream& in, if (animParms.GetCharacter() == 0) { - Log.report(logvisor::Warning, "SpacePirate <%s> has AnimationInformation property with invalid character selected", head.x0_name.c_str()); + Log.report(logvisor::Warning, + "SpacePirate <%s> has AnimationInformation property with invalid character selected", + head.x0_name.c_str()); animParms.SetCharacter(2); } - CModelData mData(CAnimRes(animParms.GetACSFile(), animParms.GetCharacter(), head.x40_scale, animParms.GetInitialAnimation(), true)); + CModelData mData(CAnimRes(animParms.GetACSFile(), animParms.GetCharacter(), head.x40_scale, + animParms.GetInitialAnimation(), true)); - return new MP1::CSpacePirate(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, std::move(mData), aParams, pInfo, in, propCount); + return new MP1::CSpacePirate(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, std::move(mData), + aParams, pInfo, in, propCount); } CEntity* ScriptLoader::LoadFlyingPirate(CStateManager& mgr, CInputStream& in, diff --git a/specter b/specter index 50749d771..6109a0512 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit 50749d771218db49aac420fe3e7aa11d9ffc3612 +Subproject commit 6109a051271b811bb687165ddf195d21e1db824e