Slidenodes are nodes that move along predefined rails. Common applications include steering racks and some suspension components like macpherson struts.
Slidenodes need to have a node and rail already created to work, as they refer to both. Keep in mind that the node needs to be precisely aligned with the rail, otherwise you might experience issues as the node aligns itself on spawn.
"slidenodes": [
["id:", "railName", "attached", "fixToRail", "tolerance", "spring", "strength", "capStrength"],
["nodename", "Rail1", true, true, 0, 10000000, 100000000, 345435],
],
Rails are the tracks for slidenodes. They consist of one or multiple sections that are defined using nodes.
A rail can consist of multiple segments, and those segments do not have to be in a straight line.
"rails": {
"Rail1":{"links:":["node1", "node2", "node3", "node4"], "broken:":[], "looped":false, "capped":true}
},
"links:":["node1", "node2"],
"links:":["node1", "node2", "node3", "node4"],
New in version 0.38, the rails2 section is the same as rails, with the same arguments, but formated differently, more in line with the other Jbeam sections.
//these two are exactly the same
"rails": {
"Rail1":{"links:":["node1","node2","node3"], "broken:":[], "looped":false, "capped":true},
"Rail2":{"links:":["node4","node5"], "broken:":[], "looped":false, "capped":true},
},
"rails2":[
["id", "links:", "broken:","looped","capped"],
["Rail1", ["node1","node2","node3"], [], false, true ],
["Rail2", ["node4","node5"], [], false, true ],
],
The advantage of this syntax over the standard rails is being able to make the rail id dynamic using functions , so that a single part can be reused multiple times with different rail names each time (previously, it was possible for all Jbeam sections except rails).
A typical example of rail and slidenode usage is the steering rack.
"rails": {
"steeringrack":{
"links:":["fh6r", "fh6l"], "broken:":[], "looped":false, "capped":true,
},
},
"slidenodes": [
["id:", "railName", "attached", "fixToRail", "tolerance", "spring", "strength", "capStrength"],
["st1r", "steeringrack", true, true, 0.0, 18001000, "FLT_MAX", "FLT_MAX"],
["st1l", "steeringrack", true, true, 0.0, 18001000, "FLT_MAX", "FLT_MAX"],
],
Using rails2 with functions allowing for dynamic rail names.
"rails2": [
["id", "links:", "broken:","looped","capped"],
["$= $prefix .. 'r1'", ["1r", "5r"], [], false, true],
["$= $prefix .. 'r2'", ["3r", "7r"], [], false, true],
["$= $prefix .. 'l1'", ["1l", "5l"], [], false, true],
["$= $prefix .. 'l2'", ["3l", "7l"], [], false, true],
],
"slidenodes": [
["id:", "railName","attached", "fixToRail","tolerance","spring", "strength", "capStrength"],
["0r", "$= $prefix .. 'r1'", true, true, 0.0, 60000, 400000, 400000],
["0r", "$= $prefix .. 'r2'", true, true, 0.0, 60000, 400000, 400000],
["0l", "$= $prefix .. 'l1'", true, true, 0.0, 60000, 400000, 400000],
["0l", "$= $prefix .. 'l2'", true, true, 0.0, 60000, 400000, 400000],
],
Was this article helpful?