04-06-2010, 04:47 AM,
|
|
sebiastisch
Junior Member
|
Posts: 30
Threads: 3
Joined: Feb 2010
|
|
In bullet they first predict the unconstrained motion, than calculate constraint violations, calculate new (angular/linear)velocitys, which fulfill those constraints and integrate with them again.
Maybe that helps.
|
|
04-06-2010, 12:49 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:predict the unconstrained motion
That's what I've been doing too. It works quite well as long as the suspension is not too stiff. But the f1-02 with its ultra stiff suspension is wobbling visibly
Code: T Update(T dt, T ext_displacement)
{
// clamp external displacement
overtravel = ext_displacement - travel;
if (overtravel < 0)
overtravel = 0;
if (ext_displacement > travel)
ext_displacement = travel;
else if (ext_displacement < 0)
ext_displacement = 0;
// predict new displacement
T new_displacement = displacement + velocity * dt + 0.5 * force * inv_mass * dt * dt;
// clamp new displacement
if (new_displacement > travel)
new_displacement = travel;
else if (new_displacement < 0)
new_displacement = 0;
// calculate derivatives
if (new_displacement < ext_displacement)
{
force = GetForce(ext_displacement, velocity);
velocity = (ext_displacement - displacement) / dt;
displacement = ext_displacement;
}
else
{
T new_force = GetForce(new_displacement, velocity);
velocity = velocity + 0.5 * (force + new_force) * inv_mass * dt;
force = new_force;
displacement = new_displacement;
}
assert(!isnan(velocity));
assert(!isnan(force));
return -force;
}
Another issue is tire angular oscillation due to bullet vdrift synchronization. That's why the TCS is broken.
To tackle both problems I've decided to switch to btRigidBody for chassis dynamics and to implement the suspension as a hinge constraint. Unfortunately this is somewhat time consuming as I have to rewrite bigger parts of cardynamics.
|
|
04-08-2010, 09:27 PM,
|
|
charlieg
Member
|
Posts: 98
Threads: 10
Joined: Aug 2005
|
|
Now that this is settling down, isn't it time for a new release? 8)
Or at least to plan what is planned for the next release...
|
|
04-09-2010, 07:35 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Well ...
I am not sure if we've got anything to release.
The bullet branch will take another week or so. As I am not satisfied with the current state and decided to move suspension and wheels into bullet. So we will have a constraint based suspension and rigid body wheels(hopefully).
Another thing to consider is that, this are simulation related modifications. So eventually the casual player might not notice any difference to the previous release.
There are a number of things on my personal todo list(after I am done with the simulation part):
- dynamic sky, daylight
- smooth particles(smoke, dust, backfire)
- dynamic track objects => track objects (and car parts) library
- skidmarks ?
PS: The suspension prototype in blender :lol:
|
|
04-09-2010, 11:13 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:once the bullet branch is back into trunk and you like where it is, we should do a release
OK. But this might happen quite soon. :wink:
Quote:it just gets positions and orientations from the dynamics
Yep, this cardynamics functions should be used for graphics (won't change):
Code: // graphics interface, interpolated!
void Update(); // update interpolated chassis state
const MATHVECTOR <T, 3> & GetCenterOfMassPosition() const;
const MATHVECTOR <T, 3> & GetPosition() const;
const QUATERNION <T> & GetOrientation() const;
MATHVECTOR <T, 3> GetWheelPosition(WHEEL_POSITION wp) const;
MATHVECTOR <T, 3> GetWheelPosition(WHEEL_POSITION wp, T displacement_percent) const; // for debugging
QUATERNION <T> GetWheelOrientation(WHEEL_POSITION wp) const;
QUATERNION <T> GetUprightOrientation(WHEEL_POSITION wp) const;
Edit: So please feel free to modify/rewrite the scenegraph.
|
|
|