{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreieqyrch4xummespie6oi3tkb6mv5nfssgsbnyd7475fav566u3rlu",
    "uri": "at://did:plc:dxjzgxe7cvirxkwfjr2tjspt/app.bsky.feed.post/3mefom2wqor32"
  },
  "path": "/t/vehiclecontrol-not-removed-from-physicsspace-when-using-addcollisionobject/49408#post_2",
  "publishedAt": "2026-02-08T21:49:23.000Z",
  "site": "https://hub.jmonkeyengine.org",
  "textContent": "Thanks for investigating this issue and getting in touch.\n\nThere are 2 ways to use Minie: with physics controls or without them. Physics controls are built atop lower-level classes (like `PhysicsVehicle`) that can also be used in applications. (Minie inherited this software architecture from jme3-jbullet.) Many of the Minie tutorials use the low-level classes directly, because that’s the interface I prefer.\n\nIf you’re using physics controls, you shouldn’t invoke `space.addCollisionObject()` or `space.removeCollisionObject()` directly, for precisely the reason you describe; those are part of the low-level interface. They bypass some bookkeeping that `VehicleControl` wants to do for you.\n\n> Is this difference in behavior expected?\n\nIt may be non-intuitive, especially if you’re not conscious of the software layers in Minie. Without investigating, I can’t say how hard it might be to work around. It might be something we have to live with.\n\n> Does `addCollisionObject()` bypass the enable/disable lifecycle of `PhysicsControl` objects?\n\nYes.\n\n> And if so, is the correct approach to always use `add()` for controls like `VehicleControl`?\n\nIn Minie apps that use physics controls, best practice is to use `spatial.addControl()` combined with `control.setPhysicsSpace()`.\n\nWhen not using physics controls, best practice is to use `space.addCollisionObject()`.\n\n`space.add()` and `space.remove()` in Minie are for compatibility with jme3-jbullet and are not best practice.\n\nI ran a quick search and found I’m still using `space.add()` in a few apps where I ought to use `addCollisionObject()` or `addControl()`. Since I want to set a good example, I’ll update my source code ASAP.",
  "title": "VehicleControl not removed from PhysicsSpace when using addCollisionObject()"
}