Cogs.Core
AnimationComponent.cpp
1#include "AnimationComponent.h"
2
3#include "Types.h"
4
5using namespace Cogs::Reflection;
6
7void Cogs::Core::AnimationComponent::registerType()
8{
9 Field fields[] = {
11 Field("clipIndex", &AnimationComponent::clipIndex).add(ComponentModel::RangeAttribute(-1, 10)), // Guestimate Max
14 };
15
16 TypeDatabase::createType<AnimationComponent>()
17 .setBase<Component>()
18 .setFields(fields);
19}
Field definition describing a single data member of a data structure.
Definition: Field.h:68
Field & add(T attribute)
Adds the given attribute.
Definition: Field.h:177
Contains reflection support.
Definition: Component.h:11
Adds range information to an object.
Definition: Attributes.h:38
float timeOffset
Animation time offset in seconds.
int clipIndex
Active index of the Animation Clips. -1 = freeze Animation.
AnimationHandle animation
Animation resource handle.
float timeFactor
Animation Time Scale factor.