Nodes

Nodes are masspoints and the core of the BeamNG physics. Everything revolves around them. A node itself is a dimensionless (infinitely small) mass point in 3D space. Each node is defined by a unique name and a position in 3D space.

Nodes can have any string for their name, as long as the names do not conflict. A good naming scheme is some memorable/relevant letter, followed by a number, followed by a letter signifying which side of the vehicle it’s on. For example, the 1st rightmost frame node could be called f1rr while the 3rd left frame node would be called f3l. A node sitting in the middle (posX = 0) would have no letter suffix.

This is an example of a nodes section. Nodes also have many properties which can be set by placing dictionary lines above the nodes which are desired to be affected. Node weights are in kilograms, and coordinates are in meters. The “group” modifier is for assigning flexbodies. Node material only affects sound and particle properties, not physics.

Our game engine uses a z-up coordinate system and SI units for most parameters.

Couplers

Nodes also define couplers, which allow to connect two nodes together on demand. Couplers are mostly used for trailer hitches, but they can also be used to hold openable panels closed, and to attach components together.


Required arguments

id
name
string
type
Defines the node name. Need to be unique for the whole vehicle
posX
name
number
type
The X (left/right) position in 3D space
Left is positive, right is negative
posY
name
number
type
The Y (forward/back) position in 3D space
Backward is positive, forward is negative
posZ
name
number
type
The Z (up/down) position in 3D space
Up is positive, down is negative

Optional arguments

nodeWeight
name
number
type
options.nodeWeight
default
The weight of the node in kg
As of game version 0.23.5.0 the default weight of a node is 25 kg
collision
name
boolean
type
true
default
If the node can collide with the world
boolean
type
false
default
If the node can collide with the vehicle
group
name
string
type
Groups a set of nodes into a group that can be used later in other sections

Nodes can also be assigned to multiple groups on an individual basis, as per the following example:

["f6ll", 0.76, -0.72, 0.83, {"group":["coupe_engine","coupe_windshield"]}],
number
type
1
default
Friction of the node
string
type
options.nodeMaterial
default
Physics material of the node, rubber, metal, etc.
As of version 0.23.5.0 the following physics materials are available:
METAL, PLASTIC, RUBBER, GLASS, WOOD, FOLIAGE, CLOTH, WATER, ASPHALT, ASPHALT_WET, SLIPPERY, ROCK, DIRT_DUSTY, DIRT, SAND, SANDY_ROAD, MUD, GRAVEL, GRASS, ICE, SNOW, FIRESMALL, FIREMEDIUM, FIRELARGE, SMOKESMALLBLACK, SMOKEMEDIUMBLACK, STEAM, RUMBLE_STRIP, COBBLESTONE, FOLIAGE_THIN
fixed
name
boolean
type
false
default
If the node is fixed in 3D space (Can’t move at all)
The top node is fixed:

number
type
FLT MAX
default
Maximum force that can be applied on the coupler before it disconnects.
couplerTag
name
number
type
The type of coupler that this coupler will connect to
Couplers will connect to other couplers with the same couplerTag. Two tags that can be useful are “tow_hitch” for standard trailers, and “fifthwheel” for semi-truck trailers.

number
type
The distance (meters) at which this coupler will try to connect with other couplers.
Larger numbers make the car/trailer alignment more forgiving.
breakGroup
name
string
type
Will break the coupler if the selected [breakGroup] breaks, or break the breakGroup if the coupler breaks.
boolean
type
false
default
Disables locking and unlocking of the coupler
Used when the coupler is used to permanently attach parts together.

table
type
List of electrics that will be transfered from the other vehicle to this vehicle.

Mostly used when defining the tow hitch coupler on trailers. This is not required in the towing vehicle’s jbeam

"importElectrics": ["lowhighbeam", "reverse", "signal_L", "signal_R"],
table
type
List of inputs that will be transfered from the other vehicle to this vehicle.

Mostly used when defining the tow hitch coupler on trailers. This is not required in the towing vehicle’s jbeam

"importInputs": ["brake", "parkingbrake"]

number
type
0.1
default
Makes a node have more or less drag area in ground models with depth
volumeCoef
name
number
type
0.1
default
Makes a node more or less buoyant in ground models with depth
noLoadCoef
name
number
type
1
default
TODO: document this feature
number
type
0
default
TODO: document this feature
number
type
1.75
default
TODO: document this feature
number
type
1
default
TODO: document this feature
number
type
0.5
default
TODO: document this feature
treadCoef
name
number
type
0.5
default
TODO: document this feature
tag
name
string
type
TODO: document this feature
number
type
0
default
TODO: document this feature
pairedNode
name
string
type
This can be used to i.e. link double tires together

Simple Example

Node a sits somewhere in 3D space:

"nodes" :[
  ["id", "posX", "posY", "posZ"],
  ["a", -0.90, -0.93, 0.23],
],

Node a sits somewhere in 3D space and has the mass of 3 kg.

"nodes" :[
  ["id", "posX", "posY", "posZ"],
  ["a", -0.90, -0.93, 0.23, {"nodeWeight": 3}],
],

Advanced Example

Example of a typical node section, which begins by initializing all the properties that will be used for the following nodes.

{
   "nodes" :[
     ["id", "posX", "posY", "posZ"],
     {"group":"body"},
     {"selfCollision":false}
     {"collision" :true}
     {"nodeMaterial":"|NM_METAL"},
     {"frictionCoef":0.7},
     {"nodeWeight":12.5},
     // a comment
     ["n1rr", -0.90, -0.93, 0.23],
     ["n1r", -0.33, -0.95, 0.23],
     ["n1l", 0.33, -0.95, 0.23],
     ["n1ll", 0.90, -0.93, 0.23],
     {"group":""},

  ],
}
0.23.5.0 contains 52536 entries in 4750 sections distributed over 9148 parts in 2189 jbeam files.
Last modified: 28 November 2021, at 22:06

Any further questions?

Join our discord