Maximum number of objects?

gmseed
Posts: 8
Joined: Sat Sep 25, 2010 6:09 pm

Maximum number of objects?

Post by gmseed »

Hi

I'm using JBullet and find that BasicDemo works fine for a small to medium number of objects.

However, as I increase the number of objects it throws the exception:

Is there a way to increase the number of dynamic objects?

Graham

Code: Select all

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4051
        at com.bulletphysics.collision.broadphase.AxisSweep3$EdgeArrayImpl.set(AxisSweep3.java:94)
        at com.bulletphysics.collision.broadphase.AxisSweep3Internal.addHandle(AxisSweep3Internal.java:471)
        at com.bulletphysics.collision.broadphase.AxisSweep3Internal.createProxy(AxisSweep3Internal.java:585)
        at com.bulletphysics.collision.dispatch.CollisionWorld.addCollisionObject(CollisionWorld.java:120)
        at com.bulletphysics.dynamics.DiscreteDynamicsWorld.addRigidBody(DiscreteDynamicsWorld.java:420)
        at com.bulletphysics.demos.basic.BasicDemo.createSpheres(BasicDemo.java:295)
        at com.bulletphysics.demos.basic.BasicDemo.initPhysics(BasicDemo.java:169)
        at com.bulletphysics.demos.basic.BasicDemo.main(BasicDemo.java:349)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Maximum number of objects?

Post by Erwin Coumans »

This forum is just for the C++ version of Bullet.

In C++ the btAxisSweep3::btAxisSweep3 pre-allocates a maximum number of objects, based on the 3rd argument of the constructor. Increase it or use the btDbvtBroadphase instead.
Thanks,
Erwin
gmseed
Posts: 8
Joined: Sat Sep 25, 2010 6:09 pm

Re: Maximum number of objects?

Post by gmseed »

Hi

Thanks for your reply. I'll give it a go.

With the lastpost on JBullet being the 13th of July 2010, it looks pretty dead, so I posted on the main Bullet forum.

Apologies but I thought this was a general question and not specific to Java, even though I posted a Java runtime exception.

Graham