Where BeamNG gets its name - beams.
These are the spring/damper connections between nodes, and serve to build the main structure of any vehicle in the game, allowing for deformation and breakages as required.
There are multiple types of beams for all sorts of purposes, which you can see in more detail in the various examples. Standard beams act as simple springs with damping, with the ability to deform and break if needed, and are used for most applications.
All arguments that apply to standard beams can be used with each of the specialised beam types.
Required arguments
Optional arguments
Force required to change the length of the beam by a set amount. Excessively high stiffness compared to node weight can cause the beam to vibrate and cause instability issues.
A beam with the beamSpring value of 0 will not be shown in the console as a duplicate. This allows for adding extra damping beams in the structure.
Example usage:
{"beamSpringFunction":"=150*$load+1100","cargoGroup":"RoofbarTank1"},
Example usage:
{"beamDampFunction":"=0.2*$load+50","cargoGroup":"RoofbarTank1"},
How much force the beam can resist before breaking.
A value of “FLT_MAX” will result in an unbreakable beam.
Example usage:
{"beamStrengthFunction":"=150*$load+1100","cargoGroup":"RoofbarTank1"},
Example usage:
{"beamDeformFunction":"=150*$load+1100","cargoGroup":"RoofbarTank1"},
Overrides beamPrecompression.
A value of 0.2 would cause the beam to lengten by 0.2 meters on spawn, while a value of -0.2 would cause the beam to shorten by 0.2 meters on spawn.
Mesh breaking allows polygons of a flexbody mesh to be dynamically removed when an underlying beam breaks. This can be used to avoid excessive stretching of meshes when part of its assigned jbeam structure breaks free.
Disabling mesh breaking is useful when the breakable beam only acts as a structural support, for example in passenger cabins.
Triangle breaking allows the vehicle’s triangles to be dynamically transitioned to a state without collision and aero when an underlying beam breaks. This is used when a triangle connects 2 components that can break apart, such as a vehicle body and frame, and in case of breakable glass, in order to dynamically make a physical hole in it.
Disabling triangle breaking is useful when the breakable beam only acts as a structural support, for example in passenger cabins.
Only applies to normal, bounded, and l-beams.
Used mostly with suspension components and other critical parts of the jbeam to help run higher damping before instability kicks in.
Expensive to run, should only be used where needed.
This is used for cases where one of the nodes that make up the beam is located in an optional component.
It will also hide warnings related to duplicate beams.
Used to trigger flexbody deform groups. Is also used for damage simulation on some powertrain components.
A beam with a deformGroup will not be treated as a duplicate beam by the console. This is due to a common case of using brittle duplicate beams to simulate breakable glass.
Typical values are very small numbers under 0.1. If the beam is shortened or lengthened by more than that amount, the deformGroup will be triggered.
The existence of this property on a beam will create a deform trigger for the beam, causing extra code to be executed whenever any beam with this property is deformed. This can be performance intensive, so it should only be used where it’s needed.
Suspension sound arguments
These arguments are used on beams that work the roles of struts or shock absorbers in a vehicle. They should all be used together in line only on those beams.
Debug arguments
These are for short term debug purposes and should be removed in the final version of the structure.
The table consists of 2 elements: “radius” is a number that sets the highlight radius in meters and “col” is a string with the hex value of the color. Example usage:
["a","b", {"highlight":{"radius":0.005,"col":"ff0000ff"}}],
Simple Example
A beam between nodes a
and b
"beams": [
["id1:", "id2:"],
["a","b"],
]
Advanced Example
Example of a typical beam section, which begins by initializing all the properties that will be used for the following beams.
{
"beams": [
["id1:", "id2:"],
//--BODYWORK--
//roof main shape lengthwise
{"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
{"beamSpring":1401000,"beamDamp":140},
{"beamDeform":32700,"beamStrength":"FLT_MAX"},
{"deformLimitExpansion":1.1},
["rf1r","rf2r"],
["rf1","rf2"],
["rf1l","rf2l"],
["rf2r","rf3r"],
["rf2","rf3"],
["rf2l","rf3l"],
["rf3r","rf4r"],
["rf3","rf4"],
["rf3l","rf4l"],
]
}
0.32.0.0
contains
699896
entries in
9248
sections distributed over
16714
parts in
4451
jbeam files.