`v` (Vehicle Data & JBeam)
The `v` global manages the vehicle's JBeam data and configuration. It is primarily used to access the compiled physical structure and the JBeam configuration of the vehicle.
The v global manages the vehicle's JBeam data and configuration. It is primarily used to access the compiled physical structure and the JBeam configuration of the vehicle.
See Also
v.config (Configuration)
Contains the specific part configuration and variable settings for the vehicle instance.
| Property | Description |
|---|---|
licenseName | The text on the license plate. |
mainPartName | The name of the main part (e.g., "etk800"). |
mainPartPath | The path to the main part (e.g., "/etk800"). |
model | The model name of the vehicle. |
paints | Table containing paint information (base color, pearl, etc.). |
partConfigFilename | Path to the .pc file used for this configuration. |
partsTree | The full hierarchy of selected parts. |
vars | Table of JBeam variables and their assigned values. |
v.data (Parsed JBeam Data)
This table contains the fully merged and processed JBeam structure. It is populated during the vehicle loading sequence.
Structural & Physics
nodes: Table of all physical nodes. Indexed by CID.beams: Table of all physical beams. Indexed by CID.triangles: Table of all triangles (used for aerodynamics, collision, and pressure).flexbodies: List of flexmesh objects and their node bindings.props: Configuration for Props (visual components that move/rotate).glowMap: Mappings for GlowMaps (lights that glow based on electrics).refNodes: Reference nodes for vehicle orientation.slidenodes: Nodes that slide along rails.torsionbars/torsionHydros: Torsional spring/damper systems.rails: Paths defined for slidenodes.
Powertrain & Mechanical
powertrain: The full Powertrain device tree.mainEngine: Configuration for the primary Combustion Engine.gearbox: Configuration for the Gearbox.wheels: Configuration for physical wheels and tires.energyStorage: Configuration for Energy Storage (fuel tanks, batteries).mainTank: Reference to the primary fuel tank configuration.turbocharger: Settings for the Turbocharger (if equipped).hydros: Configuration for Hydros (steering, active suspension).
Controllers & Logic
controller: List of Controllers defined in JBeam.vehicleController: Configuration for the Main Vehicle Controller.driveModes: Configuration for Drive Modes (Sport, Comfort, etc.).tractionControl/brakeControl: Settings for ESC/TCS.adaptiveFrontDamper/adaptiveRearDamper: Settings for active damping systems.
Input & Interaction
input: Input mappings and definitions.triggers: Definitions for clickable or proximity Triggers.triggerEventLinksDict: Mapping of triggers to events.interactionGroups: Groups for organizing interactive elements.
Metadata & Misc
information: Metadata about the vehicle (brand, name, author).variables: Current values of JBeam variables.vehicleDirectory: The path to the vehicle's folder (e.g.,"/vehicles/etk800/").activeParts: List of currently installed parts.soundConfig/sounds: Configuration for engine and environment Sounds.
Methods (from jbeam/stage2)
v.loadVehicleStage2(initData): Internal loader for vehicle data.
Usage Example
-- Accessing node position (not directly via v.data in physics loop, use obj)
local nodeData = v.data.nodes[0]
print("Node 0 mass: " .. tostring(nodeData.nodeWeight))
-- Checking a JBeam variable value
local fuelLevel = v.data.variables["$fuel"] or 1.0Thrusters Module Reference
Module defined in `lua/vehicle/thrusters.lua`. This module manages the application of continuous forces (thrusters) and temporary impulses to the vehicle structure. It supports both JBeam-defined thru
Wheels Module Reference
Module defined in `lua/vehicle/wheels.lua`. This module manages the physical simulation, thermal state, and braking logic for wheels and non-tire rotators. It acts as the final interface between the [