VehicleRaycaster and KinematicCharacterController

Ceejay
Posts: 3
Joined: Tue May 11, 2010 1:12 pm

VehicleRaycaster and KinematicCharacterController

Post by Ceejay »

Hi,

I try to use a VehicleRaycaster as a sensor to detect pedestrians walking on a street, and only pedestrians. Those pedestrians are controlled by a KinematicCharacterController. Other environment objects are rigid bodies, i dont want them to be detected by the ray caster.

The problem is that the rays hit the rigid bodies, but not the pedestrians. Is it to possible to specify which type of object we want the rays to interact with ?
I already searched the forum (and others), the doc...

Please forgive my poor english and my newbiness, i'm a beginner with Bullet and Physics simulation :oops:
razer
Posts: 82
Joined: Sun Apr 04, 2010 10:08 pm

Re: VehicleRaycaster and KinematicCharacterController

Post by razer »

Check bullet manual

Chapter 6 Collision Filtering page 20
Ceejay
Posts: 3
Joined: Tue May 11, 2010 1:12 pm

Re: VehicleRaycaster and KinematicCharacterController

Post by Ceejay »

Thanks for the help.
I had already checked the manual, and used the filters but with no success. I'll go deeper into the code.

I use a btDefaultVehicleRaycaster, how comes that the rays don't collide with ghost objects ?
(ghost objects group is set to DefaultFilter, and mask to AllFilter).

What I don't understand is how to specify groups and masks to the rays ? I saw that RayResultCallback has its m_collisionFilterGroup/Mask set by default to DefaultFilter and AllFilter. So I expected rays to hit ghost objects. I must be missing something :|

Again, sorry if my questions seem trivial.
razer
Posts: 82
Joined: Sun Apr 04, 2010 10:08 pm

Re: VehicleRaycaster and KinematicCharacterController

Post by razer »

There are severals ways described in manual.
Groups are simplest way and you can define your own class that will do that.
You will have to override btCollisionWorld::ConvexResultCallback or btCollisionWorld::RayResultCallback
They are already overridden in btCollisionWorld.
You may copy, rename, modify the class and have you own collision callback with your very own logic.
You can learn how the classes work they just check group and mask.

The best way to learn it is look in the code.