Merge pull request #613 from JavaSaBr/fixed_saving_and_cloning_some_controls

Fixed cloning and saving some contorls.
fix-456
empirephoenix 8 years ago committed by GitHub
commit 6f32651fb1
  1. 8
      jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java
  2. 6
      jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java

@ -121,6 +121,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
control.setUpAxis(getUpAxis());
control.setApplyPhysicsLocal(isApplyPhysicsLocal());
control.spatial = this.spatial;
control.setEnabled(isEnabled());
return control;
}
@ -207,12 +208,13 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
added = false;
}
} else {
if (this.space == space) {
return;
}
if(this.space == space) return;
// if this object isn't enabled, it will be added when it will be enabled.
if (isEnabled()) {
space.addCollisionObject(this);
added = true;
}
}
this.space = space;
}

@ -200,6 +200,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
newWheel.setWheelSpatial(wheel.getWheelSpatial());
}
control.setApplyPhysicsLocal(isApplyPhysicsLocal());
control.setEnabled(isEnabled());
control.spatial = spatial;
return control;
@ -268,10 +269,13 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
added = false;
}
} else {
if(this.space==space) return;
if(this.space == space) return;
// if this object isn't enabled, it will be added when it will be enabled.
if (isEnabled()) {
space.addCollisionObject(this);
added = true;
}
}
this.space = space;
}

Loading…
Cancel
Save