1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Skeleton + Skin — rigging primitives for skeletal animation.
//!
//! A [`Skeleton`] is the static rest-pose: an ordered list of joint
//! [`NodeId`]s plus the inverse bind matrix that takes a vertex from
//! mesh-local space into joint-local space at rest. The render-time
//! transform per vertex is `sum_i weight[i] * joint_world[i] * inverse_bind[i] * pos`.
//!
//! A [`Skin`] is the binding of one skeleton to one mesh — it holds
//! the skeleton id and an optional explicit root node within the
//! scene-graph (some formats name the bone root, others infer it
//! from the lowest common ancestor of the joint set).
use crate;
/// Static rest-pose of a skeletal rig.
/// Binding of one skeleton to one mesh.
///
/// `root_node` is the skeleton's scene-graph root when the format
/// stores it explicitly (most do). When `None`, the renderer finds
/// the lowest-common-ancestor of `Skeleton::joints` itself.