diff options
Diffstat (limited to 'src/ru/olamedia/math/Quaternion.java')
-rw-r--r-- | src/ru/olamedia/math/Quaternion.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ru/olamedia/math/Quaternion.java b/src/ru/olamedia/math/Quaternion.java new file mode 100644 index 0000000..a263f39 --- /dev/null +++ b/src/ru/olamedia/math/Quaternion.java @@ -0,0 +1,25 @@ +package ru.olamedia.math; + +public class Quaternion { + // identity: + public float x = 0; + public float y = 0; + public float z = 0; + public float w = 1; + + public static Quaternion identity() { + return new Quaternion(); + } + + public Quaternion inverse() { + return QuaternionUtil.inverse(this); + } + + public Quaternion mul(Quaternion q) { + return QuaternionUtil.multiply(this, q); + } + + public float[] toMatrixArray(){ + return QuaternionUtil.toMatrixArray(this); + } +} |