2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2017-07-09 21:55:51 -07:00
|
|
|
|
2019-09-27 19:53:03 -07:00
|
|
|
#include <map>
|
|
|
|
#include <memory>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Character/CAdditiveBodyState.hpp"
|
|
|
|
#include "Runtime/Character/CBodyState.hpp"
|
|
|
|
#include "Runtime/Character/CharacterCommon.hpp"
|
2017-07-09 21:55:51 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2017-07-09 21:55:51 -07:00
|
|
|
class CActor;
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CBodyStateInfo {
|
|
|
|
friend class CBodyController;
|
|
|
|
std::map<pas::EAnimationState, std::unique_ptr<CBodyState>> x0_stateMap;
|
|
|
|
pas::EAnimationState x14_state = pas::EAnimationState::Invalid;
|
|
|
|
CBodyController* x18_bodyController = nullptr;
|
|
|
|
std::vector<std::pair<pas::EAnimationState, std::unique_ptr<CAdditiveBodyState>>> x1c_additiveStates;
|
|
|
|
pas::EAnimationState x2c_additiveState = pas::EAnimationState::AdditiveIdle;
|
|
|
|
float x30_maxPitch = 0.f;
|
|
|
|
bool x34_24_changeLocoAtEndOfAnimOnly;
|
2020-04-22 02:08:02 -07:00
|
|
|
std::unique_ptr<CBodyState> SetupRestrictedFlyerBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
|
|
|
std::unique_ptr<CBodyState> SetupNewFlyerBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
|
|
|
std::unique_ptr<CBodyState> SetupWallWalkerBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
|
|
|
std::unique_ptr<CBodyState> SetupPitchableBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
|
|
|
std::unique_ptr<CBodyState> SetupFlyerBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
|
|
|
std::unique_ptr<CBodyState> SetupRestrictedBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
|
|
|
std::unique_ptr<CBodyState> SetupBiPedalBodyStates(pas::EAnimationState stateId, CActor& actor) const;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
2017-07-09 21:55:51 -07:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CBodyStateInfo(CActor& actor, EBodyType type);
|
|
|
|
float GetLocomotionSpeed(pas::ELocomotionAnim anim) const;
|
|
|
|
float GetMaxSpeed() const;
|
|
|
|
float GetMaximumPitch() const { return x30_maxPitch; }
|
|
|
|
void SetMaximumPitch(float pitch) { x30_maxPitch = pitch; }
|
|
|
|
bool GetLocoAnimChangeAtEndOfAnimOnly() const { return x34_24_changeLocoAtEndOfAnimOnly; }
|
|
|
|
void SetLocoAnimChangeAtEndOfAnimOnly(bool s) { x34_24_changeLocoAtEndOfAnimOnly = s; }
|
|
|
|
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-09 21:55:51 -07:00
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|