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.luato provide operator overloading and methods - Uses double precision (not float) for accuracy in physics calculations