vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::SkeletonAsset Struct Reference

A rig: a flat, parent-before-child bone array plus its bind pose. More...

#include <skeleton_asset.h>

Inheritance diagram for Vkm::Engine::SkeletonAsset:
Vkm::Engine::Resource

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.

Detailed Description

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.

Member Function Documentation

◆ indexOf()

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.

Parameters
nameBone name to look for.
Returns
Index into bones, or -1.

Member Data Documentation

◆ bindPose

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.


The documentation for this struct was generated from the following file: