RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommon

cdefMath Reference

Module defined in `lua/common/cdefMath.lua`. Defines FFI C structs for vec3 and quat types used by the math library.

Module defined in lua/common/cdefMath.lua. Defines FFI C structs for vec3 and quat types used by the math library.


Exports

No Lua exports. Registers FFI C struct definitions when ffi is available.

FFI Types

__luaVec3_t

  • Type: FFI struct {double x, y, z}
  • Description: 3D vector with double precision. Used as the backing type for vec3().

__luaQuat_t

  • Type: FFI struct {double x, y, z, w}
  • Description: Quaternion with double precision. Used as the backing type for quat().

Internal Notes

  • These structs are metatyped in mathlib.lua to provide operator overloading and methods
  • Uses double precision (not float) for accuracy in physics calculations

cdefImgui Reference

Module defined in `lua/common/cdefImgui.lua`. Defines a single FFI C function for ImGui input text callback integration.

cdefs Reference

Module defined in `lua/common/cdefs.lua`. Aggregator module that requires all FFI C definition files.

On this page

ExportsFFI Types__luaVec3_t__luaQuat_tInternal Notes