metaforce/Runtime/Character/CAnimTreeNode.hpp

41 lines
1.3 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CANIMTREENODE_HPP__
#define __URDE_CANIMTREENODE_HPP__
2016-04-10 21:22:59 +00:00
#include "IAnimReader.hpp"
namespace urde
{
class CAnimTreeNode : public IAnimReader
{
2016-08-27 04:54:53 +00:00
protected:
2016-04-11 03:59:54 +00:00
std::string x4_name;
public:
2017-11-13 06:19:18 +00:00
CAnimTreeNode(std::string_view name) : x4_name(name) {}
2016-04-11 03:59:54 +00:00
bool IsCAnimTreeNode() const {return true;}
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 {};
}
2016-04-11 23:35:37 +00:00
2016-08-27 04:54:53 +00:00
virtual u32 Depth() const=0;
virtual CAnimTreeEffectiveContribution VGetContributionOfHighestInfluence() const=0;
2016-04-12 06:15:32 +00:00
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); }
2016-04-12 06:15:32 +00:00
2016-08-27 21:16:44 +00:00
CAnimTreeEffectiveContribution GetContributionOfHighestInfluence() const;
2016-04-11 23:35:37 +00:00
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
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CANIMTREENODE_HPP__