AnimationComponent struct in Thread
Plays an animation clip on an entity. Two paths share one component: skeletal
(GPU bone skinning of a rigged MeshComponent) when a Skeleton is
present, and object animation (keyframing the entity's own transform) when it
is not. The AnimationSystem advances Time each frame and, for skeletal clips, fills
FinalBoneMatrices which the mesh shader consumes.
Properties
| ClipPath | std::string | Animation asset (VFS path). |
| Clip | std::shared_ptr<AnimationClip> | Loaded keyframe data. |
| Skeleton | std::shared_ptr<Skeleton> | Bone hierarchy + offsets; presence selects the skeletal path. |
| Time | float | Current play time (seconds). |
| Speed | float | Playback speed multiplier. |
| Playing | bool | Advance Time each frame. |
| Loop | bool | Wrap at the end instead of stopping. |
Runtime
| FinalBoneMatrices | std::vector<Mat4> | Skinning matrices (size = Skeleton bone count) uploaded to the shader. |
Quickest way to add one: drag an
.anim from the
Content Browser onto a character, in the viewport or the hierarchy. It gets an Animation Component
playing that clip, on whichever entity of the model carries the skinned mesh (the skeleton is wired
from a mesh on the same entity).Skinning is GPU-side: vertex bone weights come in through the mesh import,
and the shader multiplies by
u_Bones[]. The AnimationSystem auto-wires the skeleton
onto a rigged mesh. Edit and scrub clips in the editor's Animation panel.AnimationComponent struct w Thread
Odtwarza klip animacji na encji. Jeden komponent obsługuje dwie ścieżki: szkieletową
(skinning kości na GPU dla zriggowanego MeshComponent), gdy jest
Skeleton, oraz animację obiektu (klatki kluczowe własnej transformacji encji), gdy
go nie ma. AnimationSystem co klatkę przesuwa Time, a dla klipów szkieletowych wypełnia
FinalBoneMatrices, z których korzysta shader siatki.
Właściwości
| ClipPath | std::string | Asset animacji (ścieżka VFS). |
| Clip | std::shared_ptr<AnimationClip> | Wczytane klatki kluczowe. |
| Skeleton | std::shared_ptr<Skeleton> | Hierarchia kości i offsety; jego obecność wybiera ścieżkę szkieletową. |
| Time | float | Bieżący czas odtwarzania (sekundy). |
| Speed | float | Mnożnik szybkości odtwarzania. |
| Playing | bool | Przesuwaj Time co klatkę. |
| Loop | bool | Na końcu zawijaj zamiast się zatrzymać. |
W czasie działania
| FinalBoneMatrices | std::vector<Mat4> | Macierze skinningu (rozmiar = liczba kości szkieletu) wysyłane do shadera. |
Najszybszy sposób: przeciągnij plik
.anim z Content
Browsera na postać, w viewporcie albo w hierarchii. Dostanie Animation Component grający ten klip, na
tej encji modelu, która ma skinowany mesh (szkielet podpina się z meshu na tej samej encji).Skinning dzieje się na GPU: wagi kości wierzchołków przychodzą z importu siatki, a
shader mnoży przez
u_Bones[]. AnimationSystem sam podpina szkielet do zriggowanej
siatki. Klipy edytujesz i przewijasz w panelu Animation edytora.