Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
elchtest mod :)
03-16-2010, 12:50 PM,
I haven't noticed(visually) any floating so far. But I touched/rewrote a number of functions/classes in my branch(like the wheel forces calculation).

I have had heavy oscillations on some cars (lowrider style jumping :lolSmile. There must be something wrong with their suspension setup. As they trigger the overtravel workaround in CARDYNAMICS::ApplySuspensionForceToBody(). Commented it out for now. It should be solved using a constraint anyway.

The cylinder shape wheels are on my todo list. Will use your code as reference.
03-16-2010, 01:15 PM,
Then I'll have to take a look at it.
What was wrong with the wheel forces?
Did you sync the same way, I do?
03-16-2010, 01:30 PM,
void CAR::updateAction(btCollisionWorld* collisionWorld, btScalar dt)
    // cardynamics run then times faster then bullet
    const float num_repeats = 10;
    const float internal_dt = dt / num_repeats;
    // overwrite vdrift pose/velocities with bullet calculation
    // init deltaAngularVelocity (contains sum over all delta Velocities in substeps)
    MATHVECTOR<float, 3> newAngularVelocity = dynamics.GetBody().GetAngularVelocity();
    MATHVECTOR<float, 3> oldPosition = dynamics.GetBody().GetPosition();

    //double old_force = force_feedback;
    //force_feedback = 0;


    // apply several vdrift steps (cause frequency must be very high for a vehicle)
    for(int i = 0; i < num_repeats; ++i)
        // get the new engine and so on sounds

        //force_feedback += GetFeedback();

        // set forward the vdrift physics
        // accumulate delta velocity
        newAngularVelocity = newAngularVelocity + dynamics.GetBody().GetAngularVelocity();
    newAngularVelocity = dynamics.GetBody().GetAngularVelocity();//deltaAngularVelocity / (num_repeats + 1);
    //force_feedback /= num_repeats;

    MATHVECTOR<float, 3> newPosition = dynamics.GetBody().GetPosition();
    MATHVECTOR<float, 3> newVelocity = dynamics.GetBody().GetVelocity();//(newPosition - oldPosition) / dt;

    // update the Bullet angular and linear Velocities: This is the only connection from Vdrift to bullet
    UpdateChassis(newVelocity, newAngularVelocity);

Oh, I am interpolating wheel contacts(plane approximation) in the inner loop.
And the simulation dt depends on the framerate atm.

The original wheel forces code contains some bugs I tried to fix in my "elchtest" modification.
03-20-2010, 07:38 AM,
OK, I am late, but here are some videos of the prototype of our simulation.
(Wheel collision detection is done by the cylinder.)
Again thanks! Vdrift spared us a lot of time and the results are better than I could ever imagine!
03-20-2010, 12:10 PM,
Hey, that's really cool! Thanks for sharing. :-)
03-22-2010, 12:19 PM,
This is the project website? Smile
03-30-2010, 10:37 AM,
Yes indeed.
I think a pretty interesting topic!
Perhaps you will get a super bot for vdrift as a spinoff Smile
(Although it will stop at every crossing and wait for others who arrived first to pass Big Grin)

Forum Jump:

Users browsing this thread: 1 Guest(s)