metaforce/Runtime/Character/CAnimTreeTweenBase.hpp

44 lines
1.5 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-04-10 14:22:59 -07:00
2016-04-10 20:59:54 -07:00
#include "CAnimTreeDoubleChild.hpp"
2018-12-07 21:30:43 -08:00
namespace urde {
class CAnimTreeTweenBase : public CAnimTreeDoubleChild {
static s32 sAdvancementDepth;
2016-04-10 14:22:59 -07:00
2016-09-09 21:50:00 -07:00
protected:
2018-12-07 21:30:43 -08:00
int x1c_flags;
bool x20_24_b1 : 1;
u8 x20_25_cullSelector : 2;
2016-09-03 19:27:35 -07:00
public:
2018-12-07 21:30:43 -08:00
CAnimTreeTweenBase(bool, const std::weak_ptr<CAnimTreeNode>& a, const std::weak_ptr<CAnimTreeNode>& b, int,
std::string_view name);
2016-09-03 19:27:35 -07:00
2018-12-07 21:30:43 -08:00
virtual void SetBlendingWeight(float w) = 0;
virtual float VGetBlendingWeight() const = 0;
2016-09-03 19:27:35 -07:00
2018-12-07 21:30:43 -08:00
float GetBlendingWeight() const { return VGetBlendingWeight(); }
2016-09-03 19:27:35 -07:00
2018-12-07 21:30:43 -08: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-03 19:27:35 -07:00
2018-12-07 21:30:43 -08: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-03 19:27:35 -07:00
std::optional<std::unique_ptr<IAnimReader>> VSimplified();
virtual std::optional<std::unique_ptr<IAnimReader>> VReverseSimplified() {
2018-12-07 21:30:43 -08:00
return CAnimTreeTweenBase::VSimplified();
}
2016-09-11 11:40:33 -07:00
2018-12-07 21:30:43 -08:00
static bool ShouldCullTree() { return 3 <= sAdvancementDepth; }
static void IncAdvancementDepth() { sAdvancementDepth++; }
static void DecAdvancementDepth() { sAdvancementDepth--; }
2016-04-10 14:22:59 -07:00
};
2018-12-07 21:30:43 -08:00
} // namespace urde