Skip to content

stdlib/skelView source ↗

skel

23 items · generated by scribe fromstdlib/skel.fd· synced 2026-11-15

stdlib/skel23 items

Contents

Bone

pub struct Bone {

Fields:

NameType
namestr
parenti64
local_posvec3
local_rotquat
local_scalevec3
global_posvec3
global_rotquat
global_scalevec3
offset_matrixmat4

Defined at line 31


Skeleton

pub struct Skeleton {

Fields:

NameType
bonesVec<Bone>
finalizedbool

Defined at line 50


skel_create

pub fn skel_create() -> Skeleton {

Returns: Skeleton

Defined at line 55


skel_add_bone

Add a bone to the skeleton. Returns the bone index.

pub fn skel_add_bone(skel: & mut Skeleton, parent: i64, name: str, pos: vec3, rot: quat) -> i64 {

Parameters:

  • skel: & mut Skeleton
  • parent: i64
  • name: str
  • pos: vec3
  • rot: quat

Returns: i64

Defined at line 62


skel_find_bone

Get bone index by name. Returns -1 if not found.

pub fn skel_find_bone(skel: & Skeleton, name: str) -> i64 {

Parameters:

  • skel: & Skeleton
  • name: str

Returns: i64

Defined at line 71


skel_compute_globals

Compute global transforms for all bones (forward kinematics).

pub fn skel_compute_globals(skel: & mut Skeleton) -> void {

Parameters:

  • skel: & mut Skeleton

Returns: void

Defined at line 83


skel_finalize

Finalize the skeleton: compute globals and inverse bind matrices.

pub fn skel_finalize(skel: & mut Skeleton) -> void {

Parameters:

  • skel: & mut Skeleton

Returns: void

Defined at line 107


skel_bone_count

Get the number of bones.

pub fn skel_bone_count(skel: & Skeleton) -> i64 {

Parameters:

  • skel: & Skeleton

Returns: i64

Defined at line 128


Keyframe

pub struct Keyframe {

Fields:

NameType
timef64
translationvec3
rotationquat
scalevec3

Defined at line 134


AnimationTrack

pub struct AnimationTrack {

Fields:

NameType
keyframesVec<Keyframe>

Defined at line 142


Animation

pub struct Animation {

Fields:

NameType
namestr
bone_counti64
tracksVec<AnimationTrack>
durationf64
loopingbool

Defined at line 146


skel_create_animation

Create an animation with the given name and bone count.

pub fn skel_create_animation(name: str, bone_count: i64) -> Animation {

Parameters:

  • name: str
  • bone_count: i64

Returns: Animation

Defined at line 156


skel_set_keyframe

Add a keyframe to a bone’s track.

pub fn skel_set_keyframe(anim: & mut Animation, bone_idx: i64, time: f64, pos: vec3, rot: quat, scale: vec3) -> void {

Parameters:

  • anim: & mut Animation
  • bone_idx: i64
  • time: f64
  • pos: vec3
  • rot: quat
  • scale: vec3

Returns: void

Defined at line 171


skel_sample_animation

Sample an animation at a given time, producing local transforms per bone. Returns a vector of Keyframe (one per bone).

pub fn skel_sample_animation(anim: & Animation, time: f64) -> Vec<Keyframe> {

Parameters:

  • anim: & Animation
  • time: f64

Returns: Vec<Keyframe>

Defined at line 208


skel_compute_pose

Compute the global pose of a skeleton at a given animation time. Updates the skeleton’s bone global transforms.

pub fn skel_compute_pose(skel: & mut Skeleton, anim: & Animation, time: f64) -> void {

Parameters:

  • skel: & mut Skeleton
  • anim: & Animation
  • time: f64

Returns: void

Defined at line 270


VertexWeight

pub struct VertexWeight {

Fields:

NameType
bone_indicesVec<i64>
bone_weightsVec<f64>

Defined at line 292


Skin

pub struct Skin {

Fields:

NameType
weightsVec<VertexWeight>
bone_counti64

Defined at line 298


skel_create_skin

pub fn skel_create_skin(vertex_count: i64, bone_count: i64) -> Skin {

Parameters:

  • vertex_count: i64
  • bone_count: i64

Returns: Skin

Defined at line 303


skel_set_vertex_weight

Set vertex skin weights.

pub fn skel_set_vertex_weight(skin: & mut Skin, vertex_idx: i64, b0: i64, b1: i64, b2: i64, b3: i64, w0: f64, w1: f64, w2: f64, w3: f64) -> void {

Parameters:

  • skin: & mut Skin
  • vertex_idx: i64
  • b0: i64
  • b1: i64
  • b2: i64
  • b3: i64
  • w0: f64
  • w1: f64
  • w2: f64
  • w3: f64

Returns: void

Defined at line 325


skel_skin_vertex

Skin a vertex: compute final position from bone transforms and weights.

pub fn skel_skin_vertex(skin: & Skin, skel: & Skeleton, vertex_idx: i64, pos: vec3) -> vec3 {

Parameters:

  • skin: & Skin
  • skel: & Skeleton
  • vertex_idx: i64
  • pos: vec3

Returns: vec3

Defined at line 342


skel_blend_samples

Blend two animation samples with a weight factor.

pub fn skel_blend_samples(a: Vec<Keyframe>, b: Vec<Keyframe>, weight: f64) -> Vec<Keyframe> {

Parameters:

  • a: Vec<Keyframe>
  • b: Vec<Keyframe>
  • weight: f64

Returns: Vec<Keyframe>

Defined at line 369


skel_blend_poses

Blend two animations and compute the resulting pose.

pub fn skel_blend_poses(skel: & mut Skeleton, anim_a: & Animation, anim_b: & Animation, time_a: f64, time_b: f64, blend_weight: f64) -> void {

Parameters:

  • skel: & mut Skeleton
  • anim_a: & Animation
  • anim_b: & Animation
  • time_a: f64
  • time_b: f64
  • blend_weight: f64

Returns: void

Defined at line 384


Generated by scribe, the Fides documentation generator