Skip to content

Commit

Permalink
javadoc and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Feb 24, 2025
1 parent ec955c5 commit f067292
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/github/stephengold/joltjni/Quat.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ public void set(QuatArg source) {
}

/**
* Create a rotation quaternion from Euler angles. Rotation order is X then
* Y then Z.
* Create a rotation quaternion from the specified Tait-Bryan angles,
* applying the rotations in x-y-z extrinsic order or z-y'-x" intrinsic
* order.
*
* @param angles the desired rotation around each axis (in radians, not
* null, unaffected)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/github/stephengold/joltjni/operator/Op.java
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,13 @@ public static Vec3 star(QuatArg left, Vec3Arg right) {
float ry = right.getY();
float rz = right.getZ();

// a = lhs x pure(rhs)
// a = left x pure(right)
float aw = -lx * rx - ly * ry - lz * rz;
float ax = lw * rx + ly * rz - lz * ry;
float ay = lw * ry - lx * rz + lz * rx;
float az = lw * rz + lx * ry - ly * rx;

// result = vec3(a x conjugate(lhs))
// result = vec3(a x conjugate(left))
float x = -aw * lx + ax * lw - ay * lz + az * ly;
float y = -aw * ly + ax * lz + ay * lw - az * lx;
float z = -aw * lz - ax * ly + ay * lx + az * lw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public interface QuatArg {
/**
* Test whether the quaternion is zero. The quaternion is unaffected.
*
* @return {@code true} if zero, otherwise {@code false}
* @return {@code true} if exactly zero, otherwise {@code false}
*/
boolean isZero();

Expand Down

0 comments on commit f067292

Please sign in to comment.