![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
A rig: a flat, parent-before-child bone array plus its bind pose. More...
#include <skeleton_asset.h>
Public Member Functions | |
| int32_t | indexOf (std::string_view name) const |
The index of the bone called name, or -1 when the rig has none. | |
| Public Member Functions inherited from Vkm::Engine::Resource | |
| Resource (const Resource &other) | |
Duplicate other's contents and name, but not its identity. | |
| const std::string & | name () const noexcept |
| Serializable identity; non-empty and unique within its type once added. | |
| uint64_t | uid () const noexcept |
| Process-unique id stamped by add(); names the asset, not the slot it sits in. | |
| uint64_t | version () const noexcept |
| Change counter the backend keys GPU re-uploads on; moved by commit(). | |
| bool | isHidden () const noexcept |
| Added by ResourceManager::addPrivate: not user-facing, not saved. | |
| nlohmann::json & | sourceJson () |
| Mutable source JSON, allocating a null document if there is none. | |
| const nlohmann::json & | sourceJson () const |
| Const source JSON; asserts hasSource(), so guard the call with it. | |
Public Attributes | |
| std::vector< glm::mat4 > | inverseBind |
| Rig model space -> this bone's space, at bind. | |
| std::vector< Transform > | bindPose |
| Each bone's local TRS at bind, used wherever a clip has no channel for it. | |
A rig: a flat, parent-before-child bone array plus its bind pose.
Bones are indices, not entities. parent < index is validated by findSkeletonFault, so a pose composes in one forward loop and a cycle is unrepresentable. The three vectors are parallel.
| int32_t Vkm::Engine::SkeletonAsset::indexOf | ( | std::string_view | name | ) | const |
The index of the bone called name, or -1 when the rig has none.
Linear; resolve once and keep the index rather than calling it per frame.
| name | Bone name to look for. |
| std::vector<Transform> Vkm::Engine::SkeletonAsset::bindPose |
Each bone's local TRS at bind, used wherever a clip has no channel for it.
Stored: deriving it from inverseBind is lossy once a bone carries scale.