metaforce/Runtime/Character/CAnimTreeTweenBase.hpp

47 lines
1.7 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-04-10 14:22:59 -07:00
#include <memory>
#include <utility>
#include "Runtime/rstl.hpp"
#include "Runtime/Character/CAnimTreeDoubleChild.hpp"
2016-04-10 20:59:54 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2018-12-07 21:30:43 -08:00
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 = 0;
2018-12-07 21:30:43 -08:00
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
void VGetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out,
float w) const override;
float VGetRightChildWeight() const override { return GetBlendingWeight(); }
2016-09-03 19:27:35 -07:00
void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const override;
void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut, const CCharAnimTime& time) const override;
bool VHasOffset(const CSegId& seg) const override;
zeus::CVector3f VGetOffset(const CSegId& seg) const override;
zeus::CQuaternion VGetRotation(const CSegId& seg) const override;
2016-09-03 19:27:35 -07:00
std::optional<std::unique_ptr<IAnimReader>> VSimplified() override;
2021-06-07 12:29:18 -07:00
virtual std::optional<std::unique_ptr<IAnimReader>> VReverseSimplified() { 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
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce