aboutsummaryrefslogtreecommitdiff
path: root/src/core/vector3.rs
diff options
context:
space:
mode:
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,
+ )
+
+ }
}