Commit b179235
authored
feat: animations (#45)
* Add animation system with skeleton and bone support
- Implemented Animation, Animator, Bone, and Skeleton classes to handle skeletal animations.
- Added AnimationComponent to manage animations within entities.
- Integrated animation loading in the Model class, supporting multiple animations.
- Created AnimationSystem to update animations based on input and delta time.
- Enhanced ForwardRenderer to support animated meshes with bone transformations.
- Introduced UniformBuffer class for efficient bone matrix handling in shaders.
- Updated MeshRendererComponent to indicate if a mesh uses bones for skinning.
- Added deserialization for AnimationComponent to load animation data from JSON.
* fix(animation): fix inlcudes
* feat(animation): implement skinned animation support in vertex shader
* refactor(animation): update animation system and remove skeleton.cpp
* feat(animation): enhance animation system with node animation support and refactor bone handling
* refactor(animation): update processNode to use pointer for skeleton nodes
* fix(animation): correct isFinished logic to account for looping animations
* feat(animation): enhance animation system with clip management and speed control
* refactor(animation): clean up bones uniform buffer management and remove commented code
* fix(animation): optimize bone transformation calculation by reusing global inverse matrix
* perf(model): add optimize graph flag
* fix(animation): handle left-handed axis Y up models
* fix(c_cpp_properties): add include paths for animator.hpp bug
* feat(animation): add new enemy model and animations for 'mundo'
* feat(animation): add new enemy models and animations for 'shaco' and 'yummi'
* refactor(animation): simplify BoneAnimation constructor by removing BoneID parameter
* feat(animation): enhance model loading to support animations and update asset paths
* chore: fix compilation error
* feat(animation): add playDuration method to AnimationComponent for timed playback of animations
* refactor(animation): remove unused includes from animation-system.hpp
* refactor(model): remove unused scene parameter from processVertexBoneData methods
* refactor(uniform-buffer): disable copying of UniformBuffer class
* refactor(uniform-buffer): add assertions for input validation in UniformBuffer constructor and update method
* refactor(animation): clear ununsed enemy definitions in playground configurations
* fix(model): set global inverse transform for skeleton when animations are present
* fix(animator): include cmath for std::fmod usage
* fix(animator): update MAX_BONES definition to modern c++ and change to 128
* fix(animation): enhance key interpolation to handle empty vectors and avoid division by zero
* feat(shader): add getUniformBlockBinding caching
* fix(animation): initialize model and defaultClip to avoid uninitialized usage
* feat(renderer): optimize bone matrix updates by caching last uploaded animator
* feat(animation): enhance play method to support force restart and improve isFinished logic
* fix(animation): ensure animator updates before checking if animation is finished
* fix(animation): correct isFinished logic to account for looping animations
* fix(animation): use findBone instead of manual reading from animation channels
* fix(model): fix cache key for model texture1 parent 221ce6f commit b179235
28 files changed
Lines changed: 2284 additions & 42 deletions
File tree
- .vscode
- assets
- gltf/enemies
- shaders
- config/playgrounds
- src
- common
- animation
- components
- model
- shader
- systems
- uniform-buffer
- game/systems
- states
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
25 | 58 | | |
26 | 59 | | |
27 | | - | |
28 | 60 | | |
29 | | - | |
30 | 61 | | |
31 | | - | |
| 62 | + | |
32 | 63 | | |
33 | 64 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
38 | 68 | | |
39 | 69 | | |
0 commit comments