You can put descriptions on asserts too if you want to keep the “no runtime cost without -ea” feature.
for instance :
assert false : “the vm shouldn’t get here”;
You can put descriptions on asserts too if you want to keep the “no runtime cost without -ea” feature.
for instance :
assert false : “the vm shouldn’t get here”;
i30817,
There is no runtime cost associated with throwing a normal exception in this case because the user is never supposed to invoke this method. An assert is simply not appropriate in this case.
Good idea, the thing is that I’ve directly ported the asserts from C++ without too much thought. Descriptive exceptions would be much better and there is no cost as the methods are not normally called as pointed out.
Also thanks for reminding me that the asserts can have description, I’ve forgotten that. The thing is that I’m not fan of asserts, I prefer exceptions for everything as most obscure bugs are in production after months of flawless function without easy reproduce. Though in JBullet case there may be cases where it could be useful. Some internal errors were already noticed thanks to (Array)IndexOutOfBoundsExceptions. This is one of reasons for a port instead of binding, where in native side when there is such error the program crashes or even worse it continues with corrupted memory state.
Hi Jezek,
I saw that you added the contributed Character class (it was actually by “SomethingNew” and not by me) but I did not receive any feedback when I contacted you so I have set up my own branch of your bullet port here. I sync it with your mtn version from time to time.
This branch is used in jMonkeyEngine3 for the physics simulation. It adds a HeightfieldTerrainShape contributed by the same guy and a maxForce parameter for the vehicle (as in the latest bullet version). If you care to add anything from this branch, its at your disposal.
Cheers,
Normen
If anyone in the community is interested in using Translational Motors, the Spring Constraint (Generic6DofSpringConstraint) and the ConstraintDemo in JBullet, you can pull my fork of JBullet from:
This was added for use in a cellular simulation project called QIntBio.
The spring constraint was added to Bullet after the major refactoring of the constraint solver in revision 1542 involving SIMD support. The translational motor and the way the spring constraint uses it to simulate the effect of a spring, is written for the newer software design (with getInfo() functions and optimised SIMD functions).
Therefore, there was no code to solve the linear spring constraint, that can be ported in a straightforward manner.
New code was written following the old template.
Hope it is useful
Hi everyone,
I hope there’s still someone around this topic, cause I’ve a memory issue with JBullet.
It seems to generate a lot of " int[] " when calling DynamicWorld.stepSimulation.
I did profile the software using the JVisualMachine, it seems the memory leak is comming from com.bulletphysics.utils.Stacklist.
I have no idea what is going on, the but garbage collector is running every 5 or 6 seconds to clean the mess, which cause my 3D app to freeze for half a second every 5 or 6 seconds.
Any idea ?
Estraven