Some gltf improvements #4
|
@ -93,6 +93,13 @@ impl Transform {
|
||||||
trans.z += z;
|
trans.z += z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Combines a transform with another one.
|
||||||
|
///
|
||||||
|
/// The translations are added while the rotations and scales are multiplied.
|
||||||
|
pub fn combine(self, rhs: Transform) -> Transform {
|
||||||
|
self + rhs
|
||||||
|
}
|
||||||
|
|
||||||
/// Performs a linear interpolation between `self` and `rhs` based on the value `alpha`.
|
/// Performs a linear interpolation between `self` and `rhs` based on the value `alpha`.
|
||||||
///
|
///
|
||||||
/// When `alpha` is `0.0`, the result will be equal to `self`. When `alpha` is `1.0`, the result
|
/// When `alpha` is `0.0`, the result will be equal to `self`. When `alpha` is `1.0`, the result
|
||||||
|
|
|
@ -172,7 +172,7 @@ impl<'a> SceneGraph<'a> {
|
||||||
self.traverse_down_from(self.root_node.clone(), &mut callback);
|
self.traverse_down_from(self.root_node.clone(), &mut callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Traverses down the SceneGraph from a starting node, calling `callback` with each
|
/// Recursively Traverses down the SceneGraph from a starting node, calling `callback` with each
|
||||||
/// SceneNode and its world transform.
|
/// SceneNode and its world transform.
|
||||||
fn traverse_down_from<F>(&self, start: SceneNode, callback: &mut F)
|
fn traverse_down_from<F>(&self, start: SceneNode, callback: &mut F)
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in New Issue