2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 23:26:09 +00:00

CAnimPlaybackParms: Make class constexpr constructible

Allows for removal of some trivial runtime initializers.
This commit is contained in:
Lioncash
2020-04-11 20:49:56 -04:00
parent 1b42bda711
commit 1fff540102
6 changed files with 31 additions and 30 deletions

View File

@@ -20,28 +20,29 @@ class CAnimPlaybackParms {
const zeus::CVector3f* x24_objectScale = nullptr;
public:
CAnimPlaybackParms() = default;
CAnimPlaybackParms(s32 animA, s32 animB, float blendWeight, bool animating)
constexpr CAnimPlaybackParms() = default;
constexpr CAnimPlaybackParms(s32 animA, s32 animB, float blendWeight, bool animating)
: x0_animA(animA), x4_animB(animB), x8_blendWeight(blendWeight), xc_animating(animating) {}
CAnimPlaybackParms(s32 anim, const zeus::CQuaternion* deltaOrient, const zeus::CVector3f* targetPos,
const zeus::CTransform* xf, const zeus::CVector3f* scale, bool useLocator)
constexpr CAnimPlaybackParms(s32 anim, const zeus::CQuaternion* deltaOrient, const zeus::CVector3f* targetPos,
const zeus::CTransform* xf, const zeus::CVector3f* scale, bool useLocator)
: x0_animA(anim)
, x14_targetPos(targetPos)
, x18_useLocator(useLocator)
, x1c_deltaOrient(deltaOrient)
, x20_objectXf(xf)
, x24_objectScale(scale) {}
const zeus::CTransform* GetObjectXform() const { return x20_objectXf; }
const zeus::CQuaternion* GetDeltaOrient() const { return x1c_deltaOrient; }
const zeus::CVector3f* GetTargetPos() const { return x14_targetPos; }
bool GetIsUseLocator() const { return x18_useLocator; }
const zeus::CVector3f* GetObjectScale() const { return x24_objectScale; }
s32 GetAnimationId() const { return x0_animA; }
s32 GetSecondAnimationId() const { return x4_animB; }
float GetBlendFactor() const { return x8_blendWeight; }
void SetAnimationId(s32 id) { x0_animA = id; }
void SetSecondAnimationId(s32 id) { x4_animB = id; }
void SetBlendFactor(float f) { x8_blendWeight = f; }
bool GetIsPlayAnimation() const { return xc_animating; }
constexpr const zeus::CTransform* GetObjectXform() const { return x20_objectXf; }
constexpr const zeus::CQuaternion* GetDeltaOrient() const { return x1c_deltaOrient; }
constexpr const zeus::CVector3f* GetTargetPos() const { return x14_targetPos; }
constexpr bool GetIsUseLocator() const { return x18_useLocator; }
constexpr const zeus::CVector3f* GetObjectScale() const { return x24_objectScale; }
constexpr s32 GetAnimationId() const { return x0_animA; }
constexpr s32 GetSecondAnimationId() const { return x4_animB; }
constexpr float GetBlendFactor() const { return x8_blendWeight; }
constexpr void SetAnimationId(s32 id) { x0_animA = id; }
constexpr void SetSecondAnimationId(s32 id) { x4_animB = id; }
constexpr void SetBlendFactor(float f) { x8_blendWeight = f; }
constexpr bool GetIsPlayAnimation() const { return xc_animating; }
};
} // namespace urde