Skip to content

Commit

Permalink
CustomConvexShape: validate arguments of the setScaledInertia() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jan 27, 2024
1 parent 1666277 commit 8320d4c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ protected CustomConvexShape(Vector3f halfExtents) {
* @param iz the desired Z-axis rotational inertia for mass=1 (>0)
*/
protected void setScaledInertia(float ix, float iy, float iz) {
Validate.positive(ix, "X-axis inertia");
Validate.positive(iy, "Y-axis inertia");
Validate.positive(iz, "Z-axis inertia");

inertia.set(ix, iy, iz);

long shapeId = nativeId();
Expand Down

0 comments on commit 8320d4c

Please sign in to comment.