JustInvoke / Randomation-Vehicle-Physics

Vehicle physics system for the Unity engine.
https://justinvoke.com/game-assets/#randomation-vehicle-physics
864 stars 184 forks source link

RPM is Not Actually Rotations Per Minute #8

Open JustInvoke opened 7 years ago

JustInvoke commented 7 years ago

This is due to a mistake I made early on in development. I was basically equating "rotation rate of wheel" with "RPM" and not consciously thinking about what RPM really means. I did not realize this until long after the initial release was finished (back when this was sold as a Unity asset). Unfortunately the entire drivetrain is riddled with variables falsely referring to rotation rates as RPMs. The calculations in the scripts and the prefabs' variables depend on the way things are currently set up, so nothing is going to change.

This issue is for the sake of letting people know in case they are depending on RPM actually being rotations per minute. This package was never intended for proper physically accurate simulations anyways.

RPM in the scripts is roughly equal to rotations per second multiplied by 314. This can be found in the GetRawRPM method of the Wheel script: rawRPM = (contactPoint.relativeVelocity.x / circumference) * (Mathf.PI * 100); Raw RPM is what the rotation rate of the wheel would be purely based on its current velocity and circumference. Part of what led me to make this mistake was focusing on the rotation of the visual representation of the wheel.