metaforce/Runtime/Character/CAnimTreeTweenBase.hpp

44 lines
1.5 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-04-10 21:22:59 +00:00
2016-04-11 03:59:54 +00:00
#include "CAnimTreeDoubleChild.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
class CAnimTreeTweenBase : public CAnimTreeDoubleChild {
static s32 sAdvancementDepth;
2016-04-10 21:22:59 +00:00
2016-09-10 04:50:00 +00:00
protected:
2018-12-08 05:30:43 +00:00
int x1c_flags;
bool x20_24_b1 : 1;
u8 x20_25_cullSelector : 2;
2016-09-04 02:27:35 +00:00
public:
2018-12-08 05:30:43 +00:00
CAnimTreeTweenBase(bool, const std::weak_ptr<CAnimTreeNode>& a, const std::weak_ptr<CAnimTreeNode>& b, int,
std::string_view name);
2016-09-04 02:27:35 +00:00
2018-12-08 05:30:43 +00:00
virtual void SetBlendingWeight(float w) = 0;
virtual float VGetBlendingWeight() const = 0;
2016-09-04 02:27:35 +00:00
2018-12-08 05:30:43 +00:00
float GetBlendingWeight() const { return VGetBlendingWeight(); }
2016-09-04 02:27:35 +00:00
2018-12-08 05:30:43 +00:00
void VGetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out, float w) const;
float VGetRightChildWeight() const { return GetBlendingWeight(); }
2016-09-04 02:27:35 +00:00
2018-12-08 05:30:43 +00:00
void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const;
void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut, const CCharAnimTime& time) const;
bool VHasOffset(const CSegId& seg) const;
zeus::CVector3f VGetOffset(const CSegId& seg) const;
zeus::CQuaternion VGetRotation(const CSegId& seg) const;
2016-09-04 02:27:35 +00:00
std::optional<std::unique_ptr<IAnimReader>> VSimplified();
virtual std::optional<std::unique_ptr<IAnimReader>> VReverseSimplified() {
2018-12-08 05:30:43 +00:00
return CAnimTreeTweenBase::VSimplified();
}
2016-09-11 18:40:33 +00:00
2018-12-08 05:30:43 +00:00
static bool ShouldCullTree() { return 3 <= sAdvancementDepth; }
static void IncAdvancementDepth() { sAdvancementDepth++; }
static void DecAdvancementDepth() { sAdvancementDepth--; }
2016-04-10 21:22:59 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde