metaforce/Runtime/Character/CAnimTreeTweenBase.hpp

47 lines
1.7 KiB
C++
Raw Permalink Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-04-10 21:22:59 +00:00
#include <memory>
#include <utility>
#include "Runtime/rstl.hpp"
#include "Runtime/Character/CAnimTreeDoubleChild.hpp"
2016-04-11 03:59:54 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce {
2018-12-08 05:30:43 +00:00
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 = 0;
2018-12-08 05:30:43 +00:00
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
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-04 02:27:35 +00: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-04 02:27:35 +00:00
std::optional<std::unique_ptr<IAnimReader>> VSimplified() override;
2021-06-07 19:29:18 +00:00
virtual std::optional<std::unique_ptr<IAnimReader>> VReverseSimplified() { 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
};
2021-04-10 08:42:06 +00:00
} // namespace metaforce