Formatting, and more script object implementations

This commit is contained in:
Phillip Stephens 2016-12-19 10:27:58 -08:00
parent 03a93c52b9
commit 37aab51253
55 changed files with 921 additions and 978 deletions

View File

@ -49,8 +49,7 @@ struct CArchMsgParmInt32 : IArchMsgParm
struct CArchMsgParmVoidPtr : IArchMsgParm
{
void* x4_parm1;
CArchMsgParmVoidPtr(void* parm1)
: x4_parm1(parm1) {}
CArchMsgParmVoidPtr(void* parm1) : x4_parm1(parm1) {}
virtual ~CArchMsgParmVoidPtr() {}
};
@ -59,8 +58,9 @@ struct CArchMsgParmInt32Int32VoidPtr : IArchMsgParm
u32 x4_parm1;
u32 x8_parm2;
void* xc_parm3;
CArchMsgParmInt32Int32VoidPtr(u32 parm1, u32 parm2, void* parm3)
: x4_parm1(parm1), x8_parm2(parm2), xc_parm3(parm3) {}
CArchMsgParmInt32Int32VoidPtr(u32 parm1, u32 parm2, void* parm3) : x4_parm1(parm1), x8_parm2(parm2), xc_parm3(parm3)
{
}
virtual ~CArchMsgParmInt32Int32VoidPtr() {}
};
@ -87,8 +87,7 @@ struct CArchMsgParmControllerStatus : IArchMsgParm
{
u16 x4_parm1;
bool x6_parm2;
CArchMsgParmControllerStatus(u16 a, bool b)
: x4_parm1(a), x6_parm2(b) {}
CArchMsgParmControllerStatus(u16 a, bool b) : x4_parm1(a), x6_parm2(b) {}
virtual ~CArchMsgParmControllerStatus() {}
};
@ -98,14 +97,20 @@ class CArchitectureMessage
EArchMsgTarget x0_target;
EArchMsgType x4_type;
std::shared_ptr<IArchMsgParm> x8_parm;
public:
CArchitectureMessage(EArchMsgTarget target, EArchMsgType type, IArchMsgParm* parm)
: x0_target(target), x4_type(type), x8_parm(parm) {}
: x0_target(target), x4_type(type), x8_parm(parm)
{
}
EArchMsgTarget GetTarget() const {return x0_target;}
EArchMsgType GetType() const {return x4_type;}
EArchMsgTarget GetTarget() const { return x0_target; }
EArchMsgType GetType() const { return x4_type; }
template <class T>
const T* GetParm() const {return dynamic_cast<T*>(x8_parm.get());}
const T* GetParm() const
{
return dynamic_cast<T*>(x8_parm.get());
}
};
class MakeMsg
@ -149,7 +154,8 @@ public:
}
static CArchitectureMessage CreateCreateIOWin(EArchMsgTarget target, int pmin, int pmax, CIOWin* iowin)
{
return CArchitectureMessage(target, EArchMsgType::CreateIOWin, new CArchMsgParmInt32Int32VoidPtr(pmin, pmax, iowin));
return CArchitectureMessage(target, EArchMsgType::CreateIOWin,
new CArchMsgParmInt32Int32VoidPtr(pmin, pmax, iowin));
}
static const CArchMsgParmVoidPtr& GetParmDeleteIOWin(const CArchitectureMessage& msg)
{
@ -165,7 +171,6 @@ public:
return CArchitectureMessage(target, EArchMsgType::ApplicationExit, new CArchMsgParmNull());
}
};
}
#endif // __URDE_CARCHITECTUREMESSAGE_HPP__

View File

@ -108,7 +108,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
rVec = v;
}
}
else if (player->x304_ == 0 && player->x2f8_morphTransState == 0 && player->x3dc_ && x1c4_ == kInvalidUniqueId)
else if (player->x304_ == 0 && player->x2f8_morphTransState == 0 && player->x3dc_ && x1c4_pitchId == kInvalidUniqueId)
{
if (player->x294_ > 0.f)
{

View File

@ -12,9 +12,8 @@ class CFirstPersonCamera : public CGameCamera
u8 x18c_;
zeus::CTransform x190_gunFollowXf;
float x1c0_;
TUniqueId x1c4_;
union
{
TUniqueId x1c4_pitchId;
union {
struct
{
bool x1c6_24_ : 1;
@ -24,11 +23,12 @@ class CFirstPersonCamera : public CGameCamera
zeus::CVector3f x1c8_;
float x1d4_ = 0.f;
public:
CFirstPersonCamera(TUniqueId, const zeus::CTransform& xf, TUniqueId, float, float, float, float, float);
void PreThink(float, CStateManager &);
void Think(float, CStateManager &);
void PreThink(float, CStateManager&);
void Think(float, CStateManager&);
void ProcessInput(const CFinalInput&, CStateManager& mgr);
void Reset(const zeus::CTransform&, CStateManager& mgr);
@ -37,8 +37,8 @@ public:
void UpdateTransform(CStateManager&, float dt);
void UpdateElevation(CStateManager&);
void CalculateGunFollowOrientationAndTransform(zeus::CTransform&, zeus::CQuaternion&, float, zeus::CVector3f&);
void SetScriptPitchId(TUniqueId uid) { x1c4_pitchId = uid; }
};
}
#endif // __URDE_CFIRSTPERSONCAMERA_HPP__

View File

@ -86,7 +86,7 @@ T GetAverage(const T* v, s32 count)
for (s32 i = 1; i < count; ++i)
r += v[i];
return r / float(count);
return r / count;
}
template <class T, size_t N>

View File

@ -1,14 +1,29 @@
#include "CGSComboFire.hpp"
#include "Character/CAnimData.hpp"
namespace urde
{
bool CGSComboFire::Update(CAnimData&, float, CStateManager&)
bool CGSComboFire::Update(CAnimData& aData, float dt, CStateManager& mgr)
{
if (x8_ == -1)
{
}
else
{
x0_timeRemaining -= dt;
if (x0_timeRemaining > 0.f)
return false;
//aData.x220_25_loop = (x4_ - 1) != 0;
//aData.x220_24_animating = true;
}
return false;
}
void CGSComboFire::SetAnim(CAnimData&, s32, s32, s32, CStateManager&, float)
void CGSComboFire::SetAnim(CAnimData&, s32, s32, CStateManager&, float)
{
}

View File

@ -10,7 +10,7 @@ class CAnimData;
class CStateManager;
class CGSComboFire
{
float x0_ = 0.f;
float x0_timeRemaining = 0.f;
u32 x4_ = -1;
u32 x8_ = -1;
u32 xc_ = -1;
@ -31,7 +31,7 @@ public:
void SetIdle(bool);
void GetGunId() const;
bool Update(CAnimData&, float, CStateManager&);
void SetAnim(CAnimData&, s32, s32, s32, CStateManager&, float);
void SetAnim(CAnimData&, s32, s32, CStateManager&, float);
};
}

View File

@ -16,13 +16,12 @@ static CMaterialList MakeActorMaterialList(const CMaterialList& materialList, co
return ret;
}
CActor::CActor(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info,
const zeus::CTransform&, CModelData&& mData, const CMaterialList& list,
const CActorParameters& params, TUniqueId otherUid)
: CEntity(uid, info, active, name),
x60_material(MakeActorMaterialList(list, params)),
x70_(CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Nineteen}, {EMaterialTypes::Zero})),
xc6_(otherUid)
CActor::CActor(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CTransform&,
CModelData&& mData, const CMaterialList& list, const CActorParameters& params, TUniqueId otherUid)
: CEntity(uid, info, active, name)
, x60_material(MakeActorMaterialList(list, params))
, x70_(CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Nineteen}, {EMaterialTypes::Zero}))
, xc6_(otherUid)
{
if (mData.x10_animData || mData.x1c_normalModel)
x64_modelData = std::make_unique<CModelData>(std::move(mData));
@ -30,34 +29,31 @@ CActor::CActor(TUniqueId uid, bool active, const std::string& name, const CEntit
void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr)
{
switch(msg)
switch (msg)
{
case EScriptObjectMessage::Activate:
{
if (!x30_24_active)
xbc_time = CGraphics::GetSecondsMod900();
}
break;
break;
case EScriptObjectMessage::Decrement:
RemoveEmitter();
break;
case EScriptObjectMessage::InternalMessage11: // 33
{
/*
if (x94_simpleShadow)
AddMaterial(EMaterialTypes::ThirtyNine, mgr);
else
RemoveMaterial(EMaterialTypes::ThirtyNine, mgr);
*/
if (HasModelData() && x64_modelData->AnimationData())
{
TAreaId aid = GetAreaId();
//x64_modelData->AnimationData()->sub_8002AE6C(mgr, aid, x64_modelData->x0_particleScale);
// x64_modelData->AnimationData()->sub_8002AE6C(mgr, aid, x64_modelData->x0_particleScale);
}
}
break;
break;
case EScriptObjectMessage::InternalMessage12: // 34
{
RemoveEmitter();
@ -65,9 +61,8 @@ void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMana
if (HasModelData() && x64_modelData->AnimationData() && x64_modelData->GetNormalModel())
x64_modelData->AnimationData()->GetParticleDB().GetActiveParticleLightIds(mgr);
#endif
}
break;
break;
case EScriptObjectMessage::InternalMessage13: // 35
{
for (const SConnection& conn : x20_conns)
@ -80,14 +75,15 @@ void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMana
xc6_ = act->GetUniqueId();
}
}
break;
break;
case EScriptObjectMessage::InternalMessage15: // 37
SetInFluid(true, uid);
break;
case EScriptObjectMessage::InternalMessage17: // 39
SetInFluid(false, kInvalidUniqueId);
break;
default:break;
default:
break;
}
CEntity::AcceptScriptMsg(msg, uid, mgr);
}
@ -100,50 +96,27 @@ void CActor::CalculateRenderBounds()
x9c_aabox = zeus::CAABox(x34_transform.origin, x34_transform.origin);
}
CHealthInfo* CActor::HealthInfo()
CHealthInfo* CActor::HealthInfo() { return nullptr; }
const CDamageVulnerability* CActor::GetDamageVulnerability() const { return nullptr; }
const CDamageVulnerability* CActor::GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&,
const CDamageInfo&) const
{
return nullptr;
}
const CDamageVulnerability* CActor::GetDamageVulnerability() const
{
return nullptr;
}
rstl::optional_object<zeus::CAABox> CActor::GetTouchBounds() const { return {}; }
const CDamageVulnerability* CActor::GetDamageVulnerability(const zeus::CVector3f &, const zeus::CVector3f &, const CDamageInfo &) const
{
return nullptr;
}
void CActor::Touch(CActor&, CStateManager&) {}
rstl::optional_object<zeus::CAABox> CActor::GetTouchBounds() const
{
return {} ;
}
zeus::CVector3f CActor::GetOrbitPosition(const CStateManager&) const { return x34_transform.origin; }
void CActor::Touch(CActor &, CStateManager &)
{
zeus::CVector3f CActor::GetAimPosition(const CStateManager&, float) const { return x34_transform.origin; }
}
zeus::CVector3f CActor::GetHomingPosition(const CStateManager& mgr, float f) const { return GetAimPosition(mgr, f); }
zeus::CVector3f CActor::GetOrbitPosition(const CStateManager&) const
{
return x34_transform.origin;
}
zeus::CVector3f CActor::GetAimPosition(const CStateManager &, float) const
{
return x34_transform.origin;
}
zeus::CVector3f CActor::GetHomingPosition(const CStateManager& mgr, float f) const
{
return GetAimPosition(mgr, f);
}
zeus::CVector3f CActor::GetScanObjectIndicatorPosition(const CStateManager &)
{
return {};
}
zeus::CVector3f CActor::GetScanObjectIndicatorPosition(const CStateManager&) { return {}; }
void CActor::RemoveEmitter()
{
@ -165,16 +138,13 @@ const zeus::CTransform CActor::GetLocatorTransform(const std::string& segName) c
return x64_modelData->GetLocatorTransform(segName);
}
EWeaponCollisionResponseTypes CActor::GetCollisionResponseType(const zeus::CVector3f&,
const zeus::CVector3f&, CWeaponMode&, int)
EWeaponCollisionResponseTypes CActor::GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
CWeaponMode&, int)
{
return EWeaponCollisionResponseTypes::Unknown13;
}
void CActor::FluidFXThink(CActor::EFluidState, CScriptWater &, CStateManager &)
{
}
void CActor::FluidFXThink(CActor::EFluidState, CScriptWater&, CStateManager&) {}
void CActor::OnScanStateChanged(EScanState state, CStateManager& mgr)
{
@ -184,34 +154,26 @@ void CActor::OnScanStateChanged(EScanState state, CStateManager& mgr)
SendScriptMsgs(EScriptObjectState::ScanProcessing, mgr, EScriptObjectMessage::None);
else if (state == EScanState::Done)
SendScriptMsgs(EScriptObjectState::ScanDone, mgr, EScriptObjectMessage::None);
}
zeus::CAABox CActor::GetSortingBounds(const CStateManager &) const
{
return x9c_aabox;
}
zeus::CAABox CActor::GetSortingBounds(const CStateManager&) const { return x9c_aabox; }
void CActor::DoUserAnimEvent(CStateManager &, CInt32POINode &, EUserEventType)
{
}
void CActor::DoUserAnimEvent(CStateManager&, CInt32POINode&, EUserEventType) {}
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, CStateManager& mgr)
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4,
CStateManager& mgr)
{
x60_material.Remove(t1);
RemoveMaterial(t2, t3, t4, mgr);
}
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, CStateManager & mgr)
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, CStateManager& mgr)
{
x60_material.Remove(t1);
RemoveMaterial(t2, t3, mgr);
}
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, CStateManager& mgr)
{
x60_material.Remove(t1);
}
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, CStateManager& mgr) { x60_material.Remove(t1); }
void CActor::RemoveMaterial(EMaterialTypes t, CStateManager& mgr)
{
@ -219,7 +181,8 @@ void CActor::RemoveMaterial(EMaterialTypes t, CStateManager& mgr)
mgr.UpdateObjectInLists(*this);
}
void CActor::AddMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, EMaterialTypes t5, CStateManager& mgr)
void CActor::AddMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4, EMaterialTypes t5,
CStateManager& mgr)
{
x60_material.Add(t1);
AddMaterial(t2, t3, t4, t5, mgr);
@ -249,25 +212,13 @@ void CActor::AddMaterial(EMaterialTypes type, CStateManager& mgr)
mgr.UpdateObjectInLists(*this);
}
void CActor::SetCallTouch(bool callTouch)
{
xe5_28_callTouch = callTouch;
}
void CActor::SetCallTouch(bool callTouch) { xe5_28_callTouch = callTouch; }
bool CActor::GetCallTouch() const
{
return xe5_28_callTouch;
}
bool CActor::GetCallTouch() const { return xe5_28_callTouch; }
void CActor::SetUseInSortedList(bool use)
{
xe5_27_useInSortedLists = use;
}
void CActor::SetUseInSortedList(bool use) { xe5_27_useInSortedLists = use; }
bool CActor::GetUseInSortedLists() const
{
return xe5_27_useInSortedLists;
}
bool CActor::GetUseInSortedLists() const { return xe5_27_useInSortedLists; }
void CActor::SetInFluid(bool in, TUniqueId uid)
{
@ -287,15 +238,9 @@ void CActor::SetInFluid(bool in, TUniqueId uid)
}
}
bool CActor::HasModelData() const
{
return bool(x64_modelData);
}
bool CActor::HasModelData() const { return bool(x64_modelData); }
const CSfxHandle* CActor::GetSfxHandle() const
{
return x8c_sfxHandle.get();
}
const CSfxHandle* CActor::GetSfxHandle() const { return x8c_sfxHandle.get(); }
void CActor::SetSfxPitchBend(s32 val)
{
@ -307,7 +252,7 @@ void CActor::SetSfxPitchBend(s32 val)
CSfxManager::PitchBend(*x8c_sfxHandle.get(), val);
}
void CActor::SetTranslation(const zeus::CVector3f &tr)
void CActor::SetTranslation(const zeus::CVector3f& tr)
{
x34_transform.origin = tr;
xe4_27_ = true;
@ -315,19 +260,9 @@ void CActor::SetTranslation(const zeus::CVector3f &tr)
xe4_29_ = true;
}
void CActor::SetAddedToken(u32 tok)
{
xcc_addedToken = tok;
}
void CActor::SetAddedToken(u32 tok) { xcc_addedToken = tok; }
float CActor::GetPitch() const
{
return zeus::CQuaternion(x34_transform.buildMatrix3f()).pitch();
}
float CActor::GetYaw() const
{
return zeus::CQuaternion(x34_transform.buildMatrix3f()).yaw();
}
float CActor::GetPitch() const { return zeus::CQuaternion(x34_transform.buildMatrix3f()).pitch(); }
float CActor::GetYaw() const { return zeus::CQuaternion(x34_transform.buildMatrix3f()).yaw(); }
}

View File

@ -51,8 +51,7 @@ protected:
float xd0_;
u8 xd4_ = 0x7F;
u32 xd8_ = 2;
union
{
union {
struct
{
bool xe4_27_ : 1;
@ -70,6 +69,7 @@ protected:
};
u32 dummy = 0;
};
public:
enum class EFluidState
{
@ -82,9 +82,8 @@ public:
Done,
};
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
const zeus::CTransform&, CModelData&&, const CMaterialList&,
const CActorParameters&, TUniqueId);
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const CMaterialList&, const CActorParameters&, TUniqueId);
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
virtual void SetActive(bool active)
@ -102,7 +101,8 @@ public:
virtual void CalculateRenderBounds();
virtual CHealthInfo* HealthInfo();
virtual const CDamageVulnerability* GetDamageVulnerability() const;
virtual const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&, const CDamageInfo&) const;
virtual const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&,
const CDamageInfo&) const;
virtual rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
virtual void Touch(CActor&, CStateManager&);
virtual zeus::CVector3f GetOrbitPosition(const CStateManager&) const;
@ -116,9 +116,8 @@ public:
virtual zeus::CAABox GetSortingBounds(const CStateManager&) const;
virtual void DoUserAnimEvent(CStateManager&, CInt32POINode&, EUserEventType);
void RemoveEmitter();
const zeus::CTransform& GetTransform() const {return x34_transform;}
const zeus::CTransform& GetTransform() const { return x34_transform; }
const zeus::CTransform GetScaledLocatorTransform(const std::string& segName) const;
const zeus::CTransform GetLocatorTransform(const std::string& segName) const;
void RemoveMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);

View File

@ -7,7 +7,6 @@ namespace urde
class CActorModelParticles
{
};
}
#endif // __URDE_CACTORMODELPARTICLES_HPP__

View File

@ -62,8 +62,10 @@ set(WORLD_SOURCES
CScriptActorRotate.hpp CScriptActorRotate.cpp
CScriptSpecialFunction.hpp CScriptSpecialFunction.cpp
CScriptPlayerActor.hpp CScriptPlayerActor.cpp
CScriptSwitch.hpp CScriptSwitch.cpp
CScriptAiJumpPoint.hpp CScriptAiJumpPoint.cpp
CScriptColorModulate.hpp CScriptColorModulate.cpp
CScriptCameraPitchVolume.hpp CScriptCameraPitchVolume.cpp
CScriptCameraHintTrigger.hpp CScriptCameraHintTrigger.cpp
CGrappleParameters.hpp
CActorParameters.hpp

View File

@ -1,11 +1,7 @@
#include "CPathFindOpenList.hpp"
namespace urde
{
CPFOpenList::CPFOpenList()
{
}
CPFOpenList::CPFOpenList() {}
void CPFOpenList::Clear()
{
}
void CPFOpenList::Clear() {}
}

View File

@ -27,6 +27,7 @@ class CPFOpenList
u32 x3c_ = 0;
CPFRegion x40_region;
CPFRegionData x90_regionData;
public:
CPFOpenList();

View File

@ -2,23 +2,11 @@
namespace urde
{
void CPFRegionData::SetOpenLess(CPFRegion* region)
{
x24_openLess = region;
}
void CPFRegionData::SetOpenLess(CPFRegion* region) { x24_openLess = region; }
void CPFRegionData::SetOpenMore(CPFRegion* region)
{
x28_openMore = region;
}
void CPFRegionData::SetOpenMore(CPFRegion* region) { x28_openMore = region; }
CPFRegion* CPFRegionData::GetOpenLess()
{
return x24_openLess;
}
CPFRegion* CPFRegionData::GetOpenLess() { return x24_openLess; }
CPFRegion* CPFRegionData::GetOpenMore()
{
return x28_openMore;
}
CPFRegion* CPFRegionData::GetOpenMore() { return x28_openMore; }
}

View File

@ -22,6 +22,7 @@ class CPFRegion
zeus::CVector3f x28_;
zeus::CAABox x34_;
u32 x4c_;
public:
CPFRegion() = default;
void SetData(CPFRegionData*) {}
@ -40,8 +41,8 @@ public:
s32 GetNumNodes() const;
void GetNode(s32) const;
void PointHeight(const zeus::CVector3f&);
void FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>&,
const zeus::CVector3f&, const zeus::CVector3f&, bool);
void FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>&, const zeus::CVector3f&, const zeus::CVector3f&,
bool);
void FindBestPoint(std::vector<zeus::CVector3f>&, const zeus::CVector3f&, u32, float);
void SetLinkTo(s32);
void DropToGround(zeus::CVector3f&) const;
@ -61,6 +62,7 @@ class CPFRegionData
CPFRegion* x24_openLess = nullptr;
CPFRegion* x28_openMore = nullptr;
s32 x2c_ = 0;
public:
CPFRegionData() = default;
void SetOpenLess(CPFRegion*);

View File

@ -4,28 +4,23 @@
namespace urde
{
CMaterialList gkPatternedGroundMaterialList(EMaterialTypes::ThirtyThree,
EMaterialTypes::Nineteen,
EMaterialTypes::FourtyOne,
EMaterialTypes::ThirtySeven,
CMaterialList gkPatternedGroundMaterialList(EMaterialTypes::ThirtyThree, EMaterialTypes::Nineteen,
EMaterialTypes::FourtyOne, EMaterialTypes::ThirtySeven,
EMaterialTypes::Fourty);
CMaterialList gkPatternedFlyerMaterialList(EMaterialTypes::ThirtyThree,
EMaterialTypes::Nineteen,
EMaterialTypes::FourtyOne,
EMaterialTypes::Fourty);
CMaterialList gkPatternedFlyerMaterialList(EMaterialTypes::ThirtyThree, EMaterialTypes::Nineteen,
EMaterialTypes::FourtyOne, EMaterialTypes::Fourty);
CPatterned::CPatterned(EUnknown, TUniqueId uid, const std::string& name, CPatterned::EFlavorType flavor,
const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData,
const CPatternedInfo& pInfo, CPatterned::EMovementType moveType, CPatterned::EColliderType,
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.x0_mass, pInfo.x54_healthInfo, pInfo.x5c_damageVulnerability,
moveType == EMovementType::Flyer ? gkPatternedFlyerMaterialList : gkPatternedGroundMaterialList,
pInfo.xfc_stateMachineId, actorParms, pInfo.xd8_stepUpHeight, 0.8f)
: 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.x0_mass, pInfo.x54_healthInfo, pInfo.x5c_damageVulnerability,
moveType == EMovementType::Flyer ? gkPatternedFlyerMaterialList : gkPatternedGroundMaterialList,
pInfo.xfc_stateMachineId, actorParms, pInfo.xd8_stepUpHeight, 0.8f)
{
}
}

View File

@ -33,16 +33,16 @@ public:
{
One = 1
};
private:
public:
CPatterned(EUnknown unk, TUniqueId uid, const std::string& name, EFlavorType flavor, const CEntityInfo& info,
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pinfo,
CPatterned::EMovementType movement, EColliderType collider, EBodyType body,
const CActorParameters& params, bool b1);
CPatterned(EUnknown unk, TUniqueId uid, const std::string& name, EFlavorType flavor,
const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData,
const CPatternedInfo& pinfo, CPatterned::EMovementType movement, EColliderType collider,
EBodyType body, const CActorParameters& params, bool b1);
virtual void Death(const zeus::CVector3f& , CStateManager& ) {}
virtual void KnockBack(const zeus::CVector3f &, CStateManager &) {}
virtual void Death(const zeus::CVector3f&, CStateManager&) {}
virtual void KnockBack(const zeus::CVector3f&, CStateManager&) {}
};
}

View File

@ -5,41 +5,41 @@ namespace urde
{
CPatternedInfo::CPatternedInfo(CInputStream& in, u32 pcount)
: x0_mass(in.readFloatBig()),
x4_speed(in.readFloatBig()),
x8_turnSpeed(in.readFloatBig()),
xc_detectionRange(in.readFloatBig()),
x10_detectionHeightRange(in.readFloatBig()),
x14_dectectionAngle(in.readFloatBig()),
x18_minAttackRange(in.readFloatBig()),
x1c_maxAttackRange(in.readFloatBig()),
x20_averageAttackTime(in.readFloatBig()),
x24_attackTimeVariation(in.readFloatBig()),
x28_leashRadius(in.readFloatBig()),
x2c_playerLeashRadius(in.readFloatBig()),
x30_playerLeashTime(in.readFloatBig()),
x34_damageInfo(in),
x50_damageWaitTime(in.readFloatBig()),
x54_healthInfo(in),
x5c_damageVulnerability(in),
xc4_halfExtent(in.readFloatBig()),
xc8_height(in.readFloatBig()),
xcc_bodyOrigin(zeus::CVector3f::ReadBig(in)),
xd8_stepUpHeight(in.readFloatBig()),
xdc_(in.readFloatBig()),
xe0_(in.readFloatBig()),
xe4_(in.readFloatBig()),
xe8_deathSfx(CSfxManager::TranslateSFXID(in.readUint32Big())),
xec_animParams(in),
xf8_active(in.readBool()),
xfc_stateMachineId(in.readUint32Big()),
x100_(in.readFloatBig()),
x104_(in.readFloatBig()),
x108_(in.readFloatBig()),
x10c_particle1Frames(in.readUint32Big()),
x110_particle1Scale(zeus::CVector3f::ReadBig(in)),
x11c_particle1(in.readUint32Big()),
x120_particle2Frames(in.readUint32Big())
: x0_mass(in.readFloatBig())
, x4_speed(in.readFloatBig())
, x8_turnSpeed(in.readFloatBig())
, xc_detectionRange(in.readFloatBig())
, x10_detectionHeightRange(in.readFloatBig())
, x14_dectectionAngle(in.readFloatBig())
, x18_minAttackRange(in.readFloatBig())
, x1c_maxAttackRange(in.readFloatBig())
, x20_averageAttackTime(in.readFloatBig())
, x24_attackTimeVariation(in.readFloatBig())
, x28_leashRadius(in.readFloatBig())
, x2c_playerLeashRadius(in.readFloatBig())
, x30_playerLeashTime(in.readFloatBig())
, x34_damageInfo(in)
, x50_damageWaitTime(in.readFloatBig())
, x54_healthInfo(in)
, x5c_damageVulnerability(in)
, xc4_halfExtent(in.readFloatBig())
, xc8_height(in.readFloatBig())
, xcc_bodyOrigin(zeus::CVector3f::ReadBig(in))
, xd8_stepUpHeight(in.readFloatBig())
, xdc_(in.readFloatBig())
, xe0_(in.readFloatBig())
, xe4_(in.readFloatBig())
, xe8_deathSfx(CSfxManager::TranslateSFXID(in.readUint32Big()))
, xec_animParams(in)
, xf8_active(in.readBool())
, xfc_stateMachineId(in.readUint32Big())
, x100_(in.readFloatBig())
, x104_(in.readFloatBig())
, x108_(in.readFloatBig())
, x10c_particle1Frames(in.readUint32Big())
, x110_particle1Scale(zeus::CVector3f::ReadBig(in))
, x11c_particle1(in.readUint32Big())
, x120_particle2Frames(in.readUint32Big())
{
if (pcount >= 36)
x124_particle2Scale.readBig(in);
@ -56,5 +56,4 @@ std::pair<bool, u32> CPatternedInfo::HasCorrectParameterCount(CInputStream& in)
return {false, pcount};
return {true, pcount};
}
}

View File

@ -61,9 +61,8 @@ public:
static std::pair<bool, u32> HasCorrectParameterCount(CInputStream& in);
CAnimationParameters& GetAnimationParameters() { return xec_animParams; }
const CAnimationParameters& GetAnimationParameters() const {return xec_animParams;}
const CAnimationParameters& GetAnimationParameters() const { return xec_animParams; }
};
}
#endif // __URDE_CPATTERNEDINFO_HPP__

View File

@ -7,16 +7,16 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name
const zeus::CTransform& xf, CModelData&& mData, const CMaterialList& matList,
const zeus::CAABox& box, const SMoverData& moverData, const CActorParameters& actorParms,
float stepUp, float stepDown)
: CActor(uid, active, name, info, xf, std::move(mData), matList, actorParms, kInvalidUniqueId)
, xe8_mass(moverData.x30_mass)
, xec_massRecip(moverData.x30_mass <= 0.f ? 1.f : 1.f / moverData.x30_mass)
, xf8_24_(true)
, x150_momentum(moverData.x18_)
, x1c0_collisionPrimitive(box, matList)
, x1f4_translation(xf.origin)
, x200_orientation(xf.buildMatrix3f())
, x23c_stepUpHeight(stepUp)
, x240_stepDownHeight(stepDown)
: CActor(uid, active, name, info, xf, std::move(mData), matList, actorParms, kInvalidUniqueId)
, xe8_mass(moverData.x30_mass)
, xec_massRecip(moverData.x30_mass <= 0.f ? 1.f : 1.f / moverData.x30_mass)
, xf8_24_(true)
, x150_momentum(moverData.x18_)
, x1c0_collisionPrimitive(box, matList)
, x1f4_translation(xf.origin)
, x200_orientation(xf.buildMatrix3f())
, x23c_stepUpHeight(stepUp)
, x240_stepDownHeight(stepDown)
{
SetMass(moverData.x30_mass);
MoveCollisionPrimitive(zeus::CVector3f::skZero);
@ -25,15 +25,9 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name
ComputeDerivedQuantities();
}
void CPhysicsActor::Render(const CStateManager &mgr) const
{
CActor::Render(mgr);
}
void CPhysicsActor::Render(const CStateManager& mgr) const { CActor::Render(mgr); }
zeus::CVector3f CPhysicsActor::GetOrbitPosition(const CStateManager &) const
{
return GetBoundingBox().center();
}
zeus::CVector3f CPhysicsActor::GetOrbitPosition(const CStateManager&) const { return GetBoundingBox().center(); }
zeus::CVector3f CPhysicsActor::GetAimPosition(const CStateManager&, float dt) const
{
@ -43,61 +37,32 @@ zeus::CVector3f CPhysicsActor::GetAimPosition(const CStateManager&, float dt) co
return GetBoundingBox().center() + trans;
}
void CPhysicsActor::CollidedWith(const TUniqueId &, const CCollisionInfoList &, CStateManager &)
{
}
void CPhysicsActor::CollidedWith(const TUniqueId&, const CCollisionInfoList&, CStateManager&) {}
const CCollisionPrimitive& CPhysicsActor::GetCollisionPrimitive() const
{
return x1c0_collisionPrimitive;
}
const CCollisionPrimitive& CPhysicsActor::GetCollisionPrimitive() const { return x1c0_collisionPrimitive; }
zeus::CTransform CPhysicsActor::GetPrimitiveTransform() const
{
return zeus::CTransform::Translate(x34_transform.origin + x1e8_primitiveOffset);
}
float CPhysicsActor::GetStepUpHeight() const
{
return x23c_stepUpHeight;
}
float CPhysicsActor::GetStepUpHeight() const { return x23c_stepUpHeight; }
float CPhysicsActor::GetStepDownHeight() const
{
return x240_stepDownHeight;
}
float CPhysicsActor::GetStepDownHeight() const { return x240_stepDownHeight; }
float CPhysicsActor::GetWeight() const
{
return 24.525002f * xe8_mass;
}
float CPhysicsActor::GetWeight() const { return 24.525002f * xe8_mass; }
void CPhysicsActor::sub_8011A4C(float f)
{
x238_ = f;
}
void CPhysicsActor::sub_8011A4C(float f) { x238_ = f; }
float CPhysicsActor::sub_8011A4B8() const
{
return x238_;
}
float CPhysicsActor::sub_8011A4B8() const { return x238_; }
void CPhysicsActor::SetPrimitiveOffset(const zeus::CVector2f &offset)
{
x1e8_primitiveOffset = offset;
}
void CPhysicsActor::SetPrimitiveOffset(const zeus::CVector2f& offset) { x1e8_primitiveOffset = offset; }
zeus::CVector3f CPhysicsActor::GetPrimitiveOffset()
{
return x1e8_primitiveOffset;
}
zeus::CVector3f CPhysicsActor::GetPrimitiveOffset() { return x1e8_primitiveOffset; }
void CPhysicsActor::MoveCollisionPrimitive(const zeus::CVector3f &offset)
{
x1e8_primitiveOffset = offset;
}
void CPhysicsActor::MoveCollisionPrimitive(const zeus::CVector3f& offset) { x1e8_primitiveOffset = offset; }
void CPhysicsActor::SetBoundingBox(const zeus::CAABox &box)
void CPhysicsActor::SetBoundingBox(const zeus::CAABox& box)
{
x1a4_baseBoundingBox = box;
MoveCollisionPrimitive(zeus::CVector3f::skZero);
@ -129,14 +94,11 @@ zeus::CVector3f CPhysicsActor::CalculateNewVelocityWR_UsingImpulses() const
zeus::CAABox CPhysicsActor::GetBoundingBox() const
{
return { x1a4_baseBoundingBox.min + x1e8_primitiveOffset + x34_transform.origin,
x1a4_baseBoundingBox.max + x1e8_primitiveOffset + x34_transform.origin };
return {x1a4_baseBoundingBox.min + x1e8_primitiveOffset + x34_transform.origin,
x1a4_baseBoundingBox.max + x1e8_primitiveOffset + x34_transform.origin};
}
const zeus::CAABox& CPhysicsActor::GetBaseBoundingBox() const
{
return x1a4_baseBoundingBox;
}
const zeus::CAABox& CPhysicsActor::GetBaseBoundingBox() const { return x1a4_baseBoundingBox; }
void CPhysicsActor::AddMotionState(const CMotionState& mst)
{
@ -160,7 +122,7 @@ CMotionState CPhysicsActor::GetMotionState() const
return {x34_transform.origin, {x34_transform.buildMatrix3f()}, xfc_constantForce, x108_angularMomentum};
}
void CPhysicsActor::SetMotionState(const CMotionState &mst)
void CPhysicsActor::SetMotionState(const CMotionState& mst)
{
x34_transform = zeus::CTransform::Translate(x34_transform.origin) * zeus::CMatrix3f(mst.xc_orientation);
@ -210,31 +172,22 @@ void CPhysicsActor::SetAngularVelocityWR(const zeus::CAxisAngle& angVel)
x108_angularMomentum = xf0_inertiaTensor * x144_angularVelocity;
}
void CPhysicsActor::SetVelocityWR(const zeus::CVector3f &vel)
void CPhysicsActor::SetVelocityWR(const zeus::CVector3f& vel)
{
x138_velocity = vel;
xfc_constantForce = xe8_mass * x138_velocity;
}
void CPhysicsActor::SetVelocityOR(const zeus::CVector3f& vel)
{
SetVelocityWR(x34_transform.rotate(vel));
}
void CPhysicsActor::SetVelocityOR(const zeus::CVector3f& vel) { SetVelocityWR(x34_transform.rotate(vel)); }
zeus::CVector3f CPhysicsActor::GetTotalForcesWR() const
{
return x15c_force + x150_momentum;
}
zeus::CVector3f CPhysicsActor::GetTotalForcesWR() const { return x15c_force + x150_momentum; }
void CPhysicsActor::RotateInOneFrameOR(const zeus::CQuaternion &q, float d)
void CPhysicsActor::RotateInOneFrameOR(const zeus::CQuaternion& q, float d)
{
x198_ += GetRotateToORAngularMomentumWR(q, d);
}
void CPhysicsActor::MoveInOneFrameOR(const zeus::CVector3f &trans, float d)
{
x18c_ += GetMoveToORImpulseWR(trans, d);
}
void CPhysicsActor::MoveInOneFrameOR(const zeus::CVector3f& trans, float d) { x18c_ += GetMoveToORImpulseWR(trans, d); }
void CPhysicsActor::RotateToOR(const zeus::CQuaternion& q, float d)
{
@ -250,7 +203,7 @@ void CPhysicsActor::MoveToOR(const zeus::CVector3f& trans, float d)
void CPhysicsActor::sub_8011B098(const zeus::CVector3f& trans, float d)
{
x18c_ += xe8_mass * (trans - x34_transform.origin) * (1.f / d);
x18c_ += xe8_mass * (trans - x34_transform.origin) * (1.f / d);
}
void CPhysicsActor::MoveToWR(const zeus::CVector3f& trans, float d)
@ -263,11 +216,11 @@ zeus::CAxisAngle CPhysicsActor::GetRotateToORAngularMomentumWR(const zeus::CQuat
{
if (q.w > 0.99999976)
return zeus::CAxisAngle::skZero;
return (xf0_inertiaTensor * (((2.f * std::acos(q.w)) * (1.f / d)) *
x34_transform.rotate({q.x, q.y, q.z}).normalized()));
return (xf0_inertiaTensor *
(((2.f * std::acos(q.w)) * (1.f / d)) * x34_transform.rotate({q.x, q.y, q.z}).normalized()));
}
zeus::CVector3f CPhysicsActor::GetMoveToORImpulseWR(const zeus::CVector3f &trans, float d) const
zeus::CVector3f CPhysicsActor::GetMoveToORImpulseWR(const zeus::CVector3f& trans, float d) const
{
return (xe8_mass * x34_transform.rotate(trans)) * (1.f / d);
}
@ -302,19 +255,19 @@ void CPhysicsActor::ComputeDerivedQuantities()
bool CPhysicsActor::WillMove(const CStateManager&)
{
if (!zeus::close_enough(zeus::CVector3f::skZero, x138_velocity) ||
!zeus::close_enough(zeus::CVector3f::skZero, x168_impulse) ||
!zeus::close_enough(zeus::CVector3f::skZero, x174_torque) ||
!zeus::close_enough(zeus::CVector3f::skZero, x18c_) ||
!zeus::close_enough(zeus::CVector3f::skZero, x144_angularVelocity) ||
!zeus::close_enough(zeus::CVector3f::skZero, x180_angularImpulse) ||
!zeus::close_enough(zeus::CVector3f::skZero, x198_) ||
!zeus::close_enough(zeus::CVector3f::skZero, GetTotalForcesWR()))
!zeus::close_enough(zeus::CVector3f::skZero, x168_impulse) ||
!zeus::close_enough(zeus::CVector3f::skZero, x174_torque) ||
!zeus::close_enough(zeus::CVector3f::skZero, x18c_) ||
!zeus::close_enough(zeus::CVector3f::skZero, x144_angularVelocity) ||
!zeus::close_enough(zeus::CVector3f::skZero, x180_angularImpulse) ||
!zeus::close_enough(zeus::CVector3f::skZero, x198_) ||
!zeus::close_enough(zeus::CVector3f::skZero, GetTotalForcesWR()))
return true;
return false;
}
void CPhysicsActor::SetPhysicsState(const CPhysicsState &state)
void CPhysicsActor::SetPhysicsState(const CPhysicsState& state)
{
SetTranslation(state.GetTranslation());
x34_transform = zeus::CTransform::Translate(x34_transform.origin) * zeus::CMatrix3f(state.GetOrientation());
@ -323,7 +276,8 @@ void CPhysicsActor::SetPhysicsState(const CPhysicsState &state)
xe4_29_ = true;
xfc_constantForce = state.GetConstantForceWR();
x108_angularMomentum = state.GetAngularMomentumWR();;
x108_angularMomentum = state.GetAngularMomentumWR();
;
x150_momentum = state.GetMomentumWR();
x15c_force = state.GetForceWR();
x168_impulse = state.GetImpulseWR();
@ -334,8 +288,11 @@ void CPhysicsActor::SetPhysicsState(const CPhysicsState &state)
CPhysicsState CPhysicsActor::GetPhysicsState() const
{
return {x34_transform.origin, {x34_transform.buildMatrix3f()}, xfc_constantForce, x108_angularMomentum,
x150_momentum, x15c_force, x168_impulse, x174_torque, x180_angularImpulse};
return {x34_transform.origin, {x34_transform.buildMatrix3f()},
xfc_constantForce, x108_angularMomentum,
x150_momentum, x15c_force,
x168_impulse, x174_torque,
x180_angularImpulse};
}
CMotionState CPhysicsActor::PredictMotion_Internal(float dt) const
@ -358,19 +315,16 @@ CMotionState CPhysicsActor::PredictMotion(float dt) const
CMotionState CPhysicsActor::PredictLinearMotion(float dt) const
{
zeus::CVector3f velocity = CalculateNewVelocityWR_UsingImpulses();
return {velocity * dt, zeus::CNUQuaternion::skNoRotation,
((x15c_force + x150_momentum) * dt) + x168_impulse,
zeus::CAxisAngle::skZero};
return {velocity * dt, zeus::CNUQuaternion::skNoRotation, ((x15c_force + x150_momentum) * dt) + x168_impulse,
zeus::CAxisAngle::skZero};
}
CMotionState CPhysicsActor::PredictAngularMotion(float dt) const
{
const zeus::CVector3f v1 = xf4_inertiaTensorRecip * (x180_angularImpulse + x198_);
zeus::CNUQuaternion q = 0.5f * zeus::CNUQuaternion({0.f, x144_angularVelocity + v1});
return {zeus::CVector3f::skZero,
q * zeus::CNUQuaternion(x34_transform.buildMatrix3f()) * dt,
zeus::CVector3f::skZero,
(x174_torque * dt) + x180_angularImpulse};
return {zeus::CVector3f::skZero, q * zeus::CNUQuaternion(x34_transform.buildMatrix3f()) * dt,
zeus::CVector3f::skZero, (x174_torque * dt) + x180_angularImpulse};
}
void CPhysicsActor::ApplyForceOR(const zeus::CVector3f& force, const zeus::CAxisAngle& torque)
@ -379,28 +333,25 @@ void CPhysicsActor::ApplyForceOR(const zeus::CVector3f& force, const zeus::CAxis
x174_torque += x34_transform.rotate(torque);
}
void CPhysicsActor::ApplyForceWR(const zeus::CVector3f &force, const zeus::CAxisAngle& torque)
void CPhysicsActor::ApplyForceWR(const zeus::CVector3f& force, const zeus::CAxisAngle& torque)
{
x15c_force += force;
x174_torque += torque;
}
void CPhysicsActor::ApplyImpulseOR(const zeus::CVector3f &impulse, const zeus::CAxisAngle &angle)
void CPhysicsActor::ApplyImpulseOR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle)
{
x168_impulse += x34_transform.rotate(impulse);
x180_angularImpulse += x34_transform.rotate(angle);
}
void CPhysicsActor::ApplyImpulseWR(const zeus::CVector3f &impulse, const zeus::CAxisAngle& angleImp)
void CPhysicsActor::ApplyImpulseWR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angleImp)
{
x168_impulse += impulse;
x180_angularImpulse += angleImp;
}
void CPhysicsActor::ApplyTorqueWR(const zeus::CVector3f& torque)
{
x174_torque += torque;
}
void CPhysicsActor::ApplyTorqueWR(const zeus::CVector3f& torque) { x174_torque += torque; }
void CPhysicsActor::UseCollisionImpulses()
{
@ -413,74 +364,40 @@ void CPhysicsActor::UseCollisionImpulses()
}
CPhysicsState::CPhysicsState(const zeus::CVector3f& translation, const zeus::CQuaternion& orient,
const zeus::CVector3f& v2, const zeus::CAxisAngle& a1,
const zeus::CVector3f& v3, const zeus::CVector3f& v4,
const zeus::CVector3f& v5, const zeus::CAxisAngle& a2, const zeus::CAxisAngle& a3)
: x0_translation(translation)
, xc_orientation(orient)
, x1c_constantForce(v2)
, x28_angularMomentum(a1)
, x34_momentum(v3)
, x40_force(v4)
, x4c_impulse(v5)
, x58_torque(a2)
, x64_angularImpulse(a3)
const zeus::CVector3f& v2, const zeus::CAxisAngle& a1, const zeus::CVector3f& v3,
const zeus::CVector3f& v4, const zeus::CVector3f& v5, const zeus::CAxisAngle& a2,
const zeus::CAxisAngle& a3)
: x0_translation(translation)
, xc_orientation(orient)
, x1c_constantForce(v2)
, x28_angularMomentum(a1)
, x34_momentum(v3)
, x40_force(v4)
, x4c_impulse(v5)
, x58_torque(a2)
, x64_angularImpulse(a3)
{
}
void CPhysicsState::SetTranslation(const zeus::CVector3f& tr)
{
x0_translation = tr;
}
void CPhysicsState::SetTranslation(const zeus::CVector3f& tr) { x0_translation = tr; }
void CPhysicsState::SetOrientation(const zeus::CQuaternion& orient)
{
xc_orientation = orient;
}
void CPhysicsState::SetOrientation(const zeus::CQuaternion& orient) { xc_orientation = orient; }
const zeus::CQuaternion& CPhysicsState::GetOrientation() const
{
return xc_orientation;
}
const zeus::CQuaternion& CPhysicsState::GetOrientation() const { return xc_orientation; }
const zeus::CVector3f& CPhysicsState::GetTranslation() const
{
return x0_translation;
}
const zeus::CVector3f& CPhysicsState::GetTranslation() const { return x0_translation; }
const zeus::CVector3f& CPhysicsState::GetConstantForceWR() const
{
return x1c_constantForce;
}
const zeus::CVector3f& CPhysicsState::GetConstantForceWR() const { return x1c_constantForce; }
const zeus::CAxisAngle& CPhysicsState::GetAngularMomentumWR() const
{
return x28_angularMomentum;
}
const zeus::CAxisAngle& CPhysicsState::GetAngularMomentumWR() const { return x28_angularMomentum; }
const zeus::CVector3f& CPhysicsState::GetMomentumWR() const
{
return x34_momentum;
}
const zeus::CVector3f& CPhysicsState::GetMomentumWR() const { return x34_momentum; }
const zeus::CVector3f& CPhysicsState::GetForceWR() const
{
return x40_force;
}
const zeus::CVector3f& CPhysicsState::GetForceWR() const { return x40_force; }
const zeus::CVector3f& CPhysicsState::GetImpulseWR() const
{
return x4c_impulse;
}
const zeus::CVector3f& CPhysicsState::GetImpulseWR() const { return x4c_impulse; }
const zeus::CAxisAngle& CPhysicsState::GetTorque() const
{
return x58_torque;
}
const zeus::CAxisAngle& CPhysicsState::GetAngularImpulseWR() const
{
return x64_angularImpulse;
}
const zeus::CAxisAngle& CPhysicsState::GetTorque() const { return x58_torque; }
const zeus::CAxisAngle& CPhysicsState::GetAngularImpulseWR() const { return x64_angularImpulse; }
}

View File

@ -26,13 +26,11 @@ struct CMotionState
zeus::CNUQuaternion xc_orientation;
zeus::CVector3f x1c_velocity;
zeus::CAxisAngle x28_angularMomentum;
CMotionState(const zeus::CVector3f& origin, const zeus::CNUQuaternion& orientation,
const zeus::CVector3f& velocity, const zeus::CAxisAngle& angle)
: x0_translation(origin)
, xc_orientation(orientation)
, x1c_velocity(velocity)
, x28_angularMomentum(angle)
{}
CMotionState(const zeus::CVector3f& origin, const zeus::CNUQuaternion& orientation, const zeus::CVector3f& velocity,
const zeus::CAxisAngle& angle)
: x0_translation(origin), xc_orientation(orientation), x1c_velocity(velocity), x28_angularMomentum(angle)
{
}
};
class CPhysicsState
@ -46,10 +44,11 @@ class CPhysicsState
zeus::CVector3f x4c_impulse;
zeus::CAxisAngle x58_torque;
zeus::CAxisAngle x64_angularImpulse;
public:
CPhysicsState(const zeus::CVector3f&, const zeus::CQuaternion&, const zeus::CVector3f&,
const zeus::CAxisAngle&, const zeus::CVector3f&, const zeus::CVector3f&,
const zeus::CVector3f&, const zeus::CAxisAngle&, const zeus::CAxisAngle&);
CPhysicsState(const zeus::CVector3f&, const zeus::CQuaternion&, const zeus::CVector3f&, const zeus::CAxisAngle&,
const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CAxisAngle&,
const zeus::CAxisAngle&);
void SetOrientation(const zeus::CQuaternion&);
const zeus::CQuaternion& GetOrientation() const;
@ -71,8 +70,7 @@ protected:
float xec_massRecip;
float xf0_inertiaTensor;
float xf4_inertiaTensorRecip;
union
{
union {
struct
{
bool xf8_24_ : 1;
@ -108,11 +106,10 @@ protected:
float x248_collisionAccuracyModifier = 1.f;
u32 x24c_;
u32 x250_;
public:
CPhysicsActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
const zeus::CTransform&, CModelData&&, const CMaterialList&,
const zeus::CAABox&, const SMoverData&, const CActorParameters&,
float, float);
CPhysicsActor(TUniqueId, bool, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const CMaterialList&, const zeus::CAABox&, const SMoverData&, const CActorParameters&, float, float);
void Render(const CStateManager& mgr) const;
zeus::CVector3f GetOrbitPosition(const CStateManager&) const;
@ -149,7 +146,7 @@ public:
void MoveInOneFrameOR(const zeus::CVector3f& trans, float d);
void RotateToOR(const zeus::CQuaternion& q, float d);
void MoveToOR(const zeus::CVector3f& trans, float d);
void sub_8011B098(const zeus::CVector3f &v1, float d);
void sub_8011B098(const zeus::CVector3f& v1, float d);
void MoveToWR(const zeus::CVector3f& trans, float d);
zeus::CAxisAngle GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const;
zeus::CVector3f GetMoveToORImpulseWR(const zeus::CVector3f& trans, float d) const;
@ -165,7 +162,7 @@ public:
CMotionState PredictMotion(float dt) const;
CMotionState PredictLinearMotion(float dt) const;
CMotionState PredictAngularMotion(float dt) const;
void ApplyForceOR(const zeus::CVector3f& force, const zeus::CAxisAngle& angle);
void ApplyForceOR(const zeus::CVector3f& force, const zeus::CAxisAngle& angle);
void ApplyForceWR(const zeus::CVector3f& force, const zeus::CAxisAngle& angle);
void ApplyImpulseOR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle);
void ApplyImpulseWR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle);
@ -173,7 +170,6 @@ public:
void UseCollisionImpulses();
};
}
#endif // __URDE_CPHYSICSACTOR_HPP__

View File

@ -18,21 +18,16 @@ static CModelData MakePlayerAnimRes(ResId resId, const zeus::CVector3f& scale)
CPlayer::CPlayer(TUniqueId uid, const zeus::CTransform& xf, const zeus::CAABox& aabb, unsigned int resId,
const zeus::CVector3f& playerScale, float mass, float stepUp, float stepDown, float f4,
const CMaterialList& ml)
: CPhysicsActor(uid, true, "CPlayer", CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList),
xf, MakePlayerAnimRes(resId, playerScale), ml, aabb, SMoverData(mass), CActorParameters::None(),
stepUp, stepDown)
: CPhysicsActor(uid, true, "CPlayer", CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList), xf,
MakePlayerAnimRes(resId, playerScale), ml, aabb, SMoverData(mass), CActorParameters::None(), stepUp,
stepDown)
{
x768_morphball.reset(new CMorphBall(*this, f4));
}
bool CPlayer::IsTransparent() const
{
return x588_alpha < 1.f;
}
bool CPlayer::IsTransparent() const { return x588_alpha < 1.f; }
void CPlayer::Update(float, CStateManager& mgr)
{
}
void CPlayer::Update(float, CStateManager& mgr) {}
bool CPlayer::IsPlayerDeadEnough() const
{
@ -44,164 +39,79 @@ bool CPlayer::IsPlayerDeadEnough() const
return false;
}
void CPlayer::AsyncLoadSuit(CStateManager& mgr)
{
x490_gun->AsyncLoadSuit(mgr);
}
void CPlayer::AsyncLoadSuit(CStateManager& mgr) { x490_gun->AsyncLoadSuit(mgr); }
void CPlayer::LoadAnimationTokens()
{
}
void CPlayer::LoadAnimationTokens() {}
bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const
{
return false;
}
bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const { return false; }
const CDamageVulnerability* CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1,
const zeus::CVector3f& v2,
const CDamageVulnerability* CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1, const zeus::CVector3f& v2,
const CDamageInfo& info) const
{
return nullptr;
}
const CDamageVulnerability* CPlayer::GetDamageVulnerability() const
{
return nullptr;
}
const CDamageVulnerability* CPlayer::GetDamageVulnerability() const { return nullptr; }
zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float) const
{
return {};
}
zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float) const { return {}; }
zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float) const
{
return {};
}
zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float) const { return {}; }
void CPlayer::FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr)
{
}
void CPlayer::FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr) {}
zeus::CVector3f CPlayer::GetDamageLocationWR() const
{
return {};
}
zeus::CVector3f CPlayer::GetDamageLocationWR() const { return {}; }
float CPlayer::GetPrevDamageAmount() const
{
return 0.f;
}
float CPlayer::GetPrevDamageAmount() const { return 0.f; }
float CPlayer::GetDamageAmount() const
{
return 0.f;
}
float CPlayer::GetDamageAmount() const { return 0.f; }
bool CPlayer::WasDamaged() const
{
return false;
}
bool CPlayer::WasDamaged() const { return false; }
void CPlayer::TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr)
{
}
void CPlayer::TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr) {}
void CPlayer::Accept(IVisitor& visitor)
{
}
void CPlayer::Accept(IVisitor& visitor) {}
CHealthInfo* CPlayer::HealthInfo(CStateManager& mgr)
{
return nullptr;
}
CHealthInfo* CPlayer::HealthInfo(CStateManager& mgr) { return nullptr; }
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const
{
return false;
}
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const { return false; }
rstl::optional_object<zeus::CAABox> CPlayer::GetTouchBounds() const
{
return {};
}
rstl::optional_object<zeus::CAABox> CPlayer::GetTouchBounds() const { return {}; }
void CPlayer::Touch(CActor&, CStateManager& mgr)
{
}
void CPlayer::Touch(CActor&, CStateManager& mgr) {}
void CPlayer::UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float)
{
}
void CPlayer::UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float) {}
void CPlayer::ValidateScanning(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::ValidateScanning(const CFinalInput& input, CStateManager& mgr) {}
void CPlayer::SetScanningState(EPlayerScanState, CStateManager& mgr)
{
}
void CPlayer::SetScanningState(EPlayerScanState, CStateManager& mgr) {}
bool CPlayer::GetExplorationMode() const
{
return false;
}
bool CPlayer::GetExplorationMode() const { return false; }
bool CPlayer::GetCombatMode() const
{
return false;
}
bool CPlayer::GetCombatMode() const { return false; }
void CPlayer::RenderGun(CStateManager& mgr, const zeus::CVector3f&) const
{
}
void CPlayer::RenderGun(CStateManager& mgr, const zeus::CVector3f&) const {}
void CPlayer::Render(CStateManager& mgr) const
{
}
void CPlayer::Render(CStateManager& mgr) const {}
void CPlayer::RenderReflectedPlayer(CStateManager& mgr) const
{
}
void CPlayer::RenderReflectedPlayer(CStateManager& mgr) const {}
void CPlayer::PreRender(CStateManager& mgr, const zeus::CFrustum&)
{
}
void CPlayer::PreRender(CStateManager& mgr, const zeus::CFrustum&) {}
void CPlayer::CalculateRenderBounds()
{
}
void CPlayer::CalculateRenderBounds() {}
void CPlayer::AddToRenderer(const zeus::CFrustum&, CStateManager&)
{
}
void CPlayer::AddToRenderer(const zeus::CFrustum&, CStateManager&) {}
void CPlayer::ComputeFreeLook(const CFinalInput& input)
{
}
void CPlayer::ComputeFreeLook(const CFinalInput& input) {}
void CPlayer::UpdateFreeLook(float dt)
{
}
void CPlayer::UpdateFreeLook(float dt) {}
float CPlayer::GetMaximumPlayerPositiveVerticalVelocity(CStateManager&) const
{
return 0.f;
}
float CPlayer::GetMaximumPlayerPositiveVerticalVelocity(CStateManager&) const { return 0.f; }
void CPlayer::ProcessInput(const CFinalInput&, CStateManager&)
{
}
void CPlayer::ProcessInput(const CFinalInput&, CStateManager&) {}
bool CPlayer::GetFrozenState() const
{
return false;
}
bool CPlayer::GetFrozenState() const { return false; }
void CPlayer::Think(float, CStateManager&)
{
}
void CPlayer::Think(float, CStateManager&) {}
void CPlayer::PreThink(float dt, CStateManager& mgr)
{
@ -212,177 +122,92 @@ void CPlayer::PreThink(float dt, CStateManager& mgr)
xa04_ = dt;
}
void CPlayer::AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&)
{
}
void CPlayer::AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
void CPlayer::SetVisorSteam(float, float, float, u32, bool)
{
}
void CPlayer::SetVisorSteam(float, float, float, u32, bool) {}
void CPlayer::UpdateFootstepBounds(const CFinalInput& input, CStateManager&, float)
{
}
void CPlayer::UpdateFootstepBounds(const CFinalInput& input, CStateManager&, float) {}
u16 CPlayer::GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, int, u16)
{
return 0;
}
u16 CPlayer::GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, int, u16) { return 0; }
u16 CPlayer::SfxIdFromMaterial(const CMaterialList&, const u16*, u16)
{
return 0;
}
u16 CPlayer::SfxIdFromMaterial(const CMaterialList&, const u16*, u16) { return 0; }
void CPlayer::UpdateCrosshairsState(const CFinalInput&)
{
}
void CPlayer::UpdateCrosshairsState(const CFinalInput&) {}
void CPlayer::UpdateVisorTransition(float, CStateManager& mgr)
{
}
void CPlayer::UpdateVisorTransition(float, CStateManager& mgr) {}
void CPlayer::UpdateVisorState(const CFinalInput&, float, CStateManager& mgr)
{
}
void CPlayer::UpdateVisorState(const CFinalInput&, float, CStateManager& mgr) {}
void CPlayer::ForceGunOrientation(const zeus::CTransform&, CStateManager& mgr)
{
}
void CPlayer::ForceGunOrientation(const zeus::CTransform&, CStateManager& mgr) {}
void CPlayer::UpdateDebugCamera(CStateManager& mgr)
{
}
void CPlayer::UpdateDebugCamera(CStateManager& mgr) {}
CFirstPersonCamera& CPlayer::GetFirstPersonCamera(CStateManager& mgr)
{
return *mgr.GetCameraManager()->GetFirstPersonCamera();
}
void CPlayer::UpdateGunTransform(const zeus::CVector3f&, float, CStateManager& mgr, bool)
{
}
void CPlayer::UpdateGunTransform(const zeus::CVector3f&, float, CStateManager& mgr, bool) {}
void CPlayer::DrawGun(CStateManager& mgr)
{
}
void CPlayer::DrawGun(CStateManager& mgr) {}
void CPlayer::HolsterGun(CStateManager& mgr)
{
}
void CPlayer::HolsterGun(CStateManager& mgr) {}
bool CPlayer::GetMorphballTransitionState() const
{
return false;
}
bool CPlayer::GetMorphballTransitionState() const { return false; }
void CPlayer::UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float)
{
}
void CPlayer::UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float) {}
void CPlayer::ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float)
{
}
void CPlayer::ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float) {}
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr)
{
return false;
}
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr) { return false; }
void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr) {}
void CPlayer::ApplyGrappleJump(CStateManager& mgr)
{
}
void CPlayer::ApplyGrappleJump(CStateManager& mgr) {}
void CPlayer::BeginGrapple(zeus::CVector3f&, CStateManager& mgr)
{
}
void CPlayer::BeginGrapple(zeus::CVector3f&, CStateManager& mgr) {}
void CPlayer::BreakGrapple(CStateManager& mgr)
{
}
void CPlayer::BreakGrapple(CStateManager& mgr) {}
void CPlayer::PreventFallingCameraPitch()
{
}
void CPlayer::PreventFallingCameraPitch() {}
void CPlayer::OrbitCarcass(CStateManager&)
{
}
void CPlayer::OrbitCarcass(CStateManager&) {}
void CPlayer::OrbitPoint(EPlayerOrbitType, CStateManager& mgr)
{
}
void CPlayer::OrbitPoint(EPlayerOrbitType, CStateManager& mgr) {}
zeus::CVector3f CPlayer::GetHUDOrbitTargetPosition() const
zeus::CVector3f CPlayer::GetHUDOrbitTargetPosition() const { return {}; }
void CPlayer::SetOrbitState(EPlayerOrbitState, CStateManager& mgr) {}
void CPlayer::SetOrbitTargetId(TUniqueId) {}
void CPlayer::UpdateOrbitPosition(float, CStateManager& mgr) {}
void CPlayer::UpdateOrbitZPosition() {}
void CPlayer::UpdateOrbitFixedPosition() {}
void CPlayer::SetOrbitPosition(float, CStateManager& mgr) {}
void CPlayer::UpdateAimTarget(CStateManager& mgr) {}
void CPlayer::UpdateAimTargetTimer(float) {}
bool CPlayer::ValidateAimTargetId(TUniqueId, CStateManager& mgr) { return false; }
bool CPlayer::ValidateObjectForMode(TUniqueId, CStateManager& mgr) const { return false; }
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr) { return {}; }
TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const std::vector<TUniqueId>&, EPlayerZoneInfo, EPlayerZoneType,
CStateManager& mgr) const
{
return {};
}
void CPlayer::SetOrbitState(EPlayerOrbitState, CStateManager& mgr)
{
}
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) { return {}; }
void CPlayer::SetOrbitTargetId(TUniqueId)
{
}
void CPlayer::UpdateOrbitPosition(float, CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitZPosition()
{
}
void CPlayer::UpdateOrbitFixedPosition()
{
}
void CPlayer::SetOrbitPosition(float, CStateManager& mgr)
{
}
void CPlayer::UpdateAimTarget(CStateManager& mgr)
{
}
void CPlayer::UpdateAimTargetTimer(float)
{
}
bool CPlayer::ValidateAimTargetId(TUniqueId, CStateManager& mgr)
{
return false;
}
bool CPlayer::ValidateObjectForMode(TUniqueId, CStateManager& mgr) const
{
return false;
}
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr)
{
return {};
}
TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr) const
{
return {};
}
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr)
{
return {};
}
void CPlayer::UpdateOrbitableObjects(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitableObjects(CStateManager& mgr) {}
TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const
{
@ -394,181 +219,81 @@ void CPlayer::FindOrbitableObjects(const std::vector<TUniqueId>&, std::vector<TU
{
}
bool CPlayer::WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const
{
return false;
}
bool CPlayer::WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const { return false; }
bool CPlayer::WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const
{
return false;
}
bool CPlayer::WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const { return false; }
void CPlayer::CheckOrbitDisableSourceList(CStateManager& mgr)
{
}
void CPlayer::CheckOrbitDisableSourceList(CStateManager& mgr) {}
void CPlayer::CheckOrbitDisableSourceList() const
{
}
void CPlayer::CheckOrbitDisableSourceList() const {}
void CPlayer::RemoveOrbitDisableSource(TUniqueId)
{
}
void CPlayer::RemoveOrbitDisableSource(TUniqueId) {}
void CPlayer::AddOrbitDisableSource(CStateManager& mgr, TUniqueId)
{
}
void CPlayer::AddOrbitDisableSource(CStateManager& mgr, TUniqueId) {}
void CPlayer::UpdateOrbitPreventionTimer(float)
{
}
void CPlayer::UpdateOrbitPreventionTimer(float) {}
void CPlayer::UpdateOrbitModeTimer(float)
{
}
void CPlayer::UpdateOrbitModeTimer(float) {}
void CPlayer::UpdateOrbitZone(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitZone(CStateManager& mgr) {}
void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) {}
void CPlayer::UpdateOrbitSelection(const CFinalInput& input, CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitSelection(const CFinalInput& input, CStateManager& mgr) {}
void CPlayer::UpdateOrbitOrientation(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitOrientation(CStateManager& mgr) {}
void CPlayer::UpdateOrbitTarget(CStateManager& mgr)
{
}
void CPlayer::UpdateOrbitTarget(CStateManager& mgr) {}
float CPlayer::GetOrbitMaxLockDistance(CStateManager& mgr) const
{
return 0.f;
}
float CPlayer::GetOrbitMaxLockDistance(CStateManager& mgr) const { return 0.f; }
float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const
{
return 0.f;
}
float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const { return 0.f; }
bool CPlayer::ValidateOrbitTargetId(TUniqueId, CStateManager& mgr) const
{
return false;
}
bool CPlayer::ValidateOrbitTargetId(TUniqueId, CStateManager& mgr) const { return false; }
bool CPlayer::ValidateCurrentOrbitTargetId(CStateManager& mgr)
{
return false;
}
bool CPlayer::ValidateCurrentOrbitTargetId(CStateManager& mgr) { return false; }
bool CPlayer::ValidateOrbitTargetIdAndPointer(TUniqueId, CStateManager& mgr) const
{
return false;
}
bool CPlayer::ValidateOrbitTargetIdAndPointer(TUniqueId, CStateManager& mgr) const { return false; }
zeus::CVector3f CPlayer::GetBallPosition() const
{
return {};
}
zeus::CVector3f CPlayer::GetBallPosition() const { return {}; }
zeus::CVector3f CPlayer::GetEyePosition() const
{
return {};
}
zeus::CVector3f CPlayer::GetEyePosition() const { return {}; }
float CPlayer::GetEyeHeight() const
{
return 0.f;
}
float CPlayer::GetEyeHeight() const { return 0.f; }
float CPlayer::GetStepUpHeight() const
{
return 0.f;
}
float CPlayer::GetStepUpHeight() const { return 0.f; }
float CPlayer::GetStepDownHeight() const
{
return 0.f;
}
float CPlayer::GetStepDownHeight() const { return 0.f; }
void CPlayer::Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool)
{
}
void CPlayer::Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool) {}
zeus::CTransform CPlayer::CreateTransformFromMovementDirection() const
{
return {};
}
zeus::CTransform CPlayer::CreateTransformFromMovementDirection() const { return {}; }
const CCollisionPrimitive& CPlayer::GetCollisionPrimitive() const
{
return CPhysicsActor::GetCollisionPrimitive();
}
const CCollisionPrimitive& CPlayer::GetCollisionPrimitive() const { return CPhysicsActor::GetCollisionPrimitive(); }
zeus::CTransform CPlayer::GetPrimitiveTransform() const
{
return {};
}
zeus::CTransform CPlayer::GetPrimitiveTransform() const { return {}; }
bool CPlayer::CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager& mgr)
{
return false;
}
bool CPlayer::CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager& mgr) { return false; }
float CPlayer::GetActualFirstPersonMaxVelocity() const
{
return 0.f;
}
float CPlayer::GetActualFirstPersonMaxVelocity() const { return 0.f; }
void CPlayer::SetMoveState(EPlayerMovementState, CStateManager& mgr)
{
}
void CPlayer::SetMoveState(EPlayerMovementState, CStateManager& mgr) {}
float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr)
{
return 0.f;
}
float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr) { return 0.f; }
float CPlayer::TurnInput(const CFinalInput& input) const
{
return 0.f;
}
float CPlayer::TurnInput(const CFinalInput& input) const { return 0.f; }
float CPlayer::StrafeInput(const CFinalInput& input) const
{
return 0.f;
}
float CPlayer::StrafeInput(const CFinalInput& input) const { return 0.f; }
float CPlayer::ForwardInput(const CFinalInput& input, float) const
{
return 0.f;
}
float CPlayer::ForwardInput(const CFinalInput& input, float) const { return 0.f; }
void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, float)
{
}
void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, float) {}
float CPlayer::GetWeight() const
{
return 0.f;
}
float CPlayer::GetWeight() const { return 0.f; }
float CPlayer::GetDampedClampedVelocityWR() const
{
return 0.f;
}
float CPlayer::GetDampedClampedVelocityWR() const { return 0.f; }
void CPlayer::Touch()
{
}
void CPlayer::Touch() {}
void CPlayer::CVisorSteam::SetSteam(float a, float b, float c, ResId d, bool e)
{
@ -582,10 +307,7 @@ void CPlayer::CVisorSteam::SetSteam(float a, float b, float c, ResId d, bool e)
x28_ = e;
}
ResId CPlayer::CVisorSteam::GetTextureId() const
{
return xc_;
}
ResId CPlayer::CVisorSteam::GetTextureId() const { return xc_; }
void CPlayer::CVisorSteam::Update(float dt)
{

View File

@ -24,6 +24,7 @@ class CPlayer : public CPhysicsActor
friend class CStateManager;
friend class CFirstPersonCamera;
friend class CPlayerCameraBob;
public:
enum class EPlayerScanState
{
@ -45,7 +46,6 @@ public:
};
private:
struct CVisorSteam
{
float x0_;
@ -59,8 +59,9 @@ private:
float x20_ = 0.f;
float x24_ = 0.f;
bool x28_ = false;
public:
CVisorSteam(float a, float b, float c, ResId tex) : x0_(a), x4_(b), x8_(c), xc_(tex){}
CVisorSteam(float a, float b, float c, ResId tex) : x0_(a), x4_(b), x8_(c), xc_(tex) {}
ResId GetTextureId() const;
void SetSteam(float a, float b, float c, ResId d, bool e);
void Update(float dt);
@ -179,9 +180,10 @@ private:
float xa04_;
ResId xa08_steamTextureId;
ResId xa0c_;
public:
CPlayer(TUniqueId, const zeus::CTransform&, const zeus::CAABox&, unsigned int,
const zeus::CVector3f&, float, float, float, float, const CMaterialList&);
CPlayer(TUniqueId, const zeus::CTransform&, const zeus::CAABox&, unsigned int, const zeus::CVector3f&, float, float,
float, float, const CMaterialList&);
bool IsTransparent() const;
void Update(float, CStateManager& mgr);
@ -189,9 +191,8 @@ public:
void AsyncLoadSuit(CStateManager& mgr);
void LoadAnimationTokens();
virtual bool CanRenderUnsorted(CStateManager& mgr) const;
virtual const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f& v1,
const zeus::CVector3f& v2,
const CDamageInfo& info) const;
virtual const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f& v1, const zeus::CVector3f& v2,
const CDamageInfo& info) const;
virtual const CDamageVulnerability* GetDamageVulnerability() const;
virtual zeus::CVector3f GetHomingPosition(CStateManager& mgr, float) const;
zeus::CVector3f GetAimPosition(CStateManager& mgr, float) const;
@ -261,13 +262,13 @@ public:
bool ValidateAimTargetId(TUniqueId, CStateManager& mgr);
bool ValidateObjectForMode(TUniqueId, CStateManager& mgr) const;
TUniqueId FindAimTargetId(CStateManager& mgr);
TUniqueId CheckEnemiesAgainstOrbitZone(const std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr) const;
TUniqueId CheckEnemiesAgainstOrbitZone(const std::vector<TUniqueId>&, EPlayerZoneInfo, EPlayerZoneType,
CStateManager& mgr) const;
TUniqueId FindOrbitTargetId(CStateManager& mgr);
void UpdateOrbitableObjects(CStateManager& mgr);
TUniqueId FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const;
void FindOrbitableObjects(const std::vector<TUniqueId>&, std::vector<TUniqueId>&, EPlayerZoneInfo,
EPlayerZoneType, CStateManager& mgr, bool) const;
void FindOrbitableObjects(const std::vector<TUniqueId>&, std::vector<TUniqueId>&, EPlayerZoneInfo, EPlayerZoneType,
CStateManager& mgr, bool) const;
bool WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const;
bool WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const;
void CheckOrbitDisableSourceList(CStateManager& mgr);
@ -309,7 +310,6 @@ public:
void Touch();
const std::unique_ptr<CPlayerCameraBob>& GetCameraBob() const { return x76c_cameraBob; }
};
}
#endif // __URDE_CPLAYER_HPP__

View File

@ -75,6 +75,7 @@ private:
zeus::CTransform xd0_viewWanderXf;
float x100_ = FLT_EPSILON;
float x104_ = 0.f;
public:
CPlayerCameraBob(ECameraBobType type, const zeus::CVector2f& vec, float);
@ -90,7 +91,7 @@ public:
void SetState(ECameraBobState, CStateManager&);
void InitViewWander(CStateManager&);
void UpdateViewWander(float, CStateManager&);
void Update(float, CStateManager &);
void Update(float, CStateManager&);
zeus::CVector3f CalculateRandomViewWanderPosition(CStateManager&);
float CalculateRandomViewWanderPitch(CStateManager&);
void CalculateMovingTranslation(float& x, float& y) const;
@ -98,7 +99,6 @@ public:
zeus::CTransform CalculateCameraBobTransformation() const;
static void ReadTweaks(CInputStream& in);
};
}
#endif // __URDE_CPLAYERCAMERABOB_HPP__

View File

@ -4,15 +4,9 @@
namespace urde
{
CPlayerEnergyDrain::CPlayerEnergyDrain(u32 capacity)
{
x0_sources.reserve(capacity);
}
CPlayerEnergyDrain::CPlayerEnergyDrain(u32 capacity) { x0_sources.reserve(capacity); }
void CPlayerEnergyDrain::AddEnergyDrainSource(TUniqueId id, float intensity)
{
x0_sources.emplace_back(id, intensity);
}
void CPlayerEnergyDrain::AddEnergyDrainSource(TUniqueId id, float intensity) { x0_sources.emplace_back(id, intensity); }
void CPlayerEnergyDrain::RemoveEnergyDrainSource(TUniqueId id)
{
@ -31,10 +25,7 @@ float CPlayerEnergyDrain::GetEnergyDrainIntensity() const
return intensity;
}
float CPlayerEnergyDrain::GetEnergyDrainTime() const
{
return x10_energyDrainTime;
}
float CPlayerEnergyDrain::GetEnergyDrainTime() const { return x10_energyDrainTime; }
void CPlayerEnergyDrain::ProcessEnergyDrain(const CStateManager& mgr, float dt)
{
@ -51,5 +42,4 @@ void CPlayerEnergyDrain::ProcessEnergyDrain(const CStateManager& mgr, float dt)
else
x10_energyDrainTime += dt;
}
}

View File

@ -11,6 +11,7 @@ class CPlayerEnergyDrain
{
std::vector<CEnergyDrainSource> x0_sources;
float x10_energyDrainTime;
public:
CPlayerEnergyDrain(u32);
const std::vector<CEnergyDrainSource>& GetEnergyDrainSources() const;

View File

@ -1,7 +1,5 @@
#include "CRipple.hpp"
namespace urde
{
CRipple::CRipple(TUniqueId, const zeus::CVector3f&, float)
{
}
CRipple::CRipple(TUniqueId, const zeus::CVector3f&, float) {}
}

View File

@ -17,6 +17,7 @@ private:
float x1c_ = 3.f;
float x20_ = 0.25f;
float x24_ = 0.00098039221f;
public:
CRipple(TUniqueId, const zeus::CVector3f&, float);

View File

@ -9,11 +9,11 @@ namespace urde
class CScannableParameters
{
ResId x0_scanId = -1;
public:
CScannableParameters() = default;
CScannableParameters(ResId id) : x0_scanId(id) {}
};
}
#endif // __URDE_CSCANNABLEPARAMETERS_HPP__

View File

@ -3,12 +3,11 @@
namespace urde
{
CScriptActor::CScriptActor(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& aabb, float a, float,
const CMaterialList& matList, const CHealthInfo&, const CDamageVulnerability&,
const CActorParameters& actParms, bool, bool active, u32, float, bool, bool, bool, bool)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), matList, aabb, SMoverData(a), actParms, 0.3f, 0.1f)
CScriptActor::CScriptActor(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const zeus::CAABox& aabb, float a, float, const CMaterialList& matList,
const CHealthInfo&, const CDamageVulnerability&, const CActorParameters& actParms, bool,
bool active, u32, float, bool, bool, bool, bool)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), matList, aabb, SMoverData(a), actParms, 0.3f, 0.1f)
{
}
}

View File

@ -9,12 +9,10 @@ namespace urde
class CScriptActor : public CPhysicsActor
{
public:
CScriptActor(TUniqueId, const std::string&, const CEntityInfo&,
const zeus::CTransform&, CModelData&&, const zeus::CAABox& aabb, float, float,
const CMaterialList& matList, const CHealthInfo&, const CDamageVulnerability&,
const CActorParameters&, bool, bool, u32, float, bool, bool, bool, bool);
CScriptActor(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const zeus::CAABox& aabb, float, float, const CMaterialList& matList, const CHealthInfo&,
const CDamageVulnerability&, const CActorParameters&, bool, bool, u32, float, bool, bool, bool, bool);
};
}
#endif // __URDE_CSCRIPTACTOR_HPP__

View File

@ -4,29 +4,25 @@ namespace urde
{
CScriptActorKeyframe::CScriptActorKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info, s32 animId,
bool b1, float f1, bool b2, u32 w2, bool active, float totalPlayback)
: CEntity(uid, info, active, name),
x34_animationId(animId),
x38_(f1),
x3c_(totalPlayback),
x40_(f1),
x44_24_(b1),
x44_25_(b2),
x44_26_(w2)
: CEntity(uid, info, active, name)
, x34_animationId(animId)
, x38_(f1)
, x3c_(totalPlayback)
, x40_(f1)
, x44_24_(b1)
, x44_25_(b2)
, x44_26_(w2)
{
}
void CScriptActorKeyframe::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
{
}
void CScriptActorKeyframe::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) {}
void CScriptActorKeyframe::Think(float dt, CStateManager& mgr)
{
if (x44_25_) {}
if (x44_25_)
{
}
}
void CScriptActorKeyframe::UpdateEntity(TUniqueId, CStateManager&)
{
}
void CScriptActorKeyframe::UpdateEntity(TUniqueId, CStateManager&) {}
}

View File

@ -12,8 +12,7 @@ private:
float x38_;
float x3c_;
float x40_;
union
{
union {
struct
{
bool x44_24_ : 1;
@ -25,12 +24,13 @@ private:
};
u8 _dummy = 0;
};
public:
CScriptActorKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info, s32 w1, bool b1, float f1,
bool b2, u32 w2, bool active, float f2);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr);
void Think(float, CStateManager &);
void Think(float, CStateManager&);
void UpdateEntity(TUniqueId, CStateManager&);
};
}

View File

@ -4,7 +4,7 @@ namespace urde
{
CScriptActorRotate::CScriptActorRotate(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CVector3f& rotation, float scale, bool, bool, bool active)
: CEntity(uid, info, active, name)
: CEntity(uid, info, active, name)
{
}
}

View File

@ -13,8 +13,7 @@ class CScriptActorRotate : public CEntity
float x44_;
std::map<TUniqueId, zeus::CTransform> x48_actors;
union
{
union {
struct
{
bool x58_24_ : 1;
@ -24,8 +23,10 @@ class CScriptActorRotate : public CEntity
};
u32 dummy = 0;
};
public:
CScriptActorRotate(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CVector3f&, float, bool, bool, bool);
CScriptActorRotate(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CVector3f&, float, bool, bool,
bool);
};
}

View File

@ -7,9 +7,9 @@ namespace urde
{
CScriptAiJumpPoint::CScriptAiJumpPoint(TUniqueId uid, const std::string& name, const CEntityInfo& info,
zeus::CTransform& xf, bool active, float f1)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero),
CActorParameters::None(), kInvalidUniqueId),
xe8_(f1)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero),
CActorParameters::None(), kInvalidUniqueId)
, xe8_(f1)
{
xec_.emplace(xf.origin, xf.origin);
}
@ -34,7 +34,8 @@ void CScriptAiJumpPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId oth
if (conn.x0_state != EScriptObjectState::Arrived || conn.x4_msg != EScriptObjectMessage::Next)
continue;
const CScriptWaypoint* wpnt = static_cast<const CScriptWaypoint*>(mgr.GetObjectById(mgr.GetIdForScript(conn.x8_objId)));
const CScriptWaypoint* wpnt =
static_cast<const CScriptWaypoint*>(mgr.GetObjectById(mgr.GetIdForScript(conn.x8_objId)));
if (wpnt)
{
x10c_currentWaypoint = wpnt->GetUniqueId();
@ -45,14 +46,12 @@ void CScriptAiJumpPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId oth
}
}
rstl::optional_object<zeus::CAABox> CScriptAiJumpPoint::GetTouchBounds() const
{
return xec_;
}
rstl::optional_object<zeus::CAABox> CScriptAiJumpPoint::GetTouchBounds() const { return xec_; }
bool CScriptAiJumpPoint::GetInUse(TUniqueId uid) const
{
if (x108_24 || x110_timeRemaining > 0.f || x10a_occupant != kInvalidUniqueId || uid != kInvalidUniqueId || uid != x10a_occupant)
if (x108_24 || x110_timeRemaining > 0.f || x10a_occupant != kInvalidUniqueId || uid != kInvalidUniqueId ||
uid != x10a_occupant)
return true;
return false;

View File

@ -10,8 +10,7 @@ class CScriptAiJumpPoint : public CActor
private:
float xe8_;
std::experimental::optional<zeus::CAABox> xec_;
union
{
union {
struct
{
bool x108_24 : 1;
@ -22,14 +21,14 @@ private:
TUniqueId x10c_currentWaypoint = kInvalidUniqueId;
TUniqueId x10e_nextWaypoint = kInvalidUniqueId;
float x110_timeRemaining = 0.f;
public:
CScriptAiJumpPoint(TUniqueId, const std::string&, const CEntityInfo&, zeus::CTransform&, bool, float);
void Think(float, CStateManager&);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &);
void AddToRenderer(const zeus::CFrustum &, const CStateManager &) const {}
void Render(const CStateManager &) const {}
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const {}
void Render(const CStateManager&) const {}
rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
bool GetInUse(TUniqueId uid) const;
};

View File

@ -9,15 +9,15 @@ namespace urde
CScriptAreaAttributes::CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType,
float envFxDensity, float thermalHeat, float xrayFogDistance,
float worldLightingLevel, ResId skybox, EPhazonType phazonType)
: CEntity(uid, info, true, std::string()),
x34_24_showSkybox(showSkybox),
x38_envFx(fxType),
x3c_envFxDensity(envFxDensity),
x40_thermalHeat(thermalHeat),
x44_xrayFogDistance(xrayFogDistance),
x48_worldLightingLevel(worldLightingLevel),
x4c_skybox(skybox),
x50_phazon(phazonType)
: CEntity(uid, info, true, std::string())
, x34_24_showSkybox(showSkybox)
, x38_envFx(fxType)
, x3c_envFxDensity(envFxDensity)
, x40_thermalHeat(thermalHeat)
, x44_xrayFogDistance(xrayFogDistance)
, x48_worldLightingLevel(worldLightingLevel)
, x4c_skybox(skybox)
, x50_phazon(phazonType)
{
}
@ -44,24 +44,11 @@ void CScriptAreaAttributes::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
}
}
bool CScriptAreaAttributes::GetNeedsSky() const
{
return x34_24_showSkybox;
}
bool CScriptAreaAttributes::GetNeedsSky() const { return x34_24_showSkybox; }
bool CScriptAreaAttributes::GetNeedsEnvFx() const
{
return x38_envFx != EEnvFxType::None;
}
bool CScriptAreaAttributes::GetNeedsEnvFx() const { return x38_envFx != EEnvFxType::None; }
float CScriptAreaAttributes::GetThermalHeat() const
{
return x40_thermalHeat;
}
float CScriptAreaAttributes::GetWorldLightingLevel() const
{
return x48_worldLightingLevel;
}
float CScriptAreaAttributes::GetThermalHeat() const { return x40_thermalHeat; }
float CScriptAreaAttributes::GetWorldLightingLevel() const { return x48_worldLightingLevel; }
}

View File

@ -16,10 +16,11 @@ class CScriptAreaAttributes : public CEntity
float x48_worldLightingLevel;
ResId x4c_skybox;
EPhazonType x50_phazon;
public:
CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType,
float envFxDensity, float thermalHeat, float xrayFogDistance,
float worldLightingLevel, ResId skybox, EPhazonType phazonType);
float envFxDensity, float thermalHeat, float xrayFogDistance, float worldLightingLevel,
ResId skybox, EPhazonType phazonType);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr);

View File

@ -4,7 +4,7 @@ namespace urde
{
CScriptCameraBlurKeyframe::CScriptCameraBlurKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info,
u32, float, u32, float, float, bool active)
: CEntity(uid, info, active, name)
: CEntity(uid, info, active, name)
{
}
}

View File

@ -2,10 +2,10 @@
namespace urde
{
CScriptCameraFilterKeyframe::CScriptCameraFilterKeyframe(TUniqueId uid, const std::string &name, const CEntityInfo& info,
u32, u32, u32, u32, const zeus::CColor&, float, float,
u32, bool active)
: CEntity(uid, info, active, name)
{}
CScriptCameraFilterKeyframe::CScriptCameraFilterKeyframe(TUniqueId uid, const std::string& name,
const CEntityInfo& info, u32, u32, u32, u32,
const zeus::CColor&, float, float, u32, bool active)
: CEntity(uid, info, active, name)
{
}
}

View File

@ -16,9 +16,10 @@ class CScriptCameraFilterKeyframe : public CEntity
float x48_;
float x4c_;
u32 x50_;
public:
CScriptCameraFilterKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, u32, u32, u32, const zeus::CColor&,
float, float, u32, bool);
CScriptCameraFilterKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, u32, u32, u32,
const zeus::CColor&, float, float, u32, bool);
};
}

View File

@ -7,11 +7,10 @@ namespace urde
CScriptCameraHint::CScriptCameraHint(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, bool active, u32, u32, u32, float, float, float,
const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&,
float, float, float, float, float, float, float, float, float, float)
const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, float,
float, float, float, float, float, float, float, float, float)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero),
CActorParameters::None(), kInvalidUniqueId)
{
}
}

View File

@ -9,12 +9,10 @@ namespace urde
class CScriptCameraHint : public CActor
{
public:
CScriptCameraHint(TUniqueId, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, bool, u32, u32, u32, float, float, float,
const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&,
float, float, float, float, float, float, float, float, float, float);
CScriptCameraHint(TUniqueId, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf, bool,
u32, u32, u32, float, float, float, const zeus::CVector3f&, const zeus::CVector3f&,
const zeus::CVector3f&, float, float, float, float, float, float, float, float, float, float);
};
}
#endif // __URDE_CSCRIPTCAMERAHINT_HPP__

View File

@ -4,13 +4,15 @@
namespace urde
{
CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CVector3f& scale, const zeus::CTransform& xf, bool b2, bool b3)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour), CActorParameters::None(), kInvalidUniqueId)
, xe8_obb(xf, scale)
, x124_scale(scale)
, x130_24_(b2)
, x130_25_(b3)
CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, const std::string& name,
const CEntityInfo& info, const zeus::CVector3f& scale,
const zeus::CTransform& xf, bool b2, bool b3)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour),
CActorParameters::None(), kInvalidUniqueId)
, xe8_obb(xf, scale)
, x124_scale(scale)
, x130_24_(b2)
, x130_25_(b3)
{
}
}

View File

@ -10,8 +10,7 @@ class CScriptCameraHintTrigger : public CActor
{
zeus::COBBox xe8_obb;
zeus::CVector3f x124_scale;
union
{
union {
struct
{
bool x130_24_ : 1;
@ -21,8 +20,10 @@ class CScriptCameraHintTrigger : public CActor
};
u8 _dummy = 0;
};
public:
CScriptCameraHintTrigger(TUniqueId, bool, const std::string& name, const CEntityInfo&, const zeus::CVector3f&, const zeus::CTransform&, bool, bool);
CScriptCameraHintTrigger(TUniqueId, bool, const std::string& name, const CEntityInfo&, const zeus::CVector3f&,
const zeus::CTransform&, bool, bool);
};
}
#endif // __URDE_CSCRIPTCAMERAHINTTRIGGER_HPP__

View File

@ -0,0 +1,66 @@
#include "CScriptCameraPitchVolume.hpp"
#include "CActorParameters.hpp"
#include "CStateManager.hpp"
#include "CPlayer.hpp"
#include "Camera/CCameraManager.hpp"
#include "Camera/CFirstPersonCamera.hpp"
namespace urde
{
const zeus::CVector3f CScriptCameraPitchVolume::skScaleFactor = {0.5f};
CScriptCameraPitchVolume::CScriptCameraPitchVolume(TUniqueId uid, bool active, const std::string& name,
const CEntityInfo& info, const zeus::CVector3f& scale,
const zeus::CTransform& xf, const zeus::CRelAngle& r1,
const zeus::CRelAngle& r2, float maxInterpDistance)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour),
CActorParameters::None(), kInvalidUniqueId)
, xe8_obbox(xf, scale * skScaleFactor)
, x124_(r1)
, x128_(r2)
, x12c_scale(scale * skScaleFactor)
, x138_maxInterpDistance(maxInterpDistance)
{
}
void CScriptCameraPitchVolume::Think(float, CStateManager&)
{
if (!x30_24_active)
return;
}
rstl::optional_object<zeus::CAABox> CScriptCameraPitchVolume::GetTouchBounds() const
{
return {xe8_obbox.calculateAABox(zeus::CTransform::Identity())};
}
void CScriptCameraPitchVolume::Touch(CActor& act, CStateManager& mgr)
{
CPlayer* pl = dynamic_cast<CPlayer*>(&act);
if (!pl)
return;
auto plBox = pl->GetTouchBounds();
if (!plBox)
return;
zeus::COBBox plOBox = zeus::COBBox::FromAABox(plBox.value(), zeus::CTransform::Identity());
xe8_obbox;
}
const zeus::CVector3f& CScriptCameraPitchVolume::GetScale() const { return x12c_scale; }
float CScriptCameraPitchVolume::GetMaxInterpolationDistance() const { return x138_maxInterpDistance; }
void CScriptCameraPitchVolume::Entered(urde::CStateManager& mgr)
{
x13c_25_occupied = true;
mgr.GetCameraManager()->GetFirstPersonCamera()->SetScriptPitchId(GetUniqueId());
}
void CScriptCameraPitchVolume::Exited(CStateManager& mgr)
{
x13c_25_occupied = false;
mgr.GetCameraManager()->GetFirstPersonCamera()->SetScriptPitchId(kInvalidUniqueId);
}
}

View File

@ -0,0 +1,43 @@
#ifndef __URDE_CSCRIPTCAMERAPITCHVOLUME_HPP__
#define __URDE_CSCRIPTCAMERAPITCHVOLUME_HPP__
#include "CActor.hpp"
#include "zeus/CRelAngle.hpp"
#include "zeus/COBBox.hpp"
namespace urde
{
class CScriptCameraPitchVolume : public CActor
{
static const zeus::CVector3f skScaleFactor;
zeus::COBBox xe8_obbox;
zeus::CRelAngle x124_;
zeus::CRelAngle x128_;
zeus::CVector3f x12c_scale;
float x138_maxInterpDistance;
union {
struct
{
bool x13c_24_entered : 1;
bool x13c_25_occupied : 1;
};
u32 _dummy = 0;
};
public:
CScriptCameraPitchVolume(TUniqueId, bool, const std::string&, const CEntityInfo&, const zeus::CVector3f&,
const zeus::CTransform&, const zeus::CRelAngle&, const zeus::CRelAngle&, float);
void Think(float, CStateManager&);
rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
void Touch(CActor&, CStateManager&);
const zeus::CRelAngle& GetUpPitch() const;
const zeus::CRelAngle& GetDownPitch() const;
const zeus::CVector3f& GetScale() const;
float GetMaxInterpolationDistance() const;
void Entered(CStateManager&);
void Exited(CStateManager&);
};
}
#endif // __URDE_CSCRIPTCAMERAPITCHVOLUME_HPP__

View File

@ -1,16 +1,62 @@
#include "CScriptSpecialFunction.hpp"
#include "Character/CModelData.hpp"
#include "CActorParameters.hpp"
#include "Audio/CSfxManager.hpp"
namespace urde
{
CScriptSpecialFunction::CScriptSpecialFunction(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, ESpecialFunction, const std::string&, float,
float, float, float, const zeus::CVector3f&, const zeus::CColor&,
bool active, const CDamageInfo&, u32, u32, u32, u16, u16, u16)
const zeus::CTransform& xf, ESpecialFunction func,
const std::string& lcName, float radius, float f2, float f3, float f4,
const zeus::CVector3f& vec, const zeus::CColor& col, bool active,
const CDamageInfo& dInfo, ResId aId1, ResId aId2, ResId aId3, s16 sId1,
s16 sId2, s16 sId3)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(), CActorParameters::None(),
kInvalidUniqueId)
, xe8_function(func)
, xec_locatorName(lcName)
, xfc_radius(radius)
, x100_(f2)
, x104_(f3)
, x108_(f4)
, x10c_(vec)
, x118_(col)
, x11c_damageInfo(dInfo)
, x170_(CSfxManager::TranslateSFXID(sId1))
, x172_(CSfxManager::TranslateSFXID(sId2))
, x174_(CSfxManager::TranslateSFXID(sId3))
, x1bc_(aId1)
, x1c0_(aId2)
, x1c4_(aId3)
, x1e4_26_(true)
{
if (xe8_function == ESpecialFunction::HUDTarget)
x1c8_ = {{zeus::CVector3f(-1.f), zeus::CVector3f(1.f)}};
}
void CScriptSpecialFunction::Think(float, CStateManager &)
{
}
void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &)
{
}
void CScriptSpecialFunction::PreRender(const zeus::CFrustum &, const CStateManager &)
{
}
void CScriptSpecialFunction::AddToRenderer(const zeus::CFrustum &, const CStateManager &) const
{
}
void CScriptSpecialFunction::Render(const CStateManager &) const
{
}
}

View File

@ -52,11 +52,83 @@ public:
RumbleEffect = 50
};
enum class ESpinnerControllerMode
{
};
struct SRingController
{
SRingController(TUniqueId, float, bool);
};
private:
ESpecialFunction xe8_function;
std::string xec_locatorName;
float xfc_radius;
float x100_;
float x104_;
float x108_;
zeus::CVector3f x10c_;
zeus::CColor x118_;
CDamageInfo x11c_damageInfo;
float x138_ = 0.f;
zeus::CTransform x13c_ = zeus::CTransform::Identity();
float x16c_ = 0.f;
s16 x170_;
s16 x172_;
s16 x174_;
u32 x178_ = 0;
u32 x17c_;
float x180_ = 0.f;
std::vector<float> x184_;
float x194_ = 0.f;
u32 x19c_ = 0;
u32 x1a0_ = 0;
u32 x1a4_ = 0;
u32 x1a8_ = 2;
zeus::CVector3f x1ac_ = zeus::CVector3f::skZero;
bool x1b8_ = true;
ResId x1bc_;
ResId x1c0_;
ResId x1c4_;
rstl::optional_object<zeus::CAABox> x1c8_;
union
{
struct
{
bool x1e4_24_ : 1;
bool x1e4_25_ : 1;
bool x1e4_26_ : 1;
bool x1e4_27_ : 1;
bool x1e4_31_ : 1;
bool x1e5_24_ : 1;
bool x1e5_25_ : 1;
bool x1e5_26_ : 1;
};
u32 x1e4_dummy = 0;
};
bool x1f0_ = false;
public:
CScriptSpecialFunction(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, ESpecialFunction,
const std::string&, float, float, float, float, const zeus::CVector3f&, const zeus::CColor&,
bool, const CDamageInfo&, u32, u32, u32, u16, u16, u16);
bool, const CDamageInfo&, ResId, ResId, ResId, s16, s16, s16);
void Think(float, CStateManager &);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &);
void PreRender(const zeus::CFrustum &, const CStateManager &);
void AddToRenderer(const zeus::CFrustum &, const CStateManager &) const;
void Render(const CStateManager &) const;
void SkipCinematic(CStateManager&);
void RingMoveCloser(CStateManager&, float);
void RingMoveAway(CStateManager&, float);
void ThinkRingPuller(float, CStateManager&);
void RingScramble(CStateManager&);
void ThinkIntroBossRingController(float, CStateManager&);
void ThinkPlayerFollowLocator(float, CStateManager&);
void ThinkSpinnerController(float, CStateManager&, ESpinnerControllerMode);
void ThinkObjectFollowLocator(float, CStateManager&);
void ThinkChaffTarget(float, CStateManager&);
};
}

View File

@ -0,0 +1,35 @@
#include "CScriptSwitch.hpp"
#include "CStateManager.hpp"
namespace urde
{
CScriptSwitch::CScriptSwitch(TUniqueId uid, const std::string& name, const CEntityInfo& info, bool active, bool opened,
bool closeOnOpened)
: CEntity(uid, info, active, name), x34_opened(opened), x35_closeOnOpened(closeOnOpened)
{
}
void CScriptSwitch::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
{
if (GetActive())
{
if (msg == EScriptObjectMessage::Open)
x34_opened = true;
else if (msg == EScriptObjectMessage::Close)
x34_opened = false;
else if (msg == EScriptObjectMessage::SetToZero)
{
if (x34_opened)
{
SendScriptMsgs(EScriptObjectState::Open, mgr, EScriptObjectMessage::None);
if (x35_closeOnOpened)
x34_opened = false;
}
else
SendScriptMsgs(EScriptObjectState::Closed, mgr, EScriptObjectMessage::None);
}
}
CEntity::AcceptScriptMsg(msg, objId, mgr);
}
}

View File

@ -0,0 +1,18 @@
#ifndef __URDE_CSCRIPTSWITCH_HPP__
#define __URDE_CSCRIPTSWITCH_HPP__
#include "CEntity.hpp"
namespace urde
{
class CScriptSwitch : public CEntity
{
bool x34_;
bool x35_;
public:
CScriptSwitch(TUniqueId, const std::string&, const CEntityInfo&, bool, bool, bool);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager &stateMgr);
};
}
#endif // __URDE_CSCRIPTSWITCH_HPP__

View File

@ -1,12 +1,84 @@
#include "CScriptTimer.hpp"
#include "CStateManager.hpp"
namespace urde
{
CScriptTimer::CScriptTimer(TUniqueId uid, const std::string& name, const CEntityInfo& info,
float, float, bool, bool, bool active)
CScriptTimer::CScriptTimer(TUniqueId uid, const std::string& name, const CEntityInfo& info, float startTime,
float maxRandDelay, bool loop, bool autoStart, bool active)
: CEntity(uid, info, active, name)
, x34_time(startTime)
, x38_startTime(startTime)
, x3c_maxRandDelay(maxRandDelay)
, x40_loop(loop)
, x41_autoStart(autoStart)
, x42_isTiming(autoStart)
{
}
void CScriptTimer::Think(float, CStateManager&)
{
if (GetActive() && IsTiming())
ApplyTime(dt, mgr);
}
void CScriptTimer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
{
if (GetActive())
{
if (msg == EScriptObjectMessage::Start)
{
StartTiming(true);
}
else if (msg == EScriptObjectMessage::Stop)
{
StartTiming(false);
}
else if (msg == EScriptObjectMessage::ResetAndStart)
{
Reset(stateMgr);
StartTiming(true);
}
else if (msg == EScriptObjectMessage::Reset)
{
Reset(stateMgr);
}
else if (msg == EScriptObjectMessage::StopAndReset)
{
Reset(stateMgr);
StartTiming(false);
}
}
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
}
bool CScriptTimer::IsTiming() const { return x42_isTiming; }
void CScriptTimer::StartTiming(bool isTiming) { x42_isTiming = isTiming; }
void CScriptTimer::Reset(CStateManager& mgr)
{
float rDt = mgr.GetActiveRandom()->Float();
x34_time = (x3c_maxRandDelay + x38_startTime) * rDt;
}
void CScriptTimer::ApplyTime(float dt, CStateManager& mgr)
{
if (x34_time <= 0.f || !GetActive())
return;
x34_time -= dt;
if (x34_time <= 0.f)
{
SendScriptMsgs(EScriptObjectState::Zero, mgr, EScriptObjectMessage::None);
x42_isTiming = false;
if (x40_loop)
{
Reset(mgr);
if (x41_autoStart)
x42_isTiming = true;
}
}
}
}

View File

@ -8,9 +8,22 @@ namespace urde
class CScriptTimer : public CEntity
{
float x34_;
float x38_;
float x3c_;
bool x40_;
bool x41_;
bool x42_;
public:
CScriptTimer(TUniqueId, const std::string& name, const CEntityInfo& info,
float, float, bool, bool, bool);
void Think(float, CStateManager &);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager &stateMgr);
bool IsTiming();
void StartTiming(bool);
void Reset(CStateManager&);
void ApplyTime(float, CStateManager&);
};
}

View File

@ -45,8 +45,10 @@
#include "CScriptDistanceFog.hpp"
#include "CScriptActorRotate.hpp"
#include "CScriptSpecialFunction.hpp"
#include "CScriptSwitch.hpp"
#include "CScriptAiJumpPoint.hpp"
#include "CScriptColorModulate.hpp"
#include "CScriptCameraPitchVolume.hpp"
#include "CScriptCameraHintTrigger.hpp"
#include "Camera/CCinematicCamera.hpp"
#include "MP1/CNewIntroBoss.hpp"
@ -517,7 +519,8 @@ CEntity* ScriptLoader::LoadTrigger(CStateManager& mgr, CInputStream& in, int pro
const zeus::CTransform& areaXf = mgr.GetWorld()->GetGameAreas()[info.GetAreaId()]->GetTransform();
zeus::CVector3f orientedForce = areaXf.basis * forceVec;
return new CScriptTrigger(mgr.AllocateUniqueId(), *name, info, position, box, dInfo, orientedForce, flags, active, b2, b3);
return new CScriptTrigger(mgr.AllocateUniqueId(), *name, info, position, box, dInfo, orientedForce, flags, active,
b2, b3);
}
CEntity* ScriptLoader::LoadTimer(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
@ -746,8 +749,8 @@ CEntity* ScriptLoader::LoadCamera(CStateManager& mgr, CInputStream& in, int prop
u32 flags = b2 | b3 << 1 | b4 << 2 | b5 << 3 | b6 << 4 | b7 << 5 | b8 << 6 | b9 << 8;
return new CCinematicCamera(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, b1, f1,
f2 / CCameraManager::Aspect(), CCameraManager::NearPlane(),
CCameraManager::FarPlane(), CCameraManager::Aspect(), flags);
f2 / CCameraManager::Aspect(), CCameraManager::NearPlane(), CCameraManager::FarPlane(),
CCameraManager::Aspect(), flags);
}
CEntity* ScriptLoader::LoadCameraWaypoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
@ -1178,7 +1181,7 @@ CEntity* ScriptLoader::LoadWater(CStateManager& mgr, CInputStream& in, int propC
ETriggerFlags triggerFlags = ETriggerFlags(in.readUint32Big()) | ETriggerFlags::DetectProjectiles1 |
ETriggerFlags::DetectProjectiles2 | ETriggerFlags::DetectProjectiles3 |
ETriggerFlags::DetectProjectiles4 | ETriggerFlags::DetectBombs |
ETriggerFlags::Unknown1 | ETriggerFlags::DetectProjectiles5 |
ETriggerFlags::Unknown1 | ETriggerFlags::DetectProjectiles5 |
ETriggerFlags::DetectProjectiles6 | ETriggerFlags::DetectProjectiles7;
bool b1 = in.readBool();
bool displaySurface = in.readBool();
@ -1576,7 +1579,8 @@ CEntity* ScriptLoader::LoadPointOfInterest(CStateManager& mgr, CInputStream& in,
CScannableParameters sParms = LoadScannableParameters(in);
float f1 = in.readFloatBig();
return new CScriptPointOfInterest(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform, active, sParms, f1);
return new CScriptPointOfInterest(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform, active, sParms,
f1);
}
CEntity* ScriptLoader::LoadDrone(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
@ -1695,7 +1699,15 @@ CEntity* ScriptLoader::LoadControllerAction(CStateManager& mgr, CInputStream& in
CEntity* ScriptLoader::LoadSwitch(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
{
return nullptr;
if (!EnsurePropertyCount(propCount, 4, "Switch"))
return nullptr;
const std::string* name = mgr.HashInstanceName(in);
bool active = in.readBool();
bool b2 = in.readBool();
bool b3 = in.readBool();
return new CScriptSwitch(mgr.AllocateUniqueId(), *name, info, active, b2, b3);
}
CEntity* ScriptLoader::LoadPlayerStateChange(CStateManager& mgr, CInputStream& in, int propCount,
@ -1718,11 +1730,11 @@ CEntity* ScriptLoader::LoadWallCrawlerSwarm(CStateManager& mgr, CInputStream& in
CEntity* ScriptLoader::LoadAiJumpPoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
{
if (!EnsurePropertyCount(propCount, 5, "AiJumpPoint"))
return nullptr;
return nullptr;
SActorHead aHead = LoadActorHead(in, mgr);
bool active = in.readBool();
float f1 = in.readFloat();
float f1 = in.readFloat();
return new CScriptAiJumpPoint(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform, active, f1);
}
@ -1804,13 +1816,35 @@ CEntity* ScriptLoader::LoadEyeball(CStateManager& mgr, CInputStream& in, int pro
CEntity* ScriptLoader::LoadRadialDamage(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
{
return nullptr;
if (!EnsurePropertyCount(propCount, 5, "RadialDamage"))
return nullptr;
const std::string* name = mgr.HashInstanceName(in);
zeus::CVector3f center = zeus::CVector3f::ReadBig(in);
bool active = in.readBool();
CDamageInfo dInfo(in);
float radius = in.readFloatBig();
zeus::CTransform xf = ConvertEditorEulerToTransform4f(zeus::CVector3f::skZero, center);
return new CScriptSpecialFunction(
mgr.AllocateUniqueId(), *name, info, xf, CScriptSpecialFunction::ESpecialFunction::RadialDamage, "", radius,
0.f, 0.f, 0.f, zeus::CVector3f::skZero, zeus::CColor::skBlack, active, dInfo, -1, -1, -1, -1, -1, -1);
}
CEntity* ScriptLoader::LoadCameraPitchVolume(CStateManager& mgr, CInputStream& in, int propCount,
const CEntityInfo& info)
{
return nullptr;
if (!EnsurePropertyCount(propCount, 8, "CameraPitchVolume"))
return nullptr;
SScaledActorHead aHead = LoadScaledActorHead(in, mgr);
bool active = in.readBool();
zeus::CRelAngle f1 = zeus::CRelAngle::FromDegrees(in.readFloatBig());
zeus::CRelAngle f2 = zeus::CRelAngle::FromDegrees(in.readFloatBig());
float f3 = in.readFloatBig();
return new CScriptCameraPitchVolume(mgr.AllocateUniqueId(), active, aHead.x0_name, info, aHead.x40_scale,
aHead.x10_transform, f1, f2, f3);
}
CEntity* ScriptLoader::LoadEnvFxDensityController(CStateManager& mgr, CInputStream& in, int propCount,
@ -1879,9 +1913,12 @@ CEntity* ScriptLoader::LoadCameraHintTrigger(CStateManager& mgr, CInputStream& i
zeus::CTransform xfRot = aHead.x10_transform.getRotation();
if (xfRot == zeus::CTransform::Identity())
return new CScriptTrigger(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform.origin, zeus::CAABox(-scale, scale), CDamageInfo(), zeus::CVector3f::skZero, ETriggerFlags::DetectPlayer, active, b2, b3);
return new CScriptTrigger(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform.origin,
zeus::CAABox(-scale, scale), CDamageInfo(), zeus::CVector3f::skZero,
ETriggerFlags::DetectPlayer, active, b2, b3);
return new CScriptCameraHintTrigger(mgr.AllocateUniqueId(), active, aHead.x0_name, info, scale, aHead.x10_transform, b2, b3);
return new CScriptCameraHintTrigger(mgr.AllocateUniqueId(), active, aHead.x0_name, info, scale, aHead.x10_transform,
b2, b3);
}
CEntity* ScriptLoader::LoadRumbleEffect(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)

@ -1 +1 @@
Subproject commit d0791ebd2172d2adb85ab5bc32bbbb3a6d40f29f
Subproject commit fa70961027e0f848c90f1dbebe34c9fbf0f6817e