2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-10 21:22:59 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "Runtime/rstl.hpp"
|
|
|
|
#include "Runtime/Character/CAnimTreeDoubleChild.hpp"
|
2016-04-11 03:59:54 +00:00
|
|
|
|
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
|
|
|
|
2019-08-09 19:46:49 +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
|
|
|
|
2019-08-09 19:46:49 +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
|
|
|
|
2019-08-09 19:46:49 +00:00
|
|
|
std::optional<std::unique_ptr<IAnimReader>> VSimplified() override;
|
2019-06-12 02:05:17 +00:00
|
|
|
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
|