group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
AnimationLibrary.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <cstdint>
7#include <memory>
8#include <string>
9
11{
12class Animation;
13}
14
15class CharacterRig;
16
43
45const char* clipName(ClipId id);
46
48const char* clipFile(ClipId id);
49
55{
56public:
62 AnimationLibrary& operator=(AnimationLibrary&&) noexcept;
63
69 bool loadClipFromFBX(const CharacterRig& rig, ClipId id, const std::string& path);
70
72 [[nodiscard]] bool has(ClipId id) const;
73
75 [[nodiscard]] const ozz::animation::Animation* get(ClipId id) const;
76
78 [[nodiscard]] float duration(ClipId id) const;
79
80private:
81 struct Impl;
82 std::unique_ptr<Impl> impl_;
83};
ClipId
Enumerated clip IDs.
Definition AnimationLibrary.hpp:21
@ Jump
Airborne jump animation.
@ CrouchWalkRight
@ StrafeLeft
Running strafe left.
@ TurnRight90
90-degree turn right (standing).
@ CrouchWalkLeft
@ CrouchWalk
@ TurnLeft90
90-degree turn left (standing).
@ StrafeRight
Running strafe right.
@ CrouchWalkBackward
@ CrouchIdle
@ StrafeRightWalk
Walking strafe right.
@ _Count
Sentinel; also used as "no clip / no override".
@ StrafeLeftWalk
Walking strafe left.
@ RunBackward
const char * clipName(ClipId id)
Human-readable name for a clip (for UI / logging).
Definition AnimationLibrary.cpp:42
const char * clipFile(ClipId id)
Filename (relative to assets/animations/) for a clip.
Definition AnimationLibrary.cpp:89
Collection of animation clips loaded on top of a shared skeleton.
Definition AnimationLibrary.hpp:55
const ozz::animation::Animation * get(ClipId id) const
Pointer to the loaded clip, or null if not loaded.
Definition AnimationLibrary.cpp:157
AnimationLibrary(const AnimationLibrary &)=delete
AnimationLibrary()
Definition AnimationLibrary.cpp:146
AnimationLibrary(AnimationLibrary &&) noexcept
float duration(ClipId id) const
Duration of the clip in seconds (0 if not loaded).
Definition AnimationLibrary.cpp:163
bool has(ClipId id) const
True if a clip has been loaded for id.
Definition AnimationLibrary.cpp:151
bool loadClipFromFBX(const CharacterRig &rig, ClipId id, const std::string &path)
Load one clip from an FBX file onto the rig's skeleton.
Definition AnimationLibrary.cpp:169
AnimationLibrary & operator=(const AnimationLibrary &)=delete
Shared skinned rig — skeleton + bind-pose meshes + joint map.
Definition CharacterRig.hpp:42
Definition AnimationLibrary.hpp:11
Definition AnimationLibrary.hpp:11
Definition AnimationLibrary.cpp:142