RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library
Co-Simulation Channel Namestech/ - Co-simulation & Technical Interface ModulesPCD Point Cloud FilesTCP Tech CommunicationTech Utilities

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 Referencecommontech

Tech Utilities

Module defined in `lua/common/tech/techUtils.lua`. Utility functions for the tech/co-simulation layer - surface height queries and table-to-vector conversions.

Module defined in lua/common/tech/techUtils.lua. Utility functions for the tech/co-simulation layer - surface height queries and table-to-vector conversions.


Exports

Functions

M.getSurfaceHeight(pos)

Query the terrain surface height at a given position.

  • Parameters:
    • pos - vec3/table - World position to query
  • Returns: number - Surface height at position

M.tableToVec3Recursive(tbl)

Recursively convert tables with x/y/z keys to vec3 objects (and 4-element tables to quats).

  • Parameters:
    • tbl - table - Table tree to convert
  • Returns: table - Same table with vec3/quat conversions applied in-place

M.migrateOldKeysRecursive(tbl)

Recursively migrate deprecated key names in data tables to current naming conventions.

  • Parameters:
    • tbl - table - Table tree to migrate

Internal Notes

  • tableToVec3OrQuat (internal) detects {x, y, z} or {x, y, z, w} numeric tables
  • Migration handles backward compatibility for tech layer data formats

See Also

  • tech/ - Co-simulation & Technical Interface Modules - Directory overview
  • cosimulationNames Reference - Related reference
  • pcdLib Reference - Related reference
  • techCommunication Reference - Related reference
  • Common Libraries Overview - Guide

TCP Tech Communication

Module defined in `lua/common/tech/techCommunication.lua`. TCP socket communication layer for BeamNG's tech/co-simulation interface. Handles client connections, MessagePack-encoded message exchange, a

testFramework/ - Unit Testing Framework

Simple unit test framework for BeamNG Lua code with JUnit XML output.

On this page

ExportsFunctionsM.getSurfaceHeight(pos)M.tableToVec3Recursive(tbl)M.migrateOldKeysRecursive(tbl)Internal NotesSee Also