Version 3.1.0 of the Minie Physics Library was released today. It’s available from both GitHub and JCenter.
In addition to some important bug fixes, v3.1 brings some features that I hope will prove useful. Here are the highlights:
Two new builds for building more compact applications:
“3.1.0+big3” for JMonkeyEngine applications that need only support the 3 major platforms (Linux64, MacOSX64, and Windows64). It includes native physics libraries only for those 3.
“3.1.0+bare” for applications that provide their own native physics libraries. It doesn’t include any native libraries.
Methods added to CollisionShapeFactory to create box and hull shapes using a merged mesh. These methods produce simpler, more efficient shapes than the old createBoxShape() and createDynamicMeshShape() methods, without sacrificing much accuracy.
For applications that empty out a PhysicsSpace in order to re-use it, the destroy() function was re-implemented. The function was defined as a no-op in previous releases. It’s not difficult to code this yourself; it’s provided solely for convenience.
“miniedump”, a new command-line tool for analyzing J3O files. Very much a “work in progress” at this time.
Added support for Linux_ARM32 platforms such as the Raspberry Pi. (Thanks again, Pavly!)
I just integrated v3.1 into my project and I think the Box collision shape is still placed in an offset (see pic below).
If you want I can provide a sample program for reproducing this issue.
Besides that It is great that the lib (3big) is ~10MB smaller then the previous one! just great.
A BoxCollisionShape represents a box with its center at (0, 0, 0) in shape coordinates. However, the taxi model’s bounding box is centered at (0, 0.75, 0). The sample code ignores the center coordinates of the bounding box. Hence the mismatch.
You could work around this using a compound shape to position the box shape at (0, 0.75, 0).
An easier way to create collision shapes for models is to use the CollisionShapeFactory class, which includes 2 methods to create box shapes. In this case, I suspect what you want is:
Using createMergedBoxShape(), shape generation shouldn’t take much time, even for complex models.
Shape generation lag can be avoided by generating shapes in advance and storing them as J3O assets. This is especially important when V-HACD is used to generate the shape, but it might help when using createDynamicMeshShape() as well.