Physics Collision Listener

Hi everyone.



I’m trying to create a house with some objects inside. Besides that, there is a character that can interact with the objects.



I create a RigidBodyControl for the objects and the house, and created a CharacterControl for the character.



I want to identify if there was a collision between the character and the objects or the walls. I wan’t to ignore the collision between the character and the floor.



So, I created a PhysicsCollisionListener(), but I keep getting the result of the collision with the floor.



How do I ignore this?



Thanks.

Carla

Check if its the floor and then drop the collision…

Im have kinda the same issues with my terrain. I’ve tried to use setCollideWith and setCollisionGroup (as i recall they are called), in order to ONLY get the collision with certain kind of objects (in this case food obj). But i must be stuipid, because the collision is still with other objects. So i guess, i’ll try to preFix my food objects names, and check on that in collision. But what did I gain then - i thought setting the a collision group to fx. 2, ignored all other groups that 2.



So:

Terrain, weapons, trees = collision group 1

Food items = collision group 2



Rabbit collideWith collision group 2, when searching.

Theres a “collision group” bitset and a “collide with” bitset, the second item still has collidewith group 1. Its a bit more complicated but also more flexible. Check the javadoc on the corresponding methods.

OK, thanks :slight_smile: