cdefDebugDraw Reference
Module defined in `lua/common/cdefDebugDraw.lua`. Defines FFI C definitions for debug drawing primitives (spheres, cylinders, lines, text, triangles) used by the engine's debug visualization system.
Module defined in lua/common/cdefDebugDraw.lua. Defines FFI C definitions for debug drawing primitives (spheres, cylinders, lines, text, triangles) used by the engine's debug visualization system.
Exports
This module has no Lua exports (no M table or return value). It registers C function definitions via ffi.cdef when FFI is available.
FFI C Functions
BNG_DBG_DRAW_Sphere(x, y, z, radius, packedCol, useZ)
Draws a debug sphere at the given position.
- Parameters:
x- float - X positiony- float - Y positionz- float - Z positionradius- float - Sphere radiuspackedCol- unsigned int - Packed RGBA coloruseZ- bool - Whether to use Z-buffer
BNG_DBG_DRAW_Cylinder(x1, y1, z1, x2, y2, z2, radius, packedCol, useZ)
Draws a debug cylinder between two points.
BNG_DBG_DRAW_Line(x1, y1, z1, x2, y2, z2, packedCol, useZ)
Draws a debug line between two points.
BNG_DBG_DRAW_Text(x1, y1, z1, text, packedCol)
Draws debug text at a 3D position.
BNG_DBG_DRAW_TextAdvanced(x1, y1, z1, text, packedCol, useAdvancedText, twod, bgColorPacked, shadow, useZ)
Draws advanced debug text with background color and shadow options.
BNG_DBG_DRAW_SquarePrism(x1, y1, z1, x2, y2, z2, x3, y3, x4, y4, packedCol, useZ)
Draws a square prism shape.
BNG_DBG_DRAW_TriSolid(x1, y1, z1, x2, y2, z2, x3, y3, z3, packedCol, useZ)
Draws a solid triangle.
BNG_DBG_DRAW_LineInstance_MinArg(x1, y1, z1, x2, y2, z2, w, packedCol)
Draws a line instance with minimal arguments.
BNG_DBG_DRAW_LineInstance_MinArgBatch(data, lineCount, w1, packedCol)
Batch draws multiple line instances from a float array.
BNG_DBG_DRAW_TriSolidBatch(data, triCount, packedCol, useZ)
Batch draws multiple solid triangles from a float array.
FFI Types
Vector3
- Type: FFI struct
{float x, y, z} - Description: 3D vector used by debug draw functions
Internal Notes
- Only registers definitions when
ffiglobal is available - These are C++ engine functions exposed to Lua via LuaJIT FFI
- Colors are packed as unsigned integers (use
color()from utils to create them)
Tech Vehicle Utilities
Module defined in `lua/vehicle/tech/techVehicleUtils.lua`. Provides low-level physical analysis of the vehicle structure.
cdefGpuMesh Reference
Module defined in `lua/common/cdefGpuMesh.lua`. Defines FFI C struct for GPU mesh primitive data. Most structs are commented out as reference only.