Vehicle Orientation
Alongside vehicle position, the vehicle orientation (also commonly referred to by rotation or attitude) is a fundamental physical property indicating the location of the vehicle with respect to the course. As such, to the player, it very intuitively manifests as the orientation of the vehicle chassis on the screen. This article describes its effect on physics and the values that directly influence it.
For a primer on the numeric representation of rotations and coordinate systems, refer to the wiiki article
Types of rotation
- Main rotation
- Special rotation
- Full rotation
Main rotation is the main type of rotation that affects physics, in terms of travel direction for example. Special rotation is the additional component caused by animations such as tricks and damage from objects. Full rotation is the previous two combined together, and is the final result that appears on screen.
How main rotation is computed
In a convenient parallel with the vehicle position, the main rotation is formed by integrating over time a sum of angular velocities. These components can also be directly corresponded to external and internal velocity in terms of their behavior.
Internal Angular Velocity
IAV for short, historically known as angvel2, is the component produced by enforcing the "game rules". You receive an amount of IAV by moving your stick or when drifting, relative to your vehicle's handling and drift stats.
External Angular Velocity
EAV for short, historically known as angvel0, is the component produced by rigid body interaction such as collisions with objects. Similar to EV, forces on the vehicle like collision interactions and suspension forces apply torque to your vehicle depending on how far the force is from the vehicle center of mass. These forces are accumulated on a variable called "total_torque" which is converted to angular acceleration after using rotation version of newton's second law:
a = I*τ
where a is the angular acceleration, I is the inertia matrix (calculated from BSP parameters for each vehicle) and τ is the torque. Finally, EAV gets computed by angular acceleration using numerical integration.