RoRBook/First beams and nodes
From Rigs of Rods Wiki
Nodes And Beams
Nodes and beams are the building blocks of vehicles and loads in Rigs of Rods. Anything can be simulated with nodes and beams if the right settings are put in. Nodes and beams are what you will be using to create your vehicles.
Think back to geometry class. Remember points? Nodes are essentially points. All beams are simply defined as a link between two nodes. A node is defined by the following code:
;number, x, y, z, options 0, 0.00, 0.75, 0.66, n
Number: Each node has a number, starting from zero.
X: The x-position of the node on a Cartesian coordinate system.
Y: The y-position of the node on a Cartesian coordinate system.
Z: The z-position of the node on a Cartesian coordinate system.
Options: Options can change the way nodes behave. Valid options are:
- f: Nodes with this option will not produce sparks when contacting hard surfaces.
- x: Nodes with this option will emit smoke.
- y: This is the exhaust reference point- the direction that smoke is emitted is opposite the direction of this node relative to the exhaust point.
- c: Nodes with this option will not contact the ground or collision meshes.
- h: A node with this option will lock onto another node when the "L" key is pressed ingame.
- e: A node with this option will become a point by which objects can be added to the terrain. (try out the terrain editor truck for an example of how this works.)
- b: Nodes with this option will have extra buoyancy.
- p: Nodes with this option will not emit particles of any kind.
- L: Nodes with this option will have information about them recorded to the RoR.log file.
You can have multiple options on a node. See Nodes for more information.
set_node_defaultsset_node_defaults is a command which can be inserted anywhere within the nodes section to change the way nodes following the command behave. The settings are shown in their default state below. To return a setting to its default state, one can simply put "-1" as the setting.
Loadweight: the mass to assign each node with the option "l" following the command.;loadweight, friction coefficient, volume coefficient, surface coefficient, options set_node_defaults 0, 1, 1, 1, n
Friction Coefficient: The amount to multiply the node's friction by. A setting of 2 will double the friction; a setting of 0 will create a frictionless node.
Volume Coefficient: The amount to multiply the node's buoyancy. A setting of 2 will double the buoyancy; a setting of 0 will create a non-buoyant node. This only applies when the node is in a fluid.
Surface Coefficient: The amount to multiply the node's surface by. A setting of 2 will double the surface; a setting of 0 will create a node with no surface. This only applies when the node is in a fluid.
Options: All nodes following the section will have the options defined here.
See set_node_defaults for more information.
Beams are the structural components of your truck/airplane/boat/hovering death machine. These are like those line segments you learned about in geometry class. (aren't you glad that you paid attention?) Beams are defined like so:
;node1, node2, options 0, 1, n
Node1: The first node by which the beam is defined.
Node2: The second node by which the beam is defined.
Options: Options change the way that beams behave. Valid options are:
- i: A beam with this option is invisible.
- r; A beam with this option behaves like a rope- i.e. it will compress easily.
You can have multiple options on a beam. See Beams for more information.
set_beam_defaults is a command which can be inserted anywhere within the beams section to change the way beams following the command behave. The settings are shown in their default state below. To return a setting to its default state, one can simply put "-1" as the setting.
Springiness: Defines the stiffness of the beam. Higher values make the beam stiffer.;springiness, damping, deformation threshold constant, breaking threshold constant, beam diameter, beam material, plastic deformation coefficient set_beam_defaults 9000000, 12000, 400000, 1000000, 0.05, tracks/beam, 0.0
Damping: Defines the beam's resistance to motion. Higher values make the beam less likely to deform.
Deformation Threshold Constant: The amount of force which must be applied to a beam before it does not return to its original length. The lower the value, the easier it is to deform.
Breaking Threshold Constant: The amount of force which must be applied to a beam for it to break. The lower the value, the easier it is to break.
Beam Diameter: The size of the beam, visually speaking. Measured in meters. Beam Material: The material used to color the beam. It must be defined in a separate material file.
Plastic Deformation Coefficient: The amount of force (a factor) to deform a geometrical shape (i.e. a vehicle made of nodes and beams). For example, if a cube made of nodes and beams is crashed to a wall, then the placement of the nodes are displaced, altering the original shape to an irregular one. This also affects the length of beams, if nodes are displaced, the beams may conform to a new shorter or longer length, and staying that way until another outside force is applied.
For more information, see set_beam_defaults.