API Referenceve
BeamNG Math & Unit Conversions Reference
A centralized reference for common unit conversions and math constants used in BeamNG vehicle Lua.
A centralized reference for common unit conversions and math constants used in BeamNG vehicle Lua.
Speed
- m/s to km/h:
val * 3.6 - km/h to m/s:
val / 3.6 - m/s to mph:
val * 2.23694 - mph to m/s:
val / 2.23694
Rotation (RPM <-> Rad/s)
- RPM to rad/s:
val * 0.104719755 - rad/s to RPM:
val * 9.549296596
Power & Torque
- Torque/AV to Power (Watt):
power = torque * av - Power (Watt) to HP (Mechanical):
val / 745.7 - HP to Power (Watt):
val * 745.7 - Power (Watt) to PS (Metric HP):
val / 735.5 - PS to Power (Watt):
val * 735.5
Pressure
- PSI to Pascal:
val * 6894.757 - Pascal to PSI:
val / 6894.757 - Bar to Pascal:
val * 100000 - Pascal to Bar:
val / 100000
Mass & Gravity
- Standard Gravity:
9.81 m/s² - Pound (lb) to Kilogram (kg):
val * 0.453592 - Kilogram to Pound:
val / 0.453592
Constants
- PI:
math.pi(3.14159...) - 2*PI:
6.2831853 - Rad to Deg:
180 / math.pi(57.295...) - Deg to Rad:
math.pi / 180(0.0174...)
Material Module Reference
Module defined in `lua/vehicle/material.lua`. Manages dynamic vehicle materials, "glowmaps" (lighting), and "deformmaps" (damage textures).
obj (Vehicle C++ Object)
The `obj` global is a C++ binding to the `Vehicle` object in the engine. It provides direct access to the vehicle's physical state and low-level physics modifications. This is the primary interface fo