Skip to content

Commit

Permalink
Op: add a starEquals() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Nov 10, 2024
1 parent c7bb782 commit 18adfa0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/github/stephengold/joltjni/operator/Op.java
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,19 @@ public static Vec3 rotate(QuatArg left, Vec3Arg right) {
return result;
}

/**
* Scale the left argument by the right argument. (native operator: binary
* {@code *=})
*
* @param left the accumulating vector (not null, modified)
* @param right the scale factor to apply (not null, unaffected)
*/
public static void starEquals(Vec3 left, float right) {
left.setX(left.getX() * right);
left.setY(left.getY() * right);
left.setZ(left.getZ() * right);
}

/**
* Return the component-wise difference of the specified vectors. (native
* operator: binary {@code -})
Expand Down

0 comments on commit 18adfa0

Please sign in to comment.