That depends what you mean by “ok”.
- It shouldn’t cause a crash or violent motion.
- In debug versions of Minie, it should generate a warning message.
- It might be somewhat inefficient.
What’s setKinematicSpatial() for? I can only find doc talking about setKinematic();
Although the JME physics tutorials will help you understand Minie, I recommend following the Minie tutorials instead.
Your question is answered in the Minie tutorial on
RigidBodyControl: An introduction to RigidBodyControl :: The Minie project
So is the statement not true, at least partially, in Minie that kinematic object must have a non-zero mass?
Indeed. Prior to version 7.6, Minie required kinematic rigid bodies to have positive mass. Since v7.6, zero mass is also allowed.
it says setApplyLocal(true) can be used in situations like physics inside a running train or spacecraft (hey, that’s the game I’m working on!) by adding another physics space onto the running node. However I can’t find example code on how to do this. Could you mind show me some? Minie is preferred if there’s some difference between jBullet and Minie here.
First off, you don’t need multiple physics spaces to simulate the interior of a train or spacecraft.
The original intent of local physics (as I understand it) was that you would have a specific
Node in your scene graph that represents an inertial reference frame. You attach rigid-body controls to that
Node and set their local-physics flags. Everything else in the scene (including the interior geometries, the world coordinate system, and the camera) is moving with the vehicle; their coordinates aren’t affected by vehicle motion. To produce the illusion of motion, the coordinates of the inertial node change in the direction opposite the vehicle’s motion.
I’ll admit I’ve never actually seen it used this way. I’ve seen example apps that use local physics, but none of them includes a train or spacecraft. The
HelloLocalPhysics tutorial app has a reference-frame node that moves in a circle.
There are obvious challenges involved in simulating physics on a moving vehicle. One is that if the reference frame and the camera get too far apart, you lose precision in one or both coordinate systems. Minie comes with a double-precision build you can use, but that’s not a complete solution. For one thing, you’d need a double-precision version of
- I’m using PhysicsTickListener to read any ghost collision on the object player is trying to place. That’s what the doc say it’s the correct way to have a reliable result from ghost.getOverlappingObjects(). Generally it works fine (except the original issue in this post which I still have no clue) but I can observe some delays in getOverlappingObjects(). Same delays in Minie so is there a better way in Minie for this? For example, is it possible to call get all collisions from a ghost on-demand? The reason is that my game only needs to detect GhostControl collision when player is trying to place the object. In-game collision and contact are all left to RigidBodyControl.
I’m unsure what’s causing the delays you’re seeing with
getOverlappingObjects(). The method never blocks, so it ought to return promptly unless the list is huge.
If you tell me in detail what you’re trying to do, perhaps I could suggest alternative ways to do it.