Skip to main content

gltf_reader/
skin.rs

1use alloc::borrow::Cow;
2use alloc::vec::Vec;
3use ownable::IntoOwned;
4use serde::Deserialize;
5
6use crate::accessor::Accessor;
7use crate::node::Node;
8use crate::{Extensions, Extras, Idx};
9
10/// Joints and matrices defining a skin.
11#[derive(Debug, Clone, Deserialize, IntoOwned)]
12pub struct Skin<'a> {
13    /// The user-defined name of this object.
14    #[serde(borrow)]
15    pub name: Option<Cow<'a, str>>,
16
17    /// The index of the node used as a skeleton root.
18    pub skeleton: Option<Idx<Node<'static>>>,
19    /// Indices of skeleton nodes, used as joints in this skin.
20    pub joints: Vec<Idx<Node<'static>>>,
21    /// The index of the accessor containing the floating-point 4x4 inverse-bind matrices.
22    #[serde(rename = "inverseBindMatrices")]
23    pub inverse_bind_matrices: Option<Idx<Accessor<'static>>>,
24
25    #[serde(borrow)]
26    pub extensions: Option<Extensions<'a>>,
27    #[serde(borrow)]
28    pub extras: Option<Extras<'a>>,
29}