how to create a non-RaycastVehicle vehicle

markbaker
Posts: 7
Joined: Mon Dec 01, 2008 3:37 am

how to create a non-RaycastVehicle vehicle

Post by markbaker »

I am creating an arcade style 4x4 offroad racer. From what I understand on this forum, btRaycastVehicle is not recommended for 4x4 offroad vehicles and that I should create one from constraints. How would I go about doing this? Is there an example that I can learn from? I am using a btConcaveShape terrain to feed relevant polygons to the vehicle.
rusty
Posts: 25
Joined: Fri Sep 19, 2008 10:23 am

Re: how to create a non-RaycastVehicle vehicle

Post by rusty »

I've never actually had any issues in using ray-cast style vehicles in off-road situations. If anything, it's urban environments where I've seen the biggest problems with ray-cast vehicles.

Just give ray-cast vehicle a go, and see how it behaves for you.
markbaker
Posts: 7
Joined: Mon Dec 01, 2008 3:37 am

Re: how to create a non-RaycastVehicle vehicle

Post by markbaker »

I was under the impression that btRaycastVehicle doesn't work when Bullet is fed only relevant AABB-contained polygons on the fly (via btConcaveMesh::ProcessTriangles) as my engine uses? I am using a custom dynamic terrain with unique functions on a mobile device, so the other Bullet (bvh, terrain) mesh classes that i believe work with btRayCastVehicle are not an option. Am I wrong?
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: how to create a non-RaycastVehicle vehicle

Post by ola »

I have used a similar custom terrain class feeding bullet with triangles within an aabb, and that worked just fine. Be aware that raycasting in general will be slow for longer rays as they will have a large aabb with lots of triangles. The raycast vehicle has very short rays, though, so that should be OK.

Best regards,
Ola