metaforce/Runtime/Character/IMetaAnim.hpp

59 lines
1.6 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_IMETAANIM_HPP__
#define __URDE_IMETAANIM_HPP__
2015-08-22 01:58:41 +00:00
#include "../RetroTypes.hpp"
2016-04-11 07:10:28 +00:00
#include "CCharAnimTime.hpp"
2016-04-10 21:22:59 +00:00
#include <set>
2015-08-22 01:58:41 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-22 01:58:41 +00:00
{
2016-04-10 21:22:59 +00:00
class CAnimTreeNode;
class CAnimSysContext;
class CMetaAnimTreeBuildOrders;
class CPrimitive;
2016-04-11 07:10:28 +00:00
class IAnimReader;
2016-04-10 21:22:59 +00:00
enum class EMetaAnimType
{
Primitive,
Blend,
PhaseBlend,
Random,
Sequence
};
2015-08-22 01:58:41 +00:00
2016-04-11 07:10:28 +00:00
class CPreAdvanceIndicator
{
bool x0_isTime;
CCharAnimTime x4_time;
const char* xc_string;
public:
CPreAdvanceIndicator(const CCharAnimTime& time)
: x0_isTime(true), x4_time(time) {}
CPreAdvanceIndicator(const char* string)
: x0_isTime(false), xc_string(string) {}
const char* GetString() const {return xc_string;}
bool IsString() const {return !x0_isTime;}
const CCharAnimTime& GetTime() const {return x4_time;}
bool IsTime() const {return x0_isTime;}
};
2015-08-22 01:58:41 +00:00
class IMetaAnim
{
2016-04-10 21:22:59 +00:00
public:
virtual ~IMetaAnim() = default;
virtual std::shared_ptr<CAnimTreeNode> GetAnimationTree(const CAnimSysContext& animSys,
2016-04-11 07:10:28 +00:00
const CMetaAnimTreeBuildOrders& orders) const;
2016-04-10 21:22:59 +00:00
virtual void GetUniquePrimitives(std::set<CPrimitive>& primsOut) const=0;
virtual EMetaAnimType GetType() const=0;
virtual std::shared_ptr<CAnimTreeNode> VGetAnimationTree(const CAnimSysContext& animSys,
const CMetaAnimTreeBuildOrders& orders) const=0;
2016-04-11 07:10:28 +00:00
static void AdvanceAnim(IAnimReader& anim, const CCharAnimTime& dt);
CCharAnimTime GetTime(const CPreAdvanceIndicator& ind, const IAnimReader& anim);
2015-08-22 01:58:41 +00:00
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_IMETAANIM_HPP__