RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

bananabench-async Referencebananabench-csv Referencebananabench-json Referencebananabench-print Referencebananabench-xml Referencebananabench Referencebenchphysics ReferenceBeamConsole Folder Overviewjson-performance Referencemain Referenceresave-pcs Referenceservertests Referencesimpleload Referencesimtest Referencetest_dyncol Referencetest Referenceunittests 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 Referenceconsole

unittests Reference

Script defined in `lua/console/unittests.lua`. Unit tests for vec3 math operations including correctness and performance validation.

Script defined in lua/console/unittests.lua. Unit tests for vec3 math operations including correctness and performance validation.


Functions/Exports

test_vec3_function() (global)

Tests vec3 constructor, floating point representation, and arithmetic operators:

  • Constructor: vec3(0,0,0) → "(0, 0, 0)"
  • Float precision: various float values and precision limits
  • Operators: +, -, *, /, unary -
  • Equality: == and ~=
  • Uses assert() - fails fast on any test failure

test_vec3_performance() (global)

Runs 100,000 iterations of vec3 arithmetic operations and checks total time stays under 850ms. Logs a warning if too slow.

Usage

rerequire("lua/console/unittests")
-- Tests auto-execute on load

Internal Notes

  • Requires mathlib for vec3 implementation
  • JIT on/off toggle is commented out (can test JIT impact on vec3 perf)
  • Performance threshold: 850ms for 100k iterations of add/sub/mul/div
  • Auto-executes both tests on load
  • Loaded by servertests.lua as the main test suite

test Reference

Script defined in `lua/console/test.lua`. Main development test file with vehicle loading and JSON parsing test functions.

`be` - BeamNG Engine Binding

Core C++ engine binding available globally in GE Lua. Provides direct access to vehicles, physics state, object management, time control, and world queries.

On this page

Functions/Exportstest_vec3_function() (global)test_vec3_performance() (global)UsageInternal Notes