Shared skinned rig — skeleton + bind-pose meshes + joint map.
More...
#include <CharacterRig.hpp>
|
| | CharacterRig () |
| | ~CharacterRig () |
| | CharacterRig (const CharacterRig &)=delete |
| CharacterRig & | operator= (const CharacterRig &)=delete |
| | CharacterRig (CharacterRig &&) noexcept |
| CharacterRig & | operator= (CharacterRig &&) noexcept |
| bool | loadFromFBX (const std::string &path, const glm::quat &orientationFix=glm::quat(1.0f, 0.0f, 0.0f, 0.0f), bool flipNormals=false, bool flipUVs=false) |
| | Load rig from an FBX/GLB file.
|
| bool | isLoaded () const noexcept |
| | True after a successful loadFromFBX().
|
| int | numJoints () const noexcept |
| | Number of skeleton joints. 0 if not loaded.
|
| const ozz::animation::Skeleton * | skeleton () const noexcept |
| | ozz skeleton (owning). Null if not loaded.
|
| const std::vector< glm::mat4 > & | inverseBindMatrices () const noexcept |
| | Inverse bind matrices, one per joint (identity for structural joints).
|
| const std::vector< RigMeshData > & | meshes () const noexcept |
| | Per-mesh bind-pose + weight data.
|
| const std::unordered_map< std::string, int > & | jointMap () const noexcept |
| | Joint name → runtime index map.
|
| const std::unordered_map< std::string, anim_utils::JointRestPose > & | restPoses () const noexcept |
| | Rest-pose local transforms keyed by joint name (used by the animation library to build single-key tracks for joints that lack an animation channel in a given clip).
|
| void | verticalBounds (float &outMinY, float &outMaxY) const |
| | Compute the vertical (Y) extent of the bind-pose mesh.
|
Shared skinned rig — skeleton + bind-pose meshes + joint map.
Loaded once from a single FBX (the one containing skin data, e.g. standard_walk.fbx). Animation clips come from AnimationLibrary on top of this rig. Per-entity state lives in CharacterAnimator.
◆ CharacterRig() [1/3]
| CharacterRig::CharacterRig |
( |
| ) |
|
◆ ~CharacterRig()
| CharacterRig::~CharacterRig |
( |
| ) |
|
|
default |
◆ CharacterRig() [2/3]
◆ CharacterRig() [3/3]
◆ inverseBindMatrices()
| const std::vector< glm::mat4 > & CharacterRig::inverseBindMatrices |
( |
| ) |
const |
|
nodiscardnoexcept |
Inverse bind matrices, one per joint (identity for structural joints).
◆ isLoaded()
| bool CharacterRig::isLoaded |
( |
| ) |
const |
|
nodiscardnoexcept |
◆ jointMap()
| const std::unordered_map< std::string, int > & CharacterRig::jointMap |
( |
| ) |
const |
|
nodiscardnoexcept |
Joint name → runtime index map.
◆ loadFromFBX()
| bool CharacterRig::loadFromFBX |
( |
const std::string & | path, |
|
|
const glm::quat & | orientationFix = glm::quat(1.0f, 0.0f, 0.0f, 0.0f), |
|
|
bool | flipNormals = false, |
|
|
bool | flipUVs = false ) |
Load rig from an FBX/GLB file.
- Parameters
-
| path | Absolute path to a file with a skin-weighted mesh. |
| orientationFix | Rotation prepended to the skeleton root so the whole rig (render mesh, joint frames, hitboxes) is re-oriented consistently. Defaults to identity. Needed when a re-export changes the up/forward axis convention (e.g. a glTF export of a rig whose armature carried an unapplied 90° rotation). |
| flipNormals | Negate every bind-pose vertex normal. Defaults to false. Use when an export inverts normal/winding handedness so the lit surface faces the wrong way. |
| flipUVs | Apply aiProcess_FlipUVs. Defaults to false. Matches the static model loader's glTF-vs-DCC convention so skinned viewmodel meshes sample their textures right-side-up. |
- Returns
- True on success (skeleton built + at least one skinned mesh).
◆ meshes()
| const std::vector< RigMeshData > & CharacterRig::meshes |
( |
| ) |
const |
|
nodiscardnoexcept |
Per-mesh bind-pose + weight data.
◆ numJoints()
| int CharacterRig::numJoints |
( |
| ) |
const |
|
nodiscardnoexcept |
Number of skeleton joints. 0 if not loaded.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ restPoses()
Rest-pose local transforms keyed by joint name (used by the animation library to build single-key tracks for joints that lack an animation channel in a given clip).
◆ skeleton()
| const ozz::animation::Skeleton * CharacterRig::skeleton |
( |
| ) |
const |
|
nodiscardnoexcept |
ozz skeleton (owning). Null if not loaded.
◆ verticalBounds()
| void CharacterRig::verticalBounds |
( |
float & | outMinY, |
|
|
float & | outMaxY ) const |
Compute the vertical (Y) extent of the bind-pose mesh.
Scans all vertices across all meshes and returns the minimum and maximum Y coordinates. Used to auto-calculate the rig scale so the animated model matches the player's collision AABB height.
◆ impl_
| std::unique_ptr<Impl> CharacterRig::impl_ |
|
private |
The documentation for this class was generated from the following files: