metaforce/Runtime/Character/CBodyStateInfo.hpp

49 lines
2.1 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-07-10 04:55:51 +00:00
#include "RetroTypes.hpp"
#include "CharacterCommon.hpp"
#include "CBodyState.hpp"
#include "CAdditiveBodyState.hpp"
namespace urde
{
class CActor;
class CBodyStateInfo
{
friend class CBodyController;
2017-07-14 05:14:19 +00:00
std::map<pas::EAnimationState, std::unique_ptr<CBodyState>> x0_stateMap;
pas::EAnimationState x14_state = pas::EAnimationState::Invalid;
2017-07-10 04:55:51 +00:00
CBodyController* x18_bodyController = nullptr;
2017-07-14 05:14:19 +00:00
std::vector<std::pair<pas::EAnimationState, std::unique_ptr<CAdditiveBodyState>>> x1c_additiveStates;
pas::EAnimationState x2c_additiveState = pas::EAnimationState::AdditiveIdle;
2017-07-10 04:55:51 +00:00
float x30_maxPitch = 0.f;
bool x34_24_changeLocoAtEndOfAnimOnly;
std::unique_ptr<CBodyState> SetupRestrictedFlyerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupNewFlyerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupWallWalkerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupPitchableBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupFlyerBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupRestrictedBodyStates(int stateId, CActor& actor);
std::unique_ptr<CBodyState> SetupBiPedalBodyStates(int stateId, CActor& actor);
public:
CBodyStateInfo(CActor& actor, EBodyType type);
float GetLocomotionSpeed(pas::ELocomotionAnim anim) const;
float GetMaxSpeed() const;
float GetMaximumPitch() const { return x30_maxPitch; }
2018-11-14 23:00:08 +00:00
void SetMaximumPitch(float pitch) { x30_maxPitch = pitch; }
2017-07-10 04:55:51 +00:00
bool GetLocoAnimChangeAtEndOfAnimOnly() const { return x34_24_changeLocoAtEndOfAnimOnly; }
void SetLocoAnimChangeAtEndOfAnimOnly(bool s) { x34_24_changeLocoAtEndOfAnimOnly = s; }
2017-07-14 05:14:19 +00:00
CBodyState* GetCurrentState();
const CBodyState* GetCurrentState() const;
pas::EAnimationState GetCurrentStateId() const { return x14_state; }
void SetState(pas::EAnimationState s);
CAdditiveBodyState* GetCurrentAdditiveState();
pas::EAnimationState GetCurrentAdditiveStateId() const { return x2c_additiveState; }
void SetAdditiveState(pas::EAnimationState s);
bool ApplyHeadTracking() const;
2017-07-10 04:55:51 +00:00
};
}