Hi,
I have added some collision filtering to the engine, in order to avoid some collision between trees and terrain.
So, I use two groups:
world: 0x0001
entities: 0x0010
I create the world collision shapes as follow (they can only collide with the entities):
group : 0x0001
mask : 0x0010
I create the entities as follow (they can collide with the world and with the other entities):
group: 0x0010
mask: 0x0010 | 0x0001 = 0x0011
Now, when I add a btRayCastVehicle using the entities scheme (which should collide with both the world and the other entities), the wheels are not colliding with the ground anymore (the fall through the ground), while the chassis shape still collides with the ground.
Therefore, I would think that the ray trace operation doesn't use the group/mask properly.
Has anybody experienced a similar issue ?
Thanks for your help !!
issue with raycast vehicle and collision filtering (mask)
Re: issue with raycast vehicle and collision filtering (mask
I think the issue comes from the following line:
btRaycastVehicle.cpp
rayCallback group/mask are not initiliazed according to the vehicle group/mask, but the group is automatically set to 1.
Therefore, the following test returns false:
btCollisionWorld.h
virtual bool needsCollision(btBroadphaseProxy* proxy0) const
Any idea how I can fix this ?
thanks,
Greg
btRaycastVehicle.cpp
Code: Select all
void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
{
// RayResultCallback& resultCallback;
btCollisionWorld::ClosestRayResultCallback rayCallback(from,to);
Therefore, the following test returns false:
btCollisionWorld.h
virtual bool needsCollision(btBroadphaseProxy* proxy0) const
Code: Select all
collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
thanks,
Greg
Re: issue with raycast vehicle and collision filtering (mask
Yes, this should do the job. Thanks a lot !
Question for Erwin: what about adding these changes to the main trunk, as this appear to be a bug to me ?
Question for Erwin: what about adding these changes to the main trunk, as this appear to be a bug to me ?