JME Bullet - Is there a Broadphase or Narrowphase collision filter available?

Hello,



It’s been a while since I last posted here …so must time for another question :wink:



Okay, I was wondering whether in the bullet in JME there are collision filters for either the Narrowphase or Broadphase?

Having done a search of the documentation and grep of the classes in the JME3-bullet.jar and turned up anything, I’m suspecting no?



Anyway the actual behaviour I’m after is to ignore / prevent the collision between two objects before bullet actually performs the simulation, suggestions are welcome.



Thanks in advance!

You can use a CollisionGroupListener for that.

Collision masks i would say, depending on case they should be fasted, if they are granular enough

Ah, both are fine suggestions!



In this case the CollisionGroupListener would be the more appropriate, and looks like it should do the trick …however, I’m currently feeling that I must be missing something obvious because it’s just not working for me.



if you’ve got a minute can you spot anything wrong with the setup code below, the group listener is just not being called (as you can see I’ve gone for the scatter gun approach for the groups - believe they are PhysicsCollisionObject.COLLISION_GROUP_01 by default)

[java]

private void setupPhysics()

{

bulletAppState = new DaylightBulletAppState();

bulletAppState.setThreadingType( BulletAppState.ThreadingType.PARALLEL );

stateManager.attach( bulletAppState );

bulletAppState.getPhysicsSpace().setAccuracy( 1f / 30f );



bulletAppState.getPhysicsSpace().enableDebug( assetManager );



bulletAppState.getPhysicsSpace().addCollisionListener( this );



final TankCollisionGroupListener listener = new TankCollisionGroupListener();

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_01 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_02 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_03 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_04 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_05 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_06 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_07 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_08 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_09 );

bulletAppState.getPhysicsSpace().addCollisionGroupListener( listener, PhysicsCollisionObject.COLLISION_GROUP_10 );



DaylightPhyiscsSpace.setPhysicsSpace( bulletAppState.getPhysicsSpace() );

}

[/java]



Yes, my TankCollisionGroupListener contains a s.o.p line and it’s not being invoked despite the many collision (have used the PhysicsCollisionListener with a s.o.p, the ‘this’ reference) - any idea’s what I’ve missed here / area’s to check



Cheers

Native bullet? Might be it hasn’t been added there.

Sorry for the slow reply, however got side tracked on ‘other’ matters :frowning:


@normen said:
Native bullet? Might be it hasn't been added there.

Yes, it's native bullet.

I've just updated from using a nightly build from back in August to the RC2 version, no imrovement.

One unfortunate thing I've noticed is that the source for the native bullet is not contained in the jMonkeyEngine-sources.zip ...perhaps because the classes have the same namespace as the jme-jbullet ones?

Anyway, I'll download from the repo and actually take a look at the code tomorrow
@monkey_scratches_head said:
Sorry for the slow reply, however got side tracked on 'other' matters :(


Yes, it's native bullet.

I've just updated from using a nightly build from back in August to the RC2 version, no imrovement.

One unfortunate thing I've noticed is that the source for the native bullet is not contained in the jMonkeyEngine-sources.zip ...perhaps because the classes have the same namespace as the jme-jbullet ones?

Anyway, I'll download from the repo and actually take a look at the code tomorrow

Yes, thats the reason. You can just build jme3 yourself using the build-bullet-natives target, the nightly build is broken due to problems with mingw on our build server.