![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Every rig's pose for one frame, published on FrameContext::poses. More...
#include <pose_buffer.h>
Public Member Functions | |
| void | clear () |
| Drop last frame's slices and mapping, keeping the capacity. | |
| uint32_t | addSlice (uint32_t boneCount) |
Reserve boneCount consecutive bones for one rig. | |
| void | mapEntity (EntityId entity, uint32_t slice) |
Record that entity is driven by slice. | |
| PoseWrite | writeTo (uint32_t slice) |
Writable view of slice, for composing its pose. | |
| const PoseSlice * | sliceOf (EntityId entity) const |
The slice driving entity. | |
Every rig's pose for one frame, published on FrameContext::poses.
A per-frame product, not a component: rebuilt whenever the rigs are posed, authored by no one, and read by several mesh entities per rig. global is the pose in rig model space; palette is global[b] * inverseBind[b] for the vertex stage, kept beside the pose rather than overwriting it.
| uint32_t Vkm::Engine::PoseBuffer::addSlice | ( | uint32_t | boneCount | ) |
Reserve boneCount consecutive bones for one rig.
Invalidates every PoseWrite handed out earlier: allocate every slice before composing any.
| boneCount | Bones the rig has. |
| void Vkm::Engine::PoseBuffer::mapEntity | ( | EntityId | entity, |
| uint32_t | slice ) |
Record that entity is driven by slice.
| entity | Entity the slice poses, generation included. |
| slice | Slice index returned by addSlice(). |
| PoseWrite Vkm::Engine::PoseBuffer::writeTo | ( | uint32_t | slice | ) |
Writable view of slice, for composing its pose.
Writes nothing, so distinct slices may be filled from several threads at once.
| slice | Slice index returned by addSlice(). |
The slice driving entity.
Keyed on the whole id, not the slot: the map is read every frame until the next tick, and a slot reused in between must not skin a new entity from another rig's matrices.
| entity | Entity to look up. |