diff --git a/src/main/java/com/github/stephengold/joltjni/Quat.java b/src/main/java/com/github/stephengold/joltjni/Quat.java index 0eeb8e2f..4e23a199 100644 --- a/src/main/java/com/github/stephengold/joltjni/Quat.java +++ b/src/main/java/com/github/stephengold/joltjni/Quat.java @@ -155,6 +155,17 @@ public static Quat sRotation(Vec3 axis, float angle) { // ************************************************************************* // QuatArg methods + /** + * Return the conjugate. The current object is unaffected. + * + * @return a new object + */ + @Override + public Quat conjugated() { + Quat result = new Quat(-x, -y, -z, w); + return result; + } + /** * Return the real (W) component in single precision. The quaternion is * unaffected. diff --git a/src/main/java/com/github/stephengold/joltjni/readonly/QuatArg.java b/src/main/java/com/github/stephengold/joltjni/readonly/QuatArg.java index 6f3d9797..d7e0c143 100644 --- a/src/main/java/com/github/stephengold/joltjni/readonly/QuatArg.java +++ b/src/main/java/com/github/stephengold/joltjni/readonly/QuatArg.java @@ -21,6 +21,8 @@ of this software and associated documentation files (the "Software"), to deal */ package com.github.stephengold.joltjni.readonly; +import com.github.stephengold.joltjni.Quat; + /** * Read-only access to a {@code Quat}. (native type: const Quat) * @@ -30,6 +32,13 @@ public interface QuatArg { // ************************************************************************* // new methods exposed + /** + * Return the conjugate. The current object is unaffected. + * + * @return a new object + */ + Quat conjugated(); + /** * Return the real (W) component in single precision. The quaternion is * unaffected.