15 #ifndef MOTIVE_COMMON_H_
16 #define MOTIVE_COMMON_H_
20 #include "mathfu/glsl_mappings.h"
24 class MotiveProcessor;
33 typedef const char** MotivatorType;
34 static const MotivatorType kMotivatorTypeInvalid =
nullptr;
40 typedef int32_t MotiveIndex;
41 static const MotiveIndex kMotiveIndexInvalid =
static_cast<MotiveIndex
>(-1);
48 typedef MotiveIndex MotiveDimension;
54 typedef uint32_t MotiveChildIndex;
59 typedef int MotiveTime;
60 static const MotiveTime kMotiveTimeEndless =
61 std::numeric_limits<MotiveTime>::max();
69 typedef uint8_t BoneIndex;
70 static const BoneIndex kMaxNumBones = 254;
71 static const BoneIndex kInvalidBoneIdx = 255;
82 typedef uint8_t MatrixOpId;
83 static const MatrixOpId kMaxMatrixOpId = 254;
84 static const MatrixOpId kInvalidMatrixOpId = 255;
97 MotivatorType type()
const {
return type_; }
98 void set_type(MotivatorType type) { type_ = type; }
107 #define MOTIVE_INTERFACE() \
108 static const char* kName; \
109 static const motive::MotivatorType kType; \
110 static void Register()
116 #define MOTIVE_INSTANCE(InitType, ProcessorType) \
117 static motive::MotiveProcessor* ProcessorType##Create() { \
118 return new ProcessorType(); \
120 static void ProcessorType##Destroy(motive::MotiveProcessor* p) { delete p; } \
121 void InitType::Register() { \
122 const motive::MotiveProcessorFunctions functions(ProcessorType##Create, \
123 ProcessorType##Destroy); \
124 motive::MotiveEngine::RegisterProcessorFactory(InitType::kType, \
127 const char* InitType::kName = #ProcessorType; \
128 const motive::MotivatorType InitType::kType = &InitType::kName
132 #define MOTIVE_ARRAY_SIZE(a) \
133 ((sizeof(a) / sizeof(*(a))) / \
134 static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
138 #define MOTIVE_DISALLOW_COPY_AND_ASSIGN(TypeName) \
139 TypeName(const TypeName&); \
140 void operator=(const TypeName&)
143 #define MOTIVE_OUTPUT_DEBUG_CURVES_IN_TESTS
147 #endif // MOTIVE_COMMON_H_
MotivatorInit(MotivatorType type)
The derived class's constructor should set 'type'.
Definition: common.h:95