2018-11-17 22:49:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Character/CSegId.hpp"
|
|
|
|
|
|
|
|
#include "zeus/CTransform.hpp"
|
|
|
|
#include "zeus/CQuaternion.hpp"
|
|
|
|
#include "zeus/CVector3f.hpp"
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2018-11-17 22:49:32 +00:00
|
|
|
class CAnimData;
|
|
|
|
class CStateManager;
|
|
|
|
class CBodyController;
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBoneTracking {
|
2018-12-13 07:39:16 +00:00
|
|
|
zeus::CQuaternion x0_curRotation = zeus::CQuaternion::skNoRotation;
|
|
|
|
float x10_ = 0.f;
|
2018-12-08 05:30:43 +00:00
|
|
|
CSegId x14_segId;
|
|
|
|
float x18_time = 0.f;
|
2018-12-13 07:39:16 +00:00
|
|
|
float x1c_maxTrackingAngle;
|
|
|
|
float x20_angSpeed;
|
2018-12-08 05:30:43 +00:00
|
|
|
std::experimental::optional<zeus::CVector3f> x24_targetPosition;
|
|
|
|
TUniqueId x34_target = kInvalidUniqueId;
|
2018-12-13 07:39:16 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
u32 _dummy = 0;
|
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2018-11-17 22:49:32 +00:00
|
|
|
public:
|
2018-12-13 07:39:16 +00:00
|
|
|
CBoneTracking(const CAnimData& animData, std::string_view bone,
|
|
|
|
float maxTrackingAngle, float angSpeed, bool parentIk);
|
2018-12-08 05:30:43 +00:00
|
|
|
void Update(float dt);
|
2018-12-13 07:39:16 +00:00
|
|
|
void PreRender(const CStateManager& mgr, CAnimData& animData, const zeus::CTransform& xf,
|
|
|
|
const zeus::CVector3f& vec, const CBodyController& bodyController);
|
|
|
|
void PreRender(const CStateManager& mgr, CAnimData& animData, const zeus::CTransform& worldXf,
|
|
|
|
const zeus::CVector3f& localOffsetScale, bool tracking);
|
|
|
|
void SetActive(bool b);
|
|
|
|
void SetTarget(TUniqueId id);
|
|
|
|
void UnsetTarget();
|
|
|
|
void SetTargetPosition(const zeus::CVector3f& pos);
|
|
|
|
void SetNoHorizontalAim(bool b);
|
2018-11-17 22:49:32 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|