What's up with JBullet?

I was just wondering if there’s been any recent updates in the JBullet world anywhere? The version available for download at jbullet.advel.cz is out of date now, although it looks like the jME guys have a more complete port in their jME3 nightly downloads. Is anyone actively working on it anymore?

There are recent changes, I just somewhat forgot to officially release them. Although the latest development version is available in the Monotone repository.

Here is a list of changes from latest official release:

  • Added KinematicCharacterController, GhostObject and CharacterDemo
  • Added DbvtBroadphase
  • Added serialization of BVH
  • Updated most classes to match Bullet 2.72
  • Added CCD motion clamping fix from Bullet 2.74
  • Removed usage of interface calls
  • Added stackless traversal in OptimizedBvh

The last two gives observable performance boost. I’ll look into making an official release soon :slight_smile:

Ah, good to know! Thank you Jezek. You’ve done amazing work porting that library over to Java!

Hi Jezek, I am trying to integrate JBullet in a 2D game.

From the bullet code snippet documentation, they recommend to use:


body->setLinearFactor(btVector3(1,0,1));
body->setAngularFactor(btVector3(0,1,0));

to add constraints and simulate a two dimensional movement.

That is implemented since Bullet 2.75 version.

Is there any chance to add that feature to JBullet? if not, do you know a workaround to do add those constraints?

Thanks in advance, for the answer and for Bullet port to Java.

Arielsan, if you’re just interested in doing 2D physics, JBox2D is probably a better fit for you.

Tried to port this change, but doesn’t work as expected. I suspect it has dependency on some previous patch or I’ve overlooked something. If anyone is interested here is the patch (based on SVN revision 1645) for playing :slight_smile:

There is workaround by using 6dof constraint, though it is more expensive and there might be some jerking involved.

Thanks jezek2, I will take a look to both the patch and the workaround you mention.

I am making a game with a top down perspective, I want entities with a physics body to have friction in their movement with a plane below them to simulate a correct behavior, I believe I can’t implement that using JBox2D which seems more for platformer games, but I could be missing something. If you know some way to implement what I need with JBox2d, then I could use it instead JBullet.

Hi,

just wanted to ask if you found a solution for this problem as I’m currently facing the same problem.

  • KM

Yes, I used Generic6DofConstraint constraints, it has been a while since I touched that code so I don’t remember exactly what I did and why, I found some code:


		final Transform frameInA = new Transform();
		final Transform frameInB = new Transform();

		frameInA.setIdentity();
		frameInB.setIdentity();

		frameInA.origin.x = -2.5f;
		frameInB.origin.x = 2.5f;

		Generic6DofConstraint generic6DofConstraint = new Generic6DofConstraint(rigidBody0, rigidBody1, frameInA, frameInB, false);

		generic6DofConstraint.setLinearLowerLimit(new Vector3f(-5f, 0f, 0f));
		generic6DofConstraint.setLinearUpperLimit(new Vector3f(5f, 0f, 0f));

		generic6DofConstraint.setAngularLowerLimit(new Vector3f(0f, 0f, (float) (Math.PI / 6)));
		generic6DofConstraint.setAngularUpperLimit(new Vector3f(0f, 0f, -(float) (Math.PI / 6)));

		world.addConstraint(generic6DofConstraint, true);

But as I was saying, I don’t remember why it was for exactly, only wanted to share to give an idea.

Hope it helps.