A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by bleubleu » Thu May 06, 2010 7:56 pm
Thanks, I hacked my way through it, I'll use a cleaner solution when 2.21 comes out. Ciao!
-Mat
-
bleubleu
-
- Posts: 17
- Joined: Sat Apr 21, 2007 5:51 pm
- Location: Montreal, Canada
by bleubleu » Fri May 07, 2010 10:18 pm
I've been playing with the DG car a bit more today... Still have a few observations about the longitudinal force curve.
Changing the longitudinal force curve so it doesn't contains zeros does not seem to be a good solution.
Ideally, what we want to modelize something like this:

But we know it doesn't work in the case when the car speed is 0, because the torque becomes zero.
But forcing it to a value different than zero create a discontinuous curve around x=0, so when the car is almost stopped, but not quite (on idle for example), its speed will oscillate between <0 and >0 and will suddently get a little push forward, or backward, making it look weird.
Any ideas on how to smooth this out ?
-Mat
-
bleubleu
-
- Posts: 17
- Joined: Sat Apr 21, 2007 5:51 pm
- Location: Montreal, Canada
by bleubleu » Wed May 26, 2010 5:33 pm
Hi!
I am still trying to tweak the ray cast car to my likings.
Julio, can you tell me exactly what used to the the two following calls in the OLD (1.53) raycast car?
NewtonVehicleSetTireLongitudinalSlideCoeficient
NewtonVehicleSetTireMaxLongitudinalSlideSpeed
Were those values clamped, modified, etc? How were they used in the simulation.
I really liked the behavior I had in 1.53 and I want to reproduce it as much as I can in 2.xx.
-Mat
-
bleubleu
-
- Posts: 17
- Joined: Sat Apr 21, 2007 5:51 pm
- Location: Montreal, Canada
by Julio Jerez » Wed May 26, 2010 6:00 pm
NewtonVehicleSetTireLongitudinalSlideCoeficient
NewtonVehicleSetTireMaxLongitudinalSlideSpeed
are two emprical parameters used to simulate tire empirical tire behavior.
TireLongitudinalSlideCoeficient s is calculate as
s = (LinearVelocity of tire center - Angular Velocity of the tire * tire radius) / Linear Velocity of tire center
it represents how much the tire is allowed to rotate before the tire center start to move.
the coefficient is them used to calculate the max force the tire center apply to the car
f = tire normalForce * s
then the force in clamped between the Minimun and Max Tire force the car is allow to apply to the car and set to the Friction limit of the tire joint.
then teh solver calculates the actual force. All it guaranees is that the force calculated by the solver will not exceed those limits.
NewtonVehicleSetTireMaxLongitudinalSlideSpeed
is a Kludge value because if the tire is spinng too fast then (LinearVelocity of tire center - Angular Velocity of the tire * tire radius) can be very big, therefore Linear teh numrator of S in clamped between [- MaxLongitudinalSlideSpeed and MaxLongitudinalSlideSpeed]
so the final s is calculated as:
s = clamp [LinearVelocity of tire center - Angular Velocity of the tire * tire radius, -MaxLongitudinalSlideSpeed, MaxLongitudinalSlideSpeed] / abs (LinearVelocity of tire center)
In the ray cast car these values are plugged into the curce and we get the force from the curve, therefore there is not needed to calculate the force with a joint.
In fact the Raycast using curves reproduces a more reliatic simulation of those empirical values, than mapping then to a constraint joint a using a constraint solver.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by bleubleu » Thu May 27, 2010 8:13 pm
Cool thanks Julio, I'm making progress, but Im not there yet!
I know you are not very keen on giving away your code, but would it be possible to see portions the joint code of the old 1.53 raycast car? I dont need anything big, basically just the snippet of code where all the constraints are calculated and all those variables are taken into account.
Let me know.
-Mat
-
bleubleu
-
- Posts: 17
- Joined: Sat Apr 21, 2007 5:51 pm
- Location: Montreal, Canada
by Julio Jerez » Thu May 27, 2010 9:07 pm
But that code is almost the same as the mutibody joint in 2.0.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by bleubleu » Thu May 27, 2010 9:11 pm
Oh! I always though the old 1.53 vehicle was a ray-cast one. My bad.
-Mat
-
bleubleu
-
- Posts: 17
- Joined: Sat Apr 21, 2007 5:51 pm
- Location: Montreal, Canada
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests