Flexbodies are the models that get mapped to your nodes, and have deformation applied to them.
The game will calculate deformation by mapping every vertice to the nearby nodes, and moving them accordingly with the movemement of those nodes.
Flexbodies are assigned to a set of nodes using nodegroups, with the flexbodies only getting deformed by the movement of those specific nodes. See the nodes page for more information.
All the meshes should be in one or multiple dae files either in your car’s folder or the common folder. See the vehicle modelling page for more information.
Deform groups
An additional feature that can be used are deform groups. Those allow you to trigger a material change on a model when a defined set of beams get deformed. They are commonly used for lights and windows.
Required arguments
"flexbodies" :[
["mesh", "[group]:","nonFlexMaterials"],
["my_mesh", ["my_group"]],
],
“nonFlexMaterials” is a deprecated legacy feature that is not used or usable anymore. It was used with the old tire model to prevent the rigid wheel mesh from compressing with the tire.
Optional arguments
"pos":{"x":0.0, "y":0.0, "z":0.0}
Uses the intrinsic Euler +Z +X +Y rotation system.
"rot":{"x":0.0, "y":0.0, "z":0.0}
"scale":{"x":1.0, "y":1.0, "z":1.0}
Example usage:
["part", ["group"], [],{"materialOverride":[
["originalMaterial1","replacementMaterial1"],
["originalMaterial2","replacementMaterial2"]
]}],
Simple Example
A mesh called “my_mesh” is assigned to nodes in group “my_group”.
"flexbodies" :[
["mesh", "[group]:","nonFlexMaterials"],
["my_mesh", ["my_group"]],
],
Advanced Example
An example of headlights with deform groups.
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
["pickup_headlightframe_R", ["pickup_fascia"]],
////lights
{"deformGroup":"headlightglass_R_break", "deformMaterialBase":"gavril_lights", "deformMaterialDamaged":"gavril_lights_dmg"},
["pickup_headlight_R", ["pickup_fascia"]],
//glass
{"deformGroup":"headlightglass_R_break", "deformMaterialBase":"pickup_glass", "deformMaterialDamaged":"pickup_glass_dmg"},
["pickup_headlightglass_R", ["pickup_fascia"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound4", "deformVolume":0.6}],
{"deformGroup":""},
],
An example of a flexbody using modifiers and multiple node groups.
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
//wheels
["steelwheel_10a_13x5_5", ["wheel_FR","wheelhub_FR"], [], {"pos":{"x": -0.50, "y":-0.0, "z":0.0}, "rot":{"x":0, "y":0, "z":180}, "scale":{"x":1, "y":1, "z":1}}],
["steelwheel_10a_13x5_5", ["wheel_FL","wheelhub_FL"], [], {"pos":{"x": 0.50, "y":-0.0, "z":0.0}, "rot":{"x":0, "y":0, "z":0}, "scale":{"x":1, "y":1, "z":1}}],
],
Using materialOverride to define multiple parts with different color variants.
"us_semi_conventional_bullbar_type_bare": {
"information":{
"authors":"BeamNG",
"name":"Bare Metal",
"value":450,
},
"slotType" : "us_semi_conventional_bullbar_type",
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
["longnose_bullbar", ["us_semi_bullbar"], [],{"materialOverride":[["us_semi_common","us_semi_common"]]}],
],
},
"us_semi_conventional_bullbar_type_chrome": {
"information":{
"authors":"BeamNG",
"name":"Polished",
"value":450,
},
"slotType" : "us_semi_conventional_bullbar_type",
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
["longnose_bullbar", ["us_semi_bullbar"], [],{"materialOverride":[["us_semi_common","us_semi_common_chrome"]]}],
],
},
"us_semi_conventional_bullbar_type_painted": {
"information":{
"authors":"BeamNG",
"name":"Painted",
"value":450,
},
"slotType" : "us_semi_conventional_bullbar_type",
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
["longnose_bullbar", ["us_semi_bullbar"], [],{"materialOverride":[["us_semi_common","us_semi_common_painted"]]}],
],
},
"us_semi_conventional_bullbar_type_black": {
"information":{
"authors":"BeamNG",
"name":"Black",
"value":450,
},
"slotType" : "us_semi_conventional_bullbar_type",
"flexbodies": [
["mesh", "[group]:", "nonFlexMaterials"],
["longnose_bullbar", ["us_semi_bullbar"], [],{"materialOverride":[["us_semi_common","us_semi_common_black"]]}],
],
},