A couple of raycast vehicle questions

miranlp
Posts: 3
Joined: Wed May 12, 2010 8:25 pm

A couple of raycast vehicle questions

Post by miranlp »

Hey y'all!
We're working on a simple racing game and naturally we're using btRaycastVehicle for the vehicle simulation. It's going very well, but there are a coupe of things I'm interested in and I was wondering if someone could help with any of these points.
  • What's the deal with wheel interpolation? Right now, before every stepSimulation, I call updateWheelTransform for every wheel (is calling this even necessary?). If I pass true for the interpolation parameter, the wheels sometimes jitter very strangely, depending on the parameters that are passed to stepSimulation. If I pass false for the interpolation parameter, the wheels never jitter, but I have a feeling that the car handles better with interpolation.
  • Getting the forward vector is easy by using getForwardVector. How would I get the 'up' vector of the car? I need this because when the player is using the first person camera, the up vector has to be the up direction of the camera.
  • When going really fast and then turning sharply, the car will spin out of control. What's the best way to remedy that? Ideally the car would slide, but I've heard that drifting isn't yet part of the raycast vehicle simulation.
  • What's the best way to do steering and acceleration? If I just set the car engine force to the max engine force while the player is holding the acceleration key, the car is very slow to accelerate (which makes for a boring start of the race), but then just keeps accelerating, reaching crazy speeds. Right now I just set it so that if the speed is over 300km/h, the engine force that's applied is 0. For steering, I do a sort of accelerated steering where the steering increments are small at first and then get bigger. It's okay but I'm looking for something better that would respond to speed better. Any ideas?
Anyway, thanks in advance for answering any questions!
razer
Posts: 82
Joined: Sun Apr 04, 2010 10:08 pm

Re: A couple of raycast vehicle questions

Post by razer »

It uses springs model and simulate every 1/60 second.
So some time it compress springs to hard and it jumps.

There is no simple remedy if you wish to use vehicle that comes with bullet.

On high speed your car may fly throw ground or wall also.