raycast vehicle on plane?

DestroyerOfCities
Posts: 20
Joined: Fri Dec 10, 2010 3:39 am

raycast vehicle on plane?

Post by DestroyerOfCities »

I'm trying to implement a simple btRaycastVehicle, like the demo. I have a BGLPlane that my boxes all sit on, but when I add the vehicle (I pretty much copy and paste the demo code) it just floats upward! I can apply an engine force and it moves forward, but all the while floating upwards!

I notice that the demo uses either a triangle mesh or a heightmap. Do I have to use one of these shapes to implement a vehicle, or should it be able to just drive on a plane like I was trying?
DestroyerOfCities
Posts: 20
Joined: Fri Dec 10, 2010 3:39 am

Re: raycast vehicle on plane?

Post by DestroyerOfCities »

well I threw in a heightfield shape and it still just floats upwards...
User avatar
ainurakne
Posts: 4
Joined: Sat Apr 30, 2011 3:48 pm
Location: Estonia

Re: raycast vehicle on plane?

Post by ainurakne »

Are you sure you didn't attach your wheels (or actually the springs of the wheels) above the chassis of your vehicle (that's what I did the first time: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=6725 ). In that case the cast rays hit the chassis instead of the ground and lift vehicle higher.
DestroyerOfCities
Posts: 20
Joined: Fri Dec 10, 2010 3:39 am

Re: raycast vehicle on plane?

Post by DestroyerOfCities »

ah! Looks like that was it, thanks!!