Forums

Full Version: elchtest mod :)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
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.
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?
Code:
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
    UpdateDynamics();
    
    // 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;

    UpdateWheelContacts();

    // 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
        //UpdateSounds(internal_dt);

        //force_feedback += GetFeedback();

        // set forward the vdrift physics
        InterpolateWheelContacts();
        TickPhysics(internal_dt);
        
        // 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.
Hey, that's really cool! Thanks for sharing. :-)
This is the project website? Smile
http://www.kognimobil.org/index.php
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)
Pages: 1 2 3 4 5