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 <string>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/Character/IAnimReader.hpp"
|
2016-04-10 21:22:59 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-04-10 21:22:59 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CAnimTreeNode : public IAnimReader {
|
2016-08-27 04:54:53 +00:00
|
|
|
protected:
|
2018-12-08 05:30:43 +00:00
|
|
|
std::string x4_name;
|
|
|
|
|
2016-04-11 03:59:54 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CAnimTreeNode(std::string_view name) : x4_name(name) {}
|
2019-08-09 19:46:49 +00:00
|
|
|
bool IsCAnimTreeNode() const override { return true; }
|
2018-12-08 05:30:43 +00:00
|
|
|
static std::shared_ptr<CAnimTreeNode> Cast(std::unique_ptr<IAnimReader>&& ptr) {
|
|
|
|
if (ptr->IsCAnimTreeNode())
|
|
|
|
return std::static_pointer_cast<CAnimTreeNode>(std::shared_ptr<IAnimReader>(std::move(ptr)));
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual u32 Depth() const = 0;
|
|
|
|
virtual CAnimTreeEffectiveContribution VGetContributionOfHighestInfluence() const = 0;
|
|
|
|
virtual u32 VGetNumChildren() const = 0;
|
|
|
|
virtual std::shared_ptr<IAnimReader> VGetBestUnblendedChild() const = 0;
|
|
|
|
virtual void VGetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out,
|
|
|
|
float w) const = 0;
|
|
|
|
void GetWeightedReaders(rstl::reserved_vector<std::pair<float, std::weak_ptr<IAnimReader>>, 16>& out, float w) const {
|
|
|
|
VGetWeightedReaders(out, w);
|
|
|
|
}
|
|
|
|
|
|
|
|
CAnimTreeEffectiveContribution GetContributionOfHighestInfluence() const;
|
|
|
|
u32 GetNumChildren() const;
|
|
|
|
std::shared_ptr<IAnimReader> GetBestUnblendedChild() const;
|
|
|
|
|
|
|
|
std::string_view GetName() const { return x4_name; }
|
2016-04-10 21:22:59 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|