Difference between revisions of "NodeOffset"

Difference between revisions of "NodeOffset"

From BeamNG
m (Example slots section using nodeOffset)
(Example slots section using nodeOffset)
Line 1: Line 1:
 
nodeOffset is a new feature in 0.5.0.0. It allows you to move a part as it is installed into a slot. It works as a property of a slot, and is defined as a float3.
 
nodeOffset is a new feature in 0.5.0.0. It allows you to move a part as it is installed into a slot. It works as a property of a slot, and is defined as a float3.
 
== Example slots section using nodeOffset ==
 
Note the use of a [[variables|variable]] for the x axis positioning of the rear wheels.
 
<source lang="jbeam">
 
    "slots": [
 
        ["type", "default", "description"]
 
        ["brake_R","brake_R", "Rear Brakes"],
 
        ["wheel_R_4","steelwheel_01a_13x5_R", "Rear Wheels", {"nodeOffset":{"x":"$trackwidth_R", "y":1.25, "z":0.288}}],
 
        ["wheeldata_R","wheeldata_R", "Rear Wheel Hubs"],
 
        ["coilover_R","coilover_R", "Rear Struts"],
 
        ["swaybar_R","swaybar_R", "Rear Sway Bar"],
 
    ],
 
</source>
 
 
NIGGER
 
 
 
Another behavior of nodeOffset, designed to work well with wheels, is that it uses absolute values when offsetting on the X axis. So for example, if you have two things, one at x:0.5 and one at x:-0.5, and you offset them by 0.3, they would become 0.8 and -0.8, not 0.8 and -0.2. This keeps things symmetrical and makes it easy to widen or narrow track width.  This only applies to the X axis, the Y and Z axis use normal values rather than absolute.
 
 
One shortcoming is that nodeOffset cannot be modified, only overwritten. So for example, if you had a suspension part that had a wheel slot with nodeOffset - if you wanted to offset the entire suspension part for a longer wheelbase, you would not be able to correctly offset the wheel slot. The workaround is to duplicate the suspension part and redefine the slots with the correct offset. This way, the only redundant data is whatever nodes and beams are in the suspension part, not any of its sub-components. To see an example of this, look at "pickup_suspension_R_ext.jbeam" in vehicles\common\pickup.
 

Revision as of 09:03, 31 December 2019

nodeOffset is a new feature in 0.5.0.0. It allows you to move a part as it is installed into a slot. It works as a property of a slot, and is defined as a float3.