stdlib/skelView source ↗
skel
23 items · generated by scribe fromstdlib/skel.fd· synced 2026-11-15
Contents
- Bone (struct)
- Skeleton (struct)
- skel_create (function)
- skel_add_bone (function)
- skel_find_bone (function)
- skel_compute_globals (function)
- skel_finalize (function)
- skel_bone_count (function)
- Keyframe (struct)
- AnimationTrack (struct)
- Animation (struct)
- skel_create_animation (function)
- skel_set_keyframe (function)
- skel_sample_animation (function)
- skel_compute_pose (function)
- VertexWeight (struct)
- Skin (struct)
- skel_create_skin (function)
- skel_set_vertex_weight (function)
- skel_skin_vertex (function)
- skel_blend_samples (function)
- skel_blend_poses (function)
Bone
pub struct Bone {Fields:
| Name | Type |
|---|---|
name | str |
parent | i64 |
local_pos | vec3 |
local_rot | quat |
local_scale | vec3 |
global_pos | vec3 |
global_rot | quat |
global_scale | vec3 |
offset_matrix | mat4 |
Defined at line 31
Skeleton
pub struct Skeleton {Fields:
| Name | Type |
|---|---|
bones | Vec<Bone> |
finalized | bool |
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 Skeletonparent:i64name:strpos:vec3rot: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:& Skeletonname: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:
| Name | Type |
|---|---|
time | f64 |
translation | vec3 |
rotation | quat |
scale | vec3 |
Defined at line 134
AnimationTrack
pub struct AnimationTrack {Fields:
| Name | Type |
|---|---|
keyframes | Vec<Keyframe> |
Defined at line 142
Animation
pub struct Animation {Fields:
| Name | Type |
|---|---|
name | str |
bone_count | i64 |
tracks | Vec<AnimationTrack> |
duration | f64 |
looping | bool |
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:strbone_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 Animationbone_idx:i64time:f64pos:vec3rot:quatscale: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:& Animationtime: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 Skeletonanim:& Animationtime:f64
Returns: void
Defined at line 270
VertexWeight
pub struct VertexWeight {Fields:
| Name | Type |
|---|---|
bone_indices | Vec<i64> |
bone_weights | Vec<f64> |
Defined at line 292
Skin
pub struct Skin {Fields:
| Name | Type |
|---|---|
weights | Vec<VertexWeight> |
bone_count | i64 |
Defined at line 298
skel_create_skin
pub fn skel_create_skin(vertex_count: i64, bone_count: i64) -> Skin {Parameters:
vertex_count:i64bone_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 Skinvertex_idx:i64b0:i64b1:i64b2:i64b3:i64w0:f64w1:f64w2:f64w3: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:& Skinskel:& Skeletonvertex_idx:i64pos: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 Skeletonanim_a:& Animationanim_b:& Animationtime_a:f64time_b:f64blend_weight:f64
Returns: void
Defined at line 384
Generated by scribe, the Fides documentation generator