aboutsummaryrefslogtreecommitdiff
path: root/src/core/vector3.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-02 16:07:16 +0100
committerJulian T <julian@jtle.dk>2021-02-02 16:07:38 +0100
commitd79d5d18c8281cce1e782892e5f85680906481dd (patch)
tree3429b142fb76c4999afcc62033b7c4fe9f2ff980 /src/core/vector3.rs
parentdf6a266e5823a7fc4cca3060ec86d35f2125cd0d (diff)
Add matrix and transform implementation
Diffstat (limited to 'src/core/vector3.rs')
-rw-r--r--src/core/vector3.rs9
1 files changed, 9 insertions, 0 deletions
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,
+ )
+
+ }
}