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
59
60
61
62
63
64
65
use strum::FromRepr;
#[derive(Debug)]
pub struct Path {
/// The constraint name. This is unique for the skeleton.
pub name: String,
/// The ordinal for the order constraints are applied.
pub order_index: u32,
/// If true, the constraint is only applied when the active skin has the constraint.
pub skin_required: bool,
/// The index of the bones whose transform will be controlled by the constraint.
// TODO: Use a custom Vec type to limit entries.
pub bones: Vec<usize>,
/// The index of the target slot.
pub target_slot: usize,
/// Determines how the path position is calculated.
pub position_mode: PathPositionMode,
/// Determines how the spacing between bones is calculated.
pub spacing_mode: PathSpacingMode,
/// Determines how the bone rotation is calculated.
pub rotate_mode: PathRotateMode,
/// The rotation to offset from the path rotation.
pub offset_rotation: f32,
/// The path position.
pub position: f32,
/// The spacing between bones.
pub spacing: f32,
/// A value from 0 to 1 indicating the influence the constraint has on the bones, where 0 means
/// no affect, 1 means only the constraint, and between is a mix of the normal pose and the
/// constraint.
pub rotate_mix: f32,
pub translate_mix: f32,
}
#[derive(Debug, FromRepr)]
pub enum PathPositionMode {
Fixed,
Percent,
}
#[derive(Debug, FromRepr)]
pub enum PathSpacingMode {
Length,
Fixed,
Percent,
}
#[derive(Debug, FromRepr)]
pub enum PathRotateMode {
Tangent,
Chain,
ChainScale,
}