4#ifndef TRAM_SDK_COMPONENTS_ARMATURECOMPONENT_H
5#define TRAM_SDK_COMPONENTS_ARMATURECOMPONENT_H
25 void Play(
name_t animation_name, uint32_t repeats,
float weight,
float speed,
bool interpolate =
true,
bool pause_on_last_frame =
false);
39 void SetFade(
name_t animation_name,
bool fade_in,
float fade_length);
73 size_t armature_bone_count = 0;
81 template <
typename>
friend class Pool;
Definition: animation.h:13
ResourceProxy< Render::Model > model
Definition: animation.h:68
Render::Pose * GetPose()
Definition: animation.h:20
Render::Model * GetModel()
Definition: animation.h:19
bool IsPlaying(name_t animation_name)
Returns true if an animation is playing.
Definition: animation.cpp:233
void Stop(name_t animation_name)
Stops an animation if its playing.
Definition: animation.cpp:147
void SetFade(name_t animation_name, bool fade_in, float fade_length)
Fades in or fades out an animation.
Definition: animation.cpp:252
void FindKeyframePointers(size_t animation_index)
Extracts pointers to keyframes from animation data.
Definition: animation.cpp:119
AnimationPlaybackInfo anim_info[ANIM_COUNT]
Definition: animation.h:77
void SetKeyframe(name_t bone_name, const Render::Keyframe &keyframe)
Sets procedural animation keyframe.
Definition: animation.cpp:54
void SetWeight(name_t animation_name, float weight)
Sets the weight of an animation.
Definition: animation.cpp:203
static void Update()
Updates all of the armatures.
Definition: animation.cpp:266
void Start()
Definition: animation.cpp:34
void SetPause(name_t animation_name, bool pause)
Sets animation's pause state.
Definition: animation.cpp:168
void Pause(name_t animation_name)
Pauses an animation.
Definition: animation.cpp:180
void SetOnAnimationFinishCallback(void(*callback)(AnimationComponent *, name_t))
Definition: animation.h:23
void SetModel(Render::Model *model)
Definition: animation.h:17
Render::Pose * pose
Definition: animation.h:67
name_t anim_playing[ANIM_COUNT]
Definition: animation.h:74
void SetFrame(name_t animation_name, float frame)
Sets an animation to a specific frame.
Definition: animation.cpp:273
void FadeIn(name_t animation_name, float length)
Fades in an animation.
Definition: animation.cpp:193
void SetRepeats(name_t animation_name, uint32_t repeats)
Sets the repeats of an animation.
Definition: animation.cpp:223
void(* anim_finish_callback)(AnimationComponent *, name_t)
Definition: animation.h:70
~AnimationComponent()
Definition: animation.cpp:24
void SetSpeed(name_t animation_name, float speed)
Sets the speed of an animation.
Definition: animation.cpp:213
void Continue(name_t animation_name)
Continues an animation.
Definition: animation.cpp:187
void Init()
Definition: animation.cpp:10
void EventHandler(Event &event)
Definition: animation.h:43
void SetModel(name_t model)
Definition: animation.h:18
static const size_t ANIM_COUNT
Definition: animation.h:46
void Play(name_t animation_name, uint32_t repeats, float weight, float speed, bool interpolate=true, bool pause_on_last_frame=false)
Plays an animation.
Definition: animation.cpp:76
void FadeOut(name_t animation_name, float length)
Fades out an animation.
Definition: animation.cpp:198
AnimationComponent()
Definition: animation.h:79
Render::Keyframe base_pose[Render::BONE_COUNT]
Definition: animation.h:65
void Refresh()
Updates an armature.
Definition: animation.cpp:284
Definition: entitycomponent.h:18
static Model * Find(name_t name)
Definition: model.cpp:32
Definition: resource.h:47
std::pair< name_t, uint64_t > NameCount
Definition: animation.h:17
const size_t BONE_COUNT
Definition: animation.h:18
UID name_t
Definition: uid.h:40
Definition: animation.h:47
bool fade_out
Definition: animation.h:56
float fade_speed
Definition: animation.h:52
bool fade_in
Definition: animation.h:55
bool pause_on_last_frame
Definition: animation.h:58
float speed
Definition: animation.h:50
bool interpolate
Definition: animation.h:54
bool pause
Definition: animation.h:57
Render::NameCount * keyframe_headers[Render::BONE_COUNT]
Definition: animation.h:60
uint32_t repeats
Definition: animation.h:48
float weight
Definition: animation.h:49
Render::NameCount * animation_header
Definition: animation.h:59
float frame
Definition: animation.h:51
float fade_ammount
Definition: animation.h:53
Definition: animation.h:20
Definition: animation.h:28
Definition: animation.h:36