Fixed saving/cloning enabled state of a RigidBodyControl.
This commit is contained in:
parent
3a2f4075dc
commit
637635d53f
@ -53,6 +53,7 @@ import com.jme3.scene.shape.Box;
|
|||||||
import com.jme3.scene.shape.Sphere;
|
import com.jme3.scene.shape.Sphere;
|
||||||
import com.jme3.util.clone.Cloner;
|
import com.jme3.util.clone.Cloner;
|
||||||
import com.jme3.util.clone.JmeCloneable;
|
import com.jme3.util.clone.JmeCloneable;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,6 +144,8 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
}
|
}
|
||||||
control.setApplyPhysicsLocal(isApplyPhysicsLocal());
|
control.setApplyPhysicsLocal(isApplyPhysicsLocal());
|
||||||
control.spatial = this.spatial;
|
control.spatial = this.spatial;
|
||||||
|
control.setEnabled(isEnabled());
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,9 +276,12 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
added = false;
|
added = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(this.space==space) return;
|
if (this.space == space) return;
|
||||||
space.addCollisionObject(this);
|
// if this object isn't enabled, it will be added when it will be enabled.
|
||||||
added = true;
|
if (isEnabled()) {
|
||||||
|
space.addCollisionObject(this);
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.space = space;
|
this.space = space;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user