vrm_runtime/
morph_target.rs1#[derive(Debug, Clone)]
6pub struct MorphTarget {
7 position_deltas: Vec<[f32; 3]>,
8 normal_deltas: Option<Vec<[f32; 3]>>,
9 tangent_deltas: Option<Vec<[f32; 3]>>,
10}
11
12impl MorphTarget {
13 pub(crate) fn new(
14 position_deltas: Vec<[f32; 3]>,
15 normal_deltas: Option<Vec<[f32; 3]>>,
16 tangent_deltas: Option<Vec<[f32; 3]>>,
17 ) -> Self {
18 Self {
19 position_deltas,
20 normal_deltas,
21 tangent_deltas,
22 }
23 }
24
25 pub fn position_deltas(&self) -> &[[f32; 3]] {
27 &self.position_deltas
28 }
29
30 pub fn normal_deltas(&self) -> Option<&[[f32; 3]]> {
32 self.normal_deltas.as_deref()
33 }
34
35 pub fn tangent_deltas(&self) -> Option<&[[f32; 3]]> {
37 self.tangent_deltas.as_deref()
38 }
39}