CapsuleCollisionShape: warn about scaling only if it's not identity

same diff riccardobl committed to 'master' on Jun 20, 2016
This commit is contained in:
Stephen Gold 2017-01-17 11:42:21 -08:00
parent aae6170cc5
commit ac8eb4d40a
2 changed files with 7 additions and 3 deletions

View File

@ -86,7 +86,9 @@ public class CylinderCollisionShape extends CollisionShape {
*/
@Override
public void setScale(Vector3f scale) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled");
if (!scale.equals(Vector3f.UNIT_XYZ)) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled");
}
}
public void write(JmeExporter ex) throws IOException {

View File

@ -90,9 +90,11 @@ public class CylinderCollisionShape extends CollisionShape {
*/
@Override
public void setScale(Vector3f scale) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled");
if (!scale.equals(Vector3f.UNIT_XYZ)) {
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled");
}
}
public void write(JmeExporter ex) throws IOException {
super.write(ex);
OutputCapsule capsule = ex.getCapsule(this);