Files

61 lines
1.6 KiB
C++
Raw Permalink Normal View History

2022-10-28 14:06:29 -07:00
#ifndef _CBONETRACKING
#define _CBONETRACKING
2026-01-06 19:17:27 -08:00
#include "MetroidPrime/TGameTypes.hpp"
2022-10-28 14:06:29 -07:00
#include "Kyoto/Animation/CSegId.hpp"
#include "Kyoto/Math/CQuaternion.hpp"
#include "Kyoto/Math/CVector3f.hpp"
2026-01-06 19:17:27 -08:00
#include "MetroidPrime/TGameTypes.hpp"
2022-10-28 14:06:29 -07:00
#include "rstl/optional_object.hpp"
2026-01-06 19:17:27 -08:00
#include "rstl/string.hpp"
2022-10-30 15:47:50 -04:00
enum EBoneTrackingFlags {
kBTF_None = 0,
kBTF_NoParent = 1,
kBTF_NoParentOrigin = 2,
kBTF_NoHorizontalAim = 4,
kBTF_ParentIk = 8,
};
2026-01-06 19:17:27 -08:00
class CAnimData;
class CStateManager;
class CTransform4f;
class CBodyController;
2022-10-28 14:06:29 -07:00
class CBoneTracking {
2022-10-30 15:47:50 -04:00
public:
CBoneTracking(const CAnimData& animData, const rstl::string& bone, float maxTrackingAngle,
float angSpeed, EBoneTrackingFlags flags);
2026-01-06 21:13:12 -08:00
void Update(const float dt);
2026-01-06 19:17:27 -08:00
void PreRender(const CStateManager& mgr, CAnimData& animData, const CTransform4f& xf,
const CVector3f& scale, const CBodyController& controller);
2026-01-06 21:13:12 -08:00
void PreRender(const CStateManager& mgr, CAnimData& animData, const CTransform4f& xf,
const CVector3f& scale, const bool tracking);
void SetActive(const bool v);
void SetTarget(const TUniqueId uid);
void UnsetTarget();
void SetTargetPosition(const CVector3f& target);
void SetNoHorizontalAim(const bool aim);
2022-10-30 15:47:50 -04:00
2022-10-28 14:06:29 -07:00
private:
CQuaternion x0_rotation;
float x10_;
CSegId x14_segId;
float x18_time;
float x1c_maxTrackingAngle;
float x20_angSpeed;
2022-10-30 15:47:50 -04:00
rstl::optional_object< CVector3f > x24_targetPosition;
2022-10-28 14:06:29 -07:00
TUniqueId x34_target;
2026-01-06 21:13:12 -08:00
bool x36_24_active : 1;
bool x36_25_hasTrackedRotation : 1;
bool x36_26_noParent : 1;
bool x36_27_noParentOrigin : 1;
bool x36_28_noHorizontalAim : 1;
bool x36_29_parentIk : 1;
2022-10-28 14:06:29 -07:00
};
#endif // _CBONETRACKING