A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by pHySiQuE » Sun Sep 21, 2014 2:48 pm
In the vehicle Finalize function there is a dFloor call. This is weird because the m_restSprunMass can easily end up being 0.0 which will cause errors later on.
CustomVehicleControllerManager.cpp, Line 516:
- Code: Select all
tire->m_restSprunMass = dFloat (5.0f * dFloor (sprungMass[index] / 5.0f + 0.5f));
Any particular reason for this?
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Sun Sep 21, 2014 3:07 pm
Sprung mass is defined as the mass supported by each tire. it can never be zero
how did you get sprung mass zero?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Sun Sep 21, 2014 5:23 pm
The dFloor() call rounds it down to the nearest integer right? So that's easy to reach zero, anything less than 0.5 will do it. That's my question.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Sun Sep 21, 2014 5:33 pm
anything less than 5.0 unit will be zero yes.
Sprung mass is approximately equal to the mass of the vehicle divided by the number of tires.
a vehicle with 4 tires, with a mass of 20 may have a tire with a sprung mass less than 5 yes.
how much is you vehicle mass?
unless you are simulating a toy car, vehicle usually weight more that 20 kilogram of mass
the function there is meant to round off the sprung mass so that they are not too unbalanced.
Calculating Sprung Mass is a very complex problem, I am using complementarity solves to calculate the precisely, but that induced the possibility that because of some difference on the vehicle symmetry the sprung mass may varies a few kilogram (or mass unit)
what that function does is that is truncate the round off error at around 5 kilogram.
Unless you made a car with less that 5 kilogram per wheels that function should never produce a sprung mass of zero.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests