From d79d5d18c8281cce1e782892e5f85680906481dd Mon Sep 17 00:00:00 2001 From: Julian T Date: Tue, 2 Feb 2021 16:07:16 +0100 Subject: Add matrix and transform implementation --- src/core/vector3.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/vector3.rs') diff --git a/src/core/vector3.rs b/src/core/vector3.rs index e3aa9a6..05bd977 100644 --- a/src/core/vector3.rs +++ b/src/core/vector3.rs @@ -81,4 +81,13 @@ impl Vector3f { new.norm_in(); new } + + pub fn cross(&self, op: &Self) -> Self { + Self::new_xyz( + self.y * op.z - self.z * op.y, + self.z * op.x - self.x * op.z, + self.x * op.y - self.y * op.x, + ) + + } } -- cgit v1.2.3