2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-07-10 04:55:51 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Character/CBodyStateCmdMgr.hpp"
|
|
|
|
#include "Runtime/Character/CharacterCommon.hpp"
|
2017-07-10 04:55:51 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2019-09-28 02:53:03 +00:00
|
|
|
class CActor;
|
2017-07-11 07:17:03 +00:00
|
|
|
class CBodyController;
|
|
|
|
class CStateManager;
|
2019-09-28 02:53:03 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CAdditiveBodyState {
|
2017-07-11 07:17:03 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
virtual ~CAdditiveBodyState() = default;
|
|
|
|
virtual bool ApplyHeadTracking() const { return true; }
|
|
|
|
virtual bool CanShoot() const { return true; }
|
|
|
|
virtual void Start(CBodyController& bc, CStateManager& mgr) = 0;
|
|
|
|
virtual pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) = 0;
|
|
|
|
virtual void Shutdown(CBodyController& bc) = 0;
|
2017-07-10 04:55:51 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CABSAim : public CAdditiveBodyState {
|
|
|
|
bool x4_needsIdle = false;
|
|
|
|
s32 x8_anims[4];
|
|
|
|
float x18_angles[4];
|
|
|
|
float x28_hWeight = 0.f;
|
|
|
|
float x2c_hWeightVel = 0.f;
|
|
|
|
float x30_vWeight = 0.f;
|
|
|
|
float x34_vWeightVel = 0.f;
|
2019-08-14 10:04:11 +00:00
|
|
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2017-07-11 07:17:03 +00:00
|
|
|
public:
|
2019-08-09 19:46:49 +00:00
|
|
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
|
|
|
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
|
|
|
|
void Shutdown(CBodyController& bc) override;
|
2017-07-10 04:55:51 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CABSFlinch : public CAdditiveBodyState {
|
|
|
|
float x4_weight = 1.f;
|
|
|
|
u32 x8_anim = 0;
|
2019-08-14 10:04:11 +00:00
|
|
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2017-07-11 07:17:03 +00:00
|
|
|
public:
|
2019-08-09 22:07:52 +00:00
|
|
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
2019-08-09 19:46:49 +00:00
|
|
|
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
|
|
|
|
void Shutdown(CBodyController& bc) override {}
|
2017-07-10 04:55:51 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CABSIdle : public CAdditiveBodyState {
|
2019-08-14 10:04:11 +00:00
|
|
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2017-07-11 07:17:03 +00:00
|
|
|
public:
|
2019-08-09 22:07:52 +00:00
|
|
|
void Start(CBodyController& bc, CStateManager& mgr) override {}
|
2019-08-09 19:46:49 +00:00
|
|
|
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
|
|
|
|
void Shutdown(CBodyController& bc) override {}
|
2017-07-10 04:55:51 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CABSReaction : public CAdditiveBodyState {
|
|
|
|
float x4_weight = 1.f;
|
|
|
|
s32 x8_anim = -1;
|
|
|
|
pas::EAdditiveReactionType xc_type = pas::EAdditiveReactionType::Invalid;
|
|
|
|
bool x10_active = false;
|
2019-08-14 10:04:11 +00:00
|
|
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
2018-12-08 05:30:43 +00:00
|
|
|
void StopAnimation(CBodyController& bc);
|
|
|
|
|
2017-07-11 07:17:03 +00:00
|
|
|
public:
|
2019-08-09 19:46:49 +00:00
|
|
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
|
|
|
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
|
|
|
|
void Shutdown(CBodyController& bc) override { StopAnimation(bc); }
|
2017-07-10 04:55:51 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|