From 1b770a79fbf0ed0ee8185f8090b7a0ecf819d50d Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 3 Mar 2024 16:28:27 -0500 Subject: [PATCH] Some cleanup --- lyra-math/src/transform.rs | 7 +++++++ lyra-scene/src/lib.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lyra-math/src/transform.rs b/lyra-math/src/transform.rs index cf9600c..35ffd84 100755 --- a/lyra-math/src/transform.rs +++ b/lyra-math/src/transform.rs @@ -92,6 +92,13 @@ impl Transform { trans.y += y; 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`. /// diff --git a/lyra-scene/src/lib.rs b/lyra-scene/src/lib.rs index 82a4e29..78dd50c 100644 --- a/lyra-scene/src/lib.rs +++ b/lyra-scene/src/lib.rs @@ -172,7 +172,7 @@ impl<'a> SceneGraph<'a> { 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. fn traverse_down_from(&self, start: SceneNode, callback: &mut F) where