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

View File

@ -108,7 +108,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt)
rVec = v; 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) if (player->x294_ > 0.f)
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,16 +33,16 @@ public:
{ {
One = 1 One = 1
}; };
private: private:
public: 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, virtual void Death(const zeus::CVector3f&, CStateManager&) {}
const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, virtual void KnockBack(const zeus::CVector3f&, CStateManager&) {}
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 &) {}
}; };
} }

View File

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

View File

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

View File

@ -26,13 +26,11 @@ struct CMotionState
zeus::CNUQuaternion xc_orientation; zeus::CNUQuaternion xc_orientation;
zeus::CVector3f x1c_velocity; zeus::CVector3f x1c_velocity;
zeus::CAxisAngle x28_angularMomentum; zeus::CAxisAngle x28_angularMomentum;
CMotionState(const zeus::CVector3f& origin, const zeus::CNUQuaternion& orientation, CMotionState(const zeus::CVector3f& origin, const zeus::CNUQuaternion& orientation, const zeus::CVector3f& velocity,
const zeus::CVector3f& velocity, const zeus::CAxisAngle& angle) const zeus::CAxisAngle& angle)
: x0_translation(origin) : x0_translation(origin), xc_orientation(orientation), x1c_velocity(velocity), x28_angularMomentum(angle)
, xc_orientation(orientation) {
, x1c_velocity(velocity) }
, x28_angularMomentum(angle)
{}
}; };
class CPhysicsState class CPhysicsState
@ -46,10 +44,11 @@ class CPhysicsState
zeus::CVector3f x4c_impulse; zeus::CVector3f x4c_impulse;
zeus::CAxisAngle x58_torque; zeus::CAxisAngle x58_torque;
zeus::CAxisAngle x64_angularImpulse; zeus::CAxisAngle x64_angularImpulse;
public: public:
CPhysicsState(const zeus::CVector3f&, const zeus::CQuaternion&, const zeus::CVector3f&, CPhysicsState(const zeus::CVector3f&, const zeus::CQuaternion&, const zeus::CVector3f&, const zeus::CAxisAngle&,
const zeus::CAxisAngle&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CAxisAngle&,
const zeus::CVector3f&, const zeus::CAxisAngle&, const zeus::CAxisAngle&); const zeus::CAxisAngle&);
void SetOrientation(const zeus::CQuaternion&); void SetOrientation(const zeus::CQuaternion&);
const zeus::CQuaternion& GetOrientation() const; const zeus::CQuaternion& GetOrientation() const;
@ -71,8 +70,7 @@ protected:
float xec_massRecip; float xec_massRecip;
float xf0_inertiaTensor; float xf0_inertiaTensor;
float xf4_inertiaTensorRecip; float xf4_inertiaTensorRecip;
union union {
{
struct struct
{ {
bool xf8_24_ : 1; bool xf8_24_ : 1;
@ -108,11 +106,10 @@ protected:
float x248_collisionAccuracyModifier = 1.f; float x248_collisionAccuracyModifier = 1.f;
u32 x24c_; u32 x24c_;
u32 x250_; u32 x250_;
public: public:
CPhysicsActor(TUniqueId, bool, const std::string&, const CEntityInfo&, CPhysicsActor(TUniqueId, bool, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const zeus::CTransform&, CModelData&&, const CMaterialList&, const CMaterialList&, const zeus::CAABox&, const SMoverData&, const CActorParameters&, float, float);
const zeus::CAABox&, const SMoverData&, const CActorParameters&,
float, float);
void Render(const CStateManager& mgr) const; void Render(const CStateManager& mgr) const;
zeus::CVector3f GetOrbitPosition(const CStateManager&) const; zeus::CVector3f GetOrbitPosition(const CStateManager&) const;
@ -149,7 +146,7 @@ public:
void MoveInOneFrameOR(const zeus::CVector3f& trans, float d); void MoveInOneFrameOR(const zeus::CVector3f& trans, float d);
void RotateToOR(const zeus::CQuaternion& q, float d); void RotateToOR(const zeus::CQuaternion& q, float d);
void MoveToOR(const zeus::CVector3f& trans, 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); void MoveToWR(const zeus::CVector3f& trans, float d);
zeus::CAxisAngle GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const; zeus::CAxisAngle GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const;
zeus::CVector3f GetMoveToORImpulseWR(const zeus::CVector3f& trans, float d) const; zeus::CVector3f GetMoveToORImpulseWR(const zeus::CVector3f& trans, float d) const;
@ -165,7 +162,7 @@ public:
CMotionState PredictMotion(float dt) const; CMotionState PredictMotion(float dt) const;
CMotionState PredictLinearMotion(float dt) const; CMotionState PredictLinearMotion(float dt) const;
CMotionState PredictAngularMotion(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 ApplyForceWR(const zeus::CVector3f& force, const zeus::CAxisAngle& angle);
void ApplyImpulseOR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle); void ApplyImpulseOR(const zeus::CVector3f& impulse, const zeus::CAxisAngle& angle);
void ApplyImpulseWR(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(); void UseCollisionImpulses();
}; };
} }
#endif // __URDE_CPHYSICSACTOR_HPP__ #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, 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 zeus::CVector3f& playerScale, float mass, float stepUp, float stepDown, float f4,
const CMaterialList& ml) const CMaterialList& ml)
: CPhysicsActor(uid, true, "CPlayer", CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList), : CPhysicsActor(uid, true, "CPlayer", CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList), xf,
xf, MakePlayerAnimRes(resId, playerScale), ml, aabb, SMoverData(mass), CActorParameters::None(), MakePlayerAnimRes(resId, playerScale), ml, aabb, SMoverData(mass), CActorParameters::None(), stepUp,
stepUp, stepDown) stepDown)
{ {
x768_morphball.reset(new CMorphBall(*this, f4)); x768_morphball.reset(new CMorphBall(*this, f4));
} }
bool CPlayer::IsTransparent() const bool CPlayer::IsTransparent() const { return x588_alpha < 1.f; }
{
return x588_alpha < 1.f;
}
void CPlayer::Update(float, CStateManager& mgr) void CPlayer::Update(float, CStateManager& mgr) {}
{
}
bool CPlayer::IsPlayerDeadEnough() const bool CPlayer::IsPlayerDeadEnough() const
{ {
@ -44,164 +39,79 @@ bool CPlayer::IsPlayerDeadEnough() const
return false; return false;
} }
void CPlayer::AsyncLoadSuit(CStateManager& mgr) void CPlayer::AsyncLoadSuit(CStateManager& mgr) { x490_gun->AsyncLoadSuit(mgr); }
{
x490_gun->AsyncLoadSuit(mgr);
}
void CPlayer::LoadAnimationTokens() void CPlayer::LoadAnimationTokens() {}
{
}
bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const { return false; }
{
return false;
}
const CDamageVulnerability* CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1, const CDamageVulnerability* CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1, const zeus::CVector3f& v2,
const zeus::CVector3f& v2,
const CDamageInfo& info) const const CDamageInfo& info) const
{ {
return nullptr; return nullptr;
} }
const CDamageVulnerability* CPlayer::GetDamageVulnerability() const const CDamageVulnerability* CPlayer::GetDamageVulnerability() const { return nullptr; }
{
return nullptr;
}
zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float) const zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float) const { return {}; }
{
return {};
}
zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float) const zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float) const { return {}; }
{
return {};
}
void CPlayer::FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr) void CPlayer::FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr) {}
{
}
zeus::CVector3f CPlayer::GetDamageLocationWR() const zeus::CVector3f CPlayer::GetDamageLocationWR() const { return {}; }
{
return {};
}
float CPlayer::GetPrevDamageAmount() const float CPlayer::GetPrevDamageAmount() const { return 0.f; }
{
return 0.f;
}
float CPlayer::GetDamageAmount() const float CPlayer::GetDamageAmount() const { return 0.f; }
{
return 0.f;
}
bool CPlayer::WasDamaged() const bool CPlayer::WasDamaged() const { return false; }
{
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) CHealthInfo* CPlayer::HealthInfo(CStateManager& mgr) { return nullptr; }
{
return nullptr;
}
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const { return false; }
{
return false;
}
rstl::optional_object<zeus::CAABox> CPlayer::GetTouchBounds() const rstl::optional_object<zeus::CAABox> CPlayer::GetTouchBounds() const { return {}; }
{
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 bool CPlayer::GetExplorationMode() const { return false; }
{
return false;
}
bool CPlayer::GetCombatMode() const bool CPlayer::GetCombatMode() const { return false; }
{
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 float CPlayer::GetMaximumPlayerPositiveVerticalVelocity(CStateManager&) const { return 0.f; }
{
return 0.f;
}
void CPlayer::ProcessInput(const CFinalInput&, CStateManager&) void CPlayer::ProcessInput(const CFinalInput&, CStateManager&) {}
{
}
bool CPlayer::GetFrozenState() const bool CPlayer::GetFrozenState() const { return false; }
{
return false;
}
void CPlayer::Think(float, CStateManager&) void CPlayer::Think(float, CStateManager&) {}
{
}
void CPlayer::PreThink(float dt, CStateManager& mgr) void CPlayer::PreThink(float dt, CStateManager& mgr)
{ {
@ -212,177 +122,92 @@ void CPlayer::PreThink(float dt, CStateManager& mgr)
xa04_ = dt; 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) u16 CPlayer::GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, int, u16) { return 0; }
{
return 0;
}
u16 CPlayer::SfxIdFromMaterial(const CMaterialList&, const u16*, u16) u16 CPlayer::SfxIdFromMaterial(const CMaterialList&, const u16*, u16) { return 0; }
{
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) CFirstPersonCamera& CPlayer::GetFirstPersonCamera(CStateManager& mgr)
{ {
return *mgr.GetCameraManager()->GetFirstPersonCamera(); 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 bool CPlayer::GetMorphballTransitionState() const { return false; }
{
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) bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr) { return false; }
{
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 {}; return {};
} }
void CPlayer::SetOrbitState(EPlayerOrbitState, CStateManager& mgr) TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) { return {}; }
{
}
void CPlayer::SetOrbitTargetId(TUniqueId) void CPlayer::UpdateOrbitableObjects(CStateManager& mgr) {}
{
}
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)
{
}
TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const 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 bool CPlayer::WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const { return false; }
{
return false;
}
bool CPlayer::WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const bool CPlayer::WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const { return false; }
{
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 float CPlayer::GetOrbitMaxLockDistance(CStateManager& mgr) const { return 0.f; }
{
return 0.f;
}
float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const { return 0.f; }
{
return 0.f;
}
bool CPlayer::ValidateOrbitTargetId(TUniqueId, CStateManager& mgr) const bool CPlayer::ValidateOrbitTargetId(TUniqueId, CStateManager& mgr) const { return false; }
{
return false;
}
bool CPlayer::ValidateCurrentOrbitTargetId(CStateManager& mgr) bool CPlayer::ValidateCurrentOrbitTargetId(CStateManager& mgr) { return false; }
{
return false;
}
bool CPlayer::ValidateOrbitTargetIdAndPointer(TUniqueId, CStateManager& mgr) const bool CPlayer::ValidateOrbitTargetIdAndPointer(TUniqueId, CStateManager& mgr) const { return false; }
{
return false;
}
zeus::CVector3f CPlayer::GetBallPosition() const zeus::CVector3f CPlayer::GetBallPosition() const { return {}; }
{
return {};
}
zeus::CVector3f CPlayer::GetEyePosition() const zeus::CVector3f CPlayer::GetEyePosition() const { return {}; }
{
return {};
}
float CPlayer::GetEyeHeight() const float CPlayer::GetEyeHeight() const { return 0.f; }
{
return 0.f;
}
float CPlayer::GetStepUpHeight() const float CPlayer::GetStepUpHeight() const { return 0.f; }
{
return 0.f;
}
float CPlayer::GetStepDownHeight() const float CPlayer::GetStepDownHeight() const { return 0.f; }
{
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 zeus::CTransform CPlayer::CreateTransformFromMovementDirection() const { return {}; }
{
return {};
}
const CCollisionPrimitive& CPlayer::GetCollisionPrimitive() const const CCollisionPrimitive& CPlayer::GetCollisionPrimitive() const { return CPhysicsActor::GetCollisionPrimitive(); }
{
return CPhysicsActor::GetCollisionPrimitive();
}
zeus::CTransform CPlayer::GetPrimitiveTransform() const zeus::CTransform CPlayer::GetPrimitiveTransform() const { return {}; }
{
return {};
}
bool CPlayer::CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager& mgr) bool CPlayer::CollidedWith(TUniqueId, const CCollisionInfoList&, CStateManager& mgr) { return false; }
{
return false;
}
float CPlayer::GetActualFirstPersonMaxVelocity() const float CPlayer::GetActualFirstPersonMaxVelocity() const { return 0.f; }
{
return 0.f;
}
void CPlayer::SetMoveState(EPlayerMovementState, CStateManager& mgr) void CPlayer::SetMoveState(EPlayerMovementState, CStateManager& mgr) {}
{
}
float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr) float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr) { return 0.f; }
{
return 0.f;
}
float CPlayer::TurnInput(const CFinalInput& input) const float CPlayer::TurnInput(const CFinalInput& input) const { return 0.f; }
{
return 0.f;
}
float CPlayer::StrafeInput(const CFinalInput& input) const float CPlayer::StrafeInput(const CFinalInput& input) const { return 0.f; }
{
return 0.f;
}
float CPlayer::ForwardInput(const CFinalInput& input, float) const float CPlayer::ForwardInput(const CFinalInput& input, float) const { return 0.f; }
{
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 float CPlayer::GetWeight() const { return 0.f; }
{
return 0.f;
}
float CPlayer::GetDampedClampedVelocityWR() const float CPlayer::GetDampedClampedVelocityWR() const { return 0.f; }
{
return 0.f;
}
void CPlayer::Touch() void CPlayer::Touch() {}
{
}
void CPlayer::CVisorSteam::SetSteam(float a, float b, float c, ResId d, bool e) 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; x28_ = e;
} }
ResId CPlayer::CVisorSteam::GetTextureId() const ResId CPlayer::CVisorSteam::GetTextureId() const { return xc_; }
{
return xc_;
}
void CPlayer::CVisorSteam::Update(float dt) void CPlayer::CVisorSteam::Update(float dt)
{ {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,5 @@
#include "CRipple.hpp" #include "CRipple.hpp"
namespace urde 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 x1c_ = 3.f;
float x20_ = 0.25f; float x20_ = 0.25f;
float x24_ = 0.00098039221f; float x24_ = 0.00098039221f;
public: public:
CRipple(TUniqueId, const zeus::CVector3f&, float); CRipple(TUniqueId, const zeus::CVector3f&, float);

View File

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

View File

@ -3,12 +3,11 @@
namespace urde namespace urde
{ {
CScriptActor::CScriptActor(TUniqueId uid, const std::string& name, const CEntityInfo& info, CScriptActor::CScriptActor(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf,
const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& aabb, float a, float, CModelData&& mData, const zeus::CAABox& aabb, float a, float, const CMaterialList& matList,
const CMaterialList& matList, const CHealthInfo&, const CDamageVulnerability&, const CHealthInfo&, const CDamageVulnerability&, const CActorParameters& actParms, bool,
const CActorParameters& actParms, bool, bool active, u32, float, bool, bool, bool, 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) : 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 class CScriptActor : public CPhysicsActor
{ {
public: public:
CScriptActor(TUniqueId, const std::string&, const CEntityInfo&, CScriptActor(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const zeus::CTransform&, CModelData&&, const zeus::CAABox& aabb, float, float, const zeus::CAABox& aabb, float, float, const CMaterialList& matList, const CHealthInfo&,
const CMaterialList& matList, const CHealthInfo&, const CDamageVulnerability&, const CDamageVulnerability&, const CActorParameters&, bool, bool, u32, float, bool, bool, bool, bool);
const CActorParameters&, bool, bool, u32, float, bool, bool, bool, bool);
}; };
} }
#endif // __URDE_CSCRIPTACTOR_HPP__ #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, 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) bool b1, float f1, bool b2, u32 w2, bool active, float totalPlayback)
: CEntity(uid, info, active, name), : CEntity(uid, info, active, name)
x34_animationId(animId), , x34_animationId(animId)
x38_(f1), , x38_(f1)
x3c_(totalPlayback), , x3c_(totalPlayback)
x40_(f1), , x40_(f1)
x44_24_(b1), , x44_24_(b1)
x44_25_(b2), , x44_25_(b2)
x44_26_(w2) , 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) 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 x38_;
float x3c_; float x3c_;
float x40_; float x40_;
union union {
{
struct struct
{ {
bool x44_24_ : 1; bool x44_24_ : 1;
@ -25,12 +24,13 @@ private:
}; };
u8 _dummy = 0; u8 _dummy = 0;
}; };
public: public:
CScriptActorKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info, s32 w1, bool b1, float f1, CScriptActorKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info, s32 w1, bool b1, float f1,
bool b2, u32 w2, bool active, float f2); bool b2, u32 w2, bool active, float f2);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr); void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr);
void Think(float, CStateManager &); void Think(float, CStateManager&);
void UpdateEntity(TUniqueId, CStateManager&); void UpdateEntity(TUniqueId, CStateManager&);
}; };
} }

View File

@ -4,7 +4,7 @@ namespace urde
{ {
CScriptActorRotate::CScriptActorRotate(TUniqueId uid, const std::string& name, const CEntityInfo& info, CScriptActorRotate::CScriptActorRotate(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CVector3f& rotation, float scale, bool, bool, bool active) 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_; float x44_;
std::map<TUniqueId, zeus::CTransform> x48_actors; std::map<TUniqueId, zeus::CTransform> x48_actors;
union union {
{
struct struct
{ {
bool x58_24_ : 1; bool x58_24_ : 1;
@ -24,8 +23,10 @@ class CScriptActorRotate : public CEntity
}; };
u32 dummy = 0; u32 dummy = 0;
}; };
public: 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, CScriptAiJumpPoint::CScriptAiJumpPoint(TUniqueId uid, const std::string& name, const CEntityInfo& info,
zeus::CTransform& xf, bool active, float f1) zeus::CTransform& xf, bool active, float f1)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero),
CActorParameters::None(), kInvalidUniqueId), CActorParameters::None(), kInvalidUniqueId)
xe8_(f1) , xe8_(f1)
{ {
xec_.emplace(xf.origin, xf.origin); 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) if (conn.x0_state != EScriptObjectState::Arrived || conn.x4_msg != EScriptObjectMessage::Next)
continue; 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) if (wpnt)
{ {
x10c_currentWaypoint = wpnt->GetUniqueId(); x10c_currentWaypoint = wpnt->GetUniqueId();
@ -45,14 +46,12 @@ void CScriptAiJumpPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId oth
} }
} }
rstl::optional_object<zeus::CAABox> CScriptAiJumpPoint::GetTouchBounds() const rstl::optional_object<zeus::CAABox> CScriptAiJumpPoint::GetTouchBounds() const { return xec_; }
{
return xec_;
}
bool CScriptAiJumpPoint::GetInUse(TUniqueId uid) const 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 true;
return false; return false;

View File

@ -10,8 +10,7 @@ class CScriptAiJumpPoint : public CActor
private: private:
float xe8_; float xe8_;
std::experimental::optional<zeus::CAABox> xec_; std::experimental::optional<zeus::CAABox> xec_;
union union {
{
struct struct
{ {
bool x108_24 : 1; bool x108_24 : 1;
@ -22,14 +21,14 @@ private:
TUniqueId x10c_currentWaypoint = kInvalidUniqueId; TUniqueId x10c_currentWaypoint = kInvalidUniqueId;
TUniqueId x10e_nextWaypoint = kInvalidUniqueId; TUniqueId x10e_nextWaypoint = kInvalidUniqueId;
float x110_timeRemaining = 0.f; float x110_timeRemaining = 0.f;
public: public:
CScriptAiJumpPoint(TUniqueId, const std::string&, const CEntityInfo&, zeus::CTransform&, bool, float); CScriptAiJumpPoint(TUniqueId, const std::string&, const CEntityInfo&, zeus::CTransform&, bool, float);
void Think(float, CStateManager&); void Think(float, CStateManager&);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager &); void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
void AddToRenderer(const zeus::CFrustum &, const CStateManager &) const {} void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const {}
void Render(const CStateManager &) const {} void Render(const CStateManager&) const {}
rstl::optional_object<zeus::CAABox> GetTouchBounds() const; rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
bool GetInUse(TUniqueId uid) 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, CScriptAreaAttributes::CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType,
float envFxDensity, float thermalHeat, float xrayFogDistance, float envFxDensity, float thermalHeat, float xrayFogDistance,
float worldLightingLevel, ResId skybox, EPhazonType phazonType) float worldLightingLevel, ResId skybox, EPhazonType phazonType)
: CEntity(uid, info, true, std::string()), : CEntity(uid, info, true, std::string())
x34_24_showSkybox(showSkybox), , x34_24_showSkybox(showSkybox)
x38_envFx(fxType), , x38_envFx(fxType)
x3c_envFxDensity(envFxDensity), , x3c_envFxDensity(envFxDensity)
x40_thermalHeat(thermalHeat), , x40_thermalHeat(thermalHeat)
x44_xrayFogDistance(xrayFogDistance), , x44_xrayFogDistance(xrayFogDistance)
x48_worldLightingLevel(worldLightingLevel), , x48_worldLightingLevel(worldLightingLevel)
x4c_skybox(skybox), , x4c_skybox(skybox)
x50_phazon(phazonType) , x50_phazon(phazonType)
{ {
} }
@ -44,24 +44,11 @@ void CScriptAreaAttributes::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
} }
} }
bool CScriptAreaAttributes::GetNeedsSky() const bool CScriptAreaAttributes::GetNeedsSky() const { return x34_24_showSkybox; }
{
return x34_24_showSkybox;
}
bool CScriptAreaAttributes::GetNeedsEnvFx() const bool CScriptAreaAttributes::GetNeedsEnvFx() const { return x38_envFx != EEnvFxType::None; }
{
return x38_envFx != EEnvFxType::None;
}
float CScriptAreaAttributes::GetThermalHeat() const float CScriptAreaAttributes::GetThermalHeat() const { return x40_thermalHeat; }
{
return x40_thermalHeat;
}
float CScriptAreaAttributes::GetWorldLightingLevel() const
{
return x48_worldLightingLevel;
}
float CScriptAreaAttributes::GetWorldLightingLevel() const { return x48_worldLightingLevel; }
} }

View File

@ -16,10 +16,11 @@ class CScriptAreaAttributes : public CEntity
float x48_worldLightingLevel; float x48_worldLightingLevel;
ResId x4c_skybox; ResId x4c_skybox;
EPhazonType x50_phazon; EPhazonType x50_phazon;
public: public:
CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType, CScriptAreaAttributes(TUniqueId uid, const CEntityInfo& info, bool showSkybox, EEnvFxType fxType,
float envFxDensity, float thermalHeat, float xrayFogDistance, float envFxDensity, float thermalHeat, float xrayFogDistance, float worldLightingLevel,
float worldLightingLevel, ResId skybox, EPhazonType phazonType); ResId skybox, EPhazonType phazonType);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr); 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, CScriptCameraBlurKeyframe::CScriptCameraBlurKeyframe(TUniqueId uid, const std::string& name, const CEntityInfo& info,
u32, float, u32, float, float, bool active) 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 namespace urde
{ {
CScriptCameraFilterKeyframe::CScriptCameraFilterKeyframe(TUniqueId uid, const std::string &name, const CEntityInfo& info, CScriptCameraFilterKeyframe::CScriptCameraFilterKeyframe(TUniqueId uid, const std::string& name,
u32, u32, u32, u32, const zeus::CColor&, float, float, const CEntityInfo& info, u32, u32, u32, u32,
u32, bool active) const zeus::CColor&, float, float, u32, bool active)
: CEntity(uid, info, active, name) : CEntity(uid, info, active, name)
{} {
}
} }

View File

@ -16,9 +16,10 @@ class CScriptCameraFilterKeyframe : public CEntity
float x48_; float x48_;
float x4c_; float x4c_;
u32 x50_; u32 x50_;
public: public:
CScriptCameraFilterKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, u32, u32, u32, const zeus::CColor&, CScriptCameraFilterKeyframe(TUniqueId, const std::string&, const CEntityInfo&, u32, u32, u32, u32,
float, float, u32, bool); 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, 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::CTransform& xf, bool active, u32, u32, u32, float, float, float,
const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, float,
float, float, float, float, float, float, float, float, float, float) float, float, float, float, float, float, float, float, float)
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero),
CActorParameters::None(), kInvalidUniqueId) CActorParameters::None(), kInvalidUniqueId)
{ {
} }
} }

View File

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

View File

@ -4,13 +4,15 @@
namespace urde 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) CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, const std::string& name,
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour), CActorParameters::None(), kInvalidUniqueId) const CEntityInfo& info, const zeus::CVector3f& scale,
, xe8_obb(xf, scale) const zeus::CTransform& xf, bool b2, bool b3)
, x124_scale(scale) : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour),
, x130_24_(b2) CActorParameters::None(), kInvalidUniqueId)
, x130_25_(b3) , 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::COBBox xe8_obb;
zeus::CVector3f x124_scale; zeus::CVector3f x124_scale;
union union {
{
struct struct
{ {
bool x130_24_ : 1; bool x130_24_ : 1;
@ -21,8 +20,10 @@ class CScriptCameraHintTrigger : public CActor
}; };
u8 _dummy = 0; u8 _dummy = 0;
}; };
public: 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__ #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 "CScriptSpecialFunction.hpp"
#include "Character/CModelData.hpp" #include "Character/CModelData.hpp"
#include "CActorParameters.hpp" #include "CActorParameters.hpp"
#include "Audio/CSfxManager.hpp"
namespace urde namespace urde
{ {
CScriptSpecialFunction::CScriptSpecialFunction(TUniqueId uid, const std::string& name, const CEntityInfo& info, CScriptSpecialFunction::CScriptSpecialFunction(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CTransform& xf, ESpecialFunction, const std::string&, float, const zeus::CTransform& xf, ESpecialFunction func,
float, float, float, const zeus::CVector3f&, const zeus::CColor&, const std::string& lcName, float radius, float f2, float f3, float f4,
bool active, const CDamageInfo&, u32, u32, u32, u16, u16, u16) 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(), : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(), CActorParameters::None(),
kInvalidUniqueId) 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 RumbleEffect = 50
}; };
enum class ESpinnerControllerMode
{
};
struct SRingController
{
SRingController(TUniqueId, float, bool);
};
private: 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: public:
CScriptSpecialFunction(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, ESpecialFunction, CScriptSpecialFunction(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, ESpecialFunction,
const std::string&, float, float, float, float, const zeus::CVector3f&, const zeus::CColor&, 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 "CScriptTimer.hpp"
#include "CStateManager.hpp"
namespace urde namespace urde
{ {
CScriptTimer::CScriptTimer(TUniqueId uid, const std::string& name, const CEntityInfo& info, CScriptTimer::CScriptTimer(TUniqueId uid, const std::string& name, const CEntityInfo& info, float startTime,
float, float, bool, bool, bool active) float maxRandDelay, bool loop, bool autoStart, bool active)
: CEntity(uid, info, active, name) : 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 class CScriptTimer : public CEntity
{ {
float x34_;
float x38_;
float x3c_;
bool x40_;
bool x41_;
bool x42_;
public: public:
CScriptTimer(TUniqueId, const std::string& name, const CEntityInfo& info, CScriptTimer(TUniqueId, const std::string& name, const CEntityInfo& info,
float, float, bool, bool, bool); 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 "CScriptDistanceFog.hpp"
#include "CScriptActorRotate.hpp" #include "CScriptActorRotate.hpp"
#include "CScriptSpecialFunction.hpp" #include "CScriptSpecialFunction.hpp"
#include "CScriptSwitch.hpp"
#include "CScriptAiJumpPoint.hpp" #include "CScriptAiJumpPoint.hpp"
#include "CScriptColorModulate.hpp" #include "CScriptColorModulate.hpp"
#include "CScriptCameraPitchVolume.hpp"
#include "CScriptCameraHintTrigger.hpp" #include "CScriptCameraHintTrigger.hpp"
#include "Camera/CCinematicCamera.hpp" #include "Camera/CCinematicCamera.hpp"
#include "MP1/CNewIntroBoss.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(); const zeus::CTransform& areaXf = mgr.GetWorld()->GetGameAreas()[info.GetAreaId()]->GetTransform();
zeus::CVector3f orientedForce = areaXf.basis * forceVec; 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) 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; 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, return new CCinematicCamera(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, b1, f1,
f2 / CCameraManager::Aspect(), CCameraManager::NearPlane(), f2 / CCameraManager::Aspect(), CCameraManager::NearPlane(), CCameraManager::FarPlane(),
CCameraManager::FarPlane(), CCameraManager::Aspect(), flags); CCameraManager::Aspect(), flags);
} }
CEntity* ScriptLoader::LoadCameraWaypoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) 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 triggerFlags = ETriggerFlags(in.readUint32Big()) | ETriggerFlags::DetectProjectiles1 |
ETriggerFlags::DetectProjectiles2 | ETriggerFlags::DetectProjectiles3 | ETriggerFlags::DetectProjectiles2 | ETriggerFlags::DetectProjectiles3 |
ETriggerFlags::DetectProjectiles4 | ETriggerFlags::DetectBombs | ETriggerFlags::DetectProjectiles4 | ETriggerFlags::DetectBombs |
ETriggerFlags::Unknown1 | ETriggerFlags::DetectProjectiles5 | ETriggerFlags::Unknown1 | ETriggerFlags::DetectProjectiles5 |
ETriggerFlags::DetectProjectiles6 | ETriggerFlags::DetectProjectiles7; ETriggerFlags::DetectProjectiles6 | ETriggerFlags::DetectProjectiles7;
bool b1 = in.readBool(); bool b1 = in.readBool();
bool displaySurface = in.readBool(); bool displaySurface = in.readBool();
@ -1576,7 +1579,8 @@ CEntity* ScriptLoader::LoadPointOfInterest(CStateManager& mgr, CInputStream& in,
CScannableParameters sParms = LoadScannableParameters(in); CScannableParameters sParms = LoadScannableParameters(in);
float f1 = in.readFloatBig(); 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) 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) 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, 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) CEntity* ScriptLoader::LoadAiJumpPoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)
{ {
if (!EnsurePropertyCount(propCount, 5, "AiJumpPoint")) if (!EnsurePropertyCount(propCount, 5, "AiJumpPoint"))
return nullptr; return nullptr;
SActorHead aHead = LoadActorHead(in, mgr); SActorHead aHead = LoadActorHead(in, mgr);
bool active = in.readBool(); 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); 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) 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, CEntity* ScriptLoader::LoadCameraPitchVolume(CStateManager& mgr, CInputStream& in, int propCount,
const CEntityInfo& info) 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, 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(); zeus::CTransform xfRot = aHead.x10_transform.getRotation();
if (xfRot == zeus::CTransform::Identity()) 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) CEntity* ScriptLoader::LoadRumbleEffect(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)

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