Skip to content

Commit d99be84

Browse files
committed
PhysicsRigidBody: add arg validation to setPhysicsScale() (issue #47)
1 parent de31364 commit d99be84

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

MinieLibrary/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,9 @@ public void setPhysicsRotationDp(Quatd orientation) {
10871087
* no negative component, unaffected, default=(1,1,1))
10881088
*/
10891089
public void setPhysicsScale(Vector3f newScale) {
1090+
Validate.nonNegative(newScale, "new scale");
1091+
Validate.finite(newScale, "new scale");
1092+
10901093
CollisionShape shape = getCollisionShape();
10911094
Vector3f oldScale = shape.getScale(null); // TODO garbage
10921095
if (MyVector3f.ne(oldScale, newScale)) {

0 commit comments

Comments
 (0)