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
use alloc::borrow::Cow;
use alloc::vec::Vec;
use ownable::IntoOwned;
use serde::Deserialize;
use crate::camera::Camera;
use crate::mesh::Mesh;
use crate::skin::Skin;
use crate::{Extensions, Extras, Idx};
/// A node in the node hierarchy.
#[derive(Debug, Clone, Deserialize, IntoOwned)]
pub struct Node<'a> {
/// The user-defined name of this object.
#[serde(borrow)]
pub name: Option<Cow<'a, str>>,
/// The indices of this node's children.
#[serde(default)]
pub children: Vec<Idx<Node<'static>>>,
/// The index of the camera referenced by this node.
pub camera: Option<Idx<Camera<'static>>>,
/// The index of the mesh in this node.
pub mesh: Option<Idx<Mesh<'static>>>,
/// The index of the skin referenced by this node.
pub skin: Option<Idx<Skin<'static>>>,
/// The weights of the instantiated morph target.
pub weights: Option<Vec<f32>>,
/// A 4x4 transformation matrix stored in column-major order.
pub matrix: Option<[f32; 16]>,
/// The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.
pub rotation: Option<[f32; 4]>,
/// The node’s non-uniform scale, given as the scaling factors along the x, y, and z axes.
pub scale: Option<[f32; 3]>,
/// The node's translation along the x, y, and z axes.
pub translation: Option<[f32; 3]>,
#[serde(borrow)]
pub extensions: Option<Extensions<'a>>,
#[serde(borrow)]
pub extras: Option<Extras<'a>>,
}