fixed cloning and saving some contorls.
This commit is contained in:
parent
071e449a3e
commit
e26f0f133b
@ -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;
|
||||
@ -269,9 +270,12 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
||||
}
|
||||
} else {
|
||||
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…
x
Reference in New Issue
Block a user