debugDraw Reference
Module defined in `lua/common/utils/debugDraw.lua`. Lightweight debug drawing API using packed integer colors instead of ColorF/ColorI. Wraps FFI calls to the C++ `BNG_DBG_DRAW_*` functions.
Module defined in lua/common/utils/debugDraw.lua. Lightweight debug drawing API using packed integer colors instead of ColorF/ColorI. Wraps FFI calls to the C++ BNG_DBG_DRAW_* functions.
Exports
Functions
M.drawSphere(pos, r, packedCol, useZ)
Draw a debug sphere.
- Parameters:
pos- vec3 - Center positionr- number - RadiuspackedCol- number - Packed RGBA color integeruseZ- boolean - Use Z-testing
M.drawLineInstance_MinArg(posA, posB, w, packedCol)
Draw a debug line with minimal arguments.
- Parameters:
posA- vec3 - Start positionposB- vec3 - End positionw- number - Line widthpackedCol- number - Packed RGBA color integer
M.drawSquarePrism(base, tip, baseSize, tipSize, packedCol, useZ)
Draw a square prism (frustum shape).
- Parameters:
base- vec3 - Base centertip- vec3 - Tip centerbaseSize- vec2 - Base half-sizes (x, y)tipSize- vec2 - Tip half-sizes (x, y)packedCol- number - Packed RGBA color integeruseZ- boolean - Use Z-testing
M.drawTextAdvanced(pos, txt, packedCol, useAdvancedText, twod, bgColorPacked, shadow, useZ)
Draw debug text with advanced options.
- Parameters:
pos- vec3 - World positiontxt- string - Text to displaypackedCol- number - Text color (packed)useAdvancedText- boolean - Use advanced text renderingtwod- boolean - 2D mode (screen-space)bgColorPacked- number - Background color (packed)shadow- boolean - Draw text shadowuseZ- boolean - Use Z-testing
M.drawTriSolid(posA, posB, posC, packedCol, useZ)
Draw a solid triangle.
- Parameters:
posA- vec3 - Vertex AposB- vec3 - Vertex BposC- vec3 - Vertex CpackedCol- number - Packed RGBA color integeruseZ- boolean - Use Z-testing
Variables (FFI Bindings)
M.Sphere
- Type: function (FFI) - Direct
BNG_DBG_DRAW_Spherebinding or nop
M.Cylinder
- Type: function (FFI) - Direct
BNG_DBG_DRAW_Cylinderbinding or nop
M.Line
- Type: function (FFI) - Direct
BNG_DBG_DRAW_Linebinding or nop
M.Text
- Type: function (FFI) - Direct
BNG_DBG_DRAW_Textbinding or nop
M.LineInstance_MinArg
- Type: function (FFI) - Direct
BNG_DBG_DRAW_LineInstance_MinArgbinding or nop
M.SquarePrism
- Type: function (FFI) - Direct
BNG_DBG_DRAW_SquarePrismbinding or nop
M.TextAdvanced
- Type: function (FFI) - Direct
BNG_DBG_DRAW_TextAdvancedbinding or nop
M.TriSolid
- Type: function (FFI) - Direct
BNG_DBG_DRAW_TriSolidbinding or nop
M.LineInstance_MinArgBatch
- Type: function (FFI) - Batched line drawing binding or nop
M.TriSolidBatch
- Type: function (FFI) - Batched solid triangle drawing binding or nop
Internal Notes
- All FFI bindings fall back to
nopif FFI is unavailable - Uses packed integer colors (not ColorF/ColorI) for performance
- Higher-level
draw*functions wrap the raw FFI calls with friendlier API
dateUtils Reference
Module defined in `lua/common/utils/dateUtils.lua`. ISO 8601 date parsing and time difference calculations.
filterchain Reference
Module defined in `lua/common/utils/filterchain.lua`. Functional programming filter chain for signal processing - chains composable filter objects (smooth, interval, scale, digitize, etc.) into a proc