Props

Props

From BeamNG

Props are meshes that don't flex, but can be animated. They are very useful for things like steering wheels, shifters, gauge needles, pedals, or other parts that are better animated than simulated. They can also be used to create spotlights that are tied to the glowMap/electrics system, to make working lights.

In the 3D modeling software a prop should be placed at it's proper location and have it's pivot placed where it should rotate around. The procedure for setting the pivot will vary between modeling packages. For example see "Adjusting Pivots" for 3ds Max or "Object Origin" for Blender. Pick 3 reference nodes on the node/beam structure that form a perfect right triangle, in the correct order (reference node, a node directly to the left, and a node directly behind).

BaseRotation is necessary to give a prop an initial offset, like a steering wheel on an angled steering column or a needle in an angled gauge cluster. The mesh can be angled in the 3D modeling program and the angle copied into the props section, but unlike the position, it's not automatically gotten from the mesh file.

"func" is the source of the animation. Rotation and translation determine how much and in what way this input source transforms the prop. Min and max can be used to cap the values, and offset and multiplier are needed to calibrate things like gauges.

	
 "props": [
		["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"]	
		//needles
		["wheelspeed", "fullsize_needle_speedo", "f7r","f7l","f8r", {"x":5, "y":0, "z":0}, {"x":0, "y":0, "z":-4}     , {"x":0, "y":0, "z":0}, 0, 54, -27, 1],
		["rpm",         "fullsize_needle_tacho", "f7r","f7l","f8r", {"x":5, "y":0, "z":0}, {"x":0, "y":0, "z":-0.038}     , {"x":0, "y":0, "z":0}, 0, 6000, -2900, 1],
		["fuel",         "fullsize_needle_fuel", "f7r","f7l","f8r", {"x":5, "y":0, "z":0}, {"x":0, "y":0, "z":-90}     , {"x":0, "y":0, "z":0}, 0, 1, -0.5, 1],
		["oiltemp",       "fullsize_needle_oil", "f7r","f7l","f8r", {"x":5, "y":0, "z":0}, {"x":0, "y":0, "z":-90}     , {"x":0, "y":0, "z":0}, 0, 1, -0.5, 1],
		["watertemp",       "fullsize_needle_water", "f7r","f7l","f8r", {"x":5, "y":0, "z":0}, {"x":0, "y":0, "z":-90}     , {"x":0, "y":0, "z":0}, 0, 1, -0.5, 1],
		["volts",       "fullsize_needle_volts", "f7r","f7l","f8r", {"x":5, "y":0, "z":0}, {"x":0, "y":0, "z":-45}     , {"x":0, "y":0, "z":0}, 0, 1, 0, 1],
		
		["gear_A"      , "fullsize_needle_gear"  , "f7r", "f7l", "f8r", {"x":5, "y":0, "z":0} , {"x":0, "y":0, "z":0}      , {"x":-0.07, "y":0, "z":0}, 0, 1, 0, 1],
		//automatic transmission
		["gear_A"      , "fullsize_shifter_A"    , "f7r", "f7l", "f8r", {"x":17.5, "y":0, "z":0} , {"x":0, "y":0, "z":-25}    , {"x":0, "y":0, "z":0}, 0, 1, 0, 1],
		
		//pedals
		["brake"     ,"fullsize_brakepedal", "f7r","f7l","f8r",  {"x":90, "y":0, "z":0} , {"x":-25, "y":0, "z":0}    , {"x":0.0, "y":0, "z":0}, 0, 1, 0, 1],
		
		["throttle"     ,"fullsize_gaspedal", "f7r","f7l","f8r",  {"x":90, "y":0, "z":0} , {"x":-25, "y":0, "z":0}    , {"x":0.0, "y":0, "z":0}, 0, 1, 0, 1],
		
		["parkingbrake"     ,"fullsize_parkingbrake", "f7r","f7l","f8r",  {"x":90, "y":0, "z":0} , {"x":-22, "y":0, "z":0}    , {"x":0.0, "y":0, "z":0}, 0, 1, 0, 1],
		
		//turn signal stalk
		["turnsignal"  , "fullsize_signalstalk"      , "f7r","f7l","f8r",  {"x":17.5, "y":0, "z":0}, {"x":0, "y":0, "z":-15}    , {"x":0, "y":0, "z":0}, -1, 1, 0, 1],
	 ],

When used as lights, they can be tied to a deformGroup as an inline option, so that they stop working when the light breaks. The following is an example of a lights props section, which should be fairly self explanatory. The difference with the placement is that it uses a polar coordinates system. Translating on the X axis is moving the prop along a line relative to the two nodes (ref and idX). The same goes for the Y axis. Z axis is absolute (in meters) offset.

For the prop to work as a light, and not attempt to find a mesh to place, it should be named SPOTLIGHT. The "func" is whatever input source should trigger the light.

The Wiki page Spotlight Positioning explaines how to aim and position a spotlight.

	
	"props": [
		["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"]
		{
			"lightInnerAngle":65
			"lightOuterAngle":120
			"lightBrightness":0.4
			"lightRange":30
			"lightColor":{"r":255, "g":255, "b":200, "a":255}
			"lightAttenuation":{"x":0, "y":1, "z":1}
			"lightCastShadows":true
		}
		//low beams angled right slightly to avoid blinding oncoming traffic
		["lowhighbeam"    , "SPOTLIGHT"        , "fa2rr", "fa2r", "fa1rr", {"x":20, "y":-45, "z":-20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0, "z":0.05},"deformGroup":"hatch_headlightglass_R_break"},],
		["lowhighbeam"    , "SPOTLIGHT"        , "fa2ll", "fa2l", "fa1ll", {"x":160, "y":-25, "z":25} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0, "z":-0.05},"lightOuterAngle":75,"deformGroup":"hatch_headlightglass_L_break"},],
		//high beams
		["highbeam" , 		"SPOTLIGHT"        , "fa2rr", "fa2r", "fa1rr", {"x":20, "y":-45, "z":-20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.4, "y":0, "z":0.05},"lightRange":50,"deformGroup":"hatch_headlightglass_R_break"}],
		["highbeam" , 		"SPOTLIGHT"        , "fa2ll", "fa2l", "fa1ll", {"x":160, "y":-45, "z":20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.4, "y":0, "z":-0.05},"lightRange":50,"deformGroup":"hatch_headlightglass_L_break"}],
		//dim parking lights
		["parking" , 		"SPOTLIGHT"        , "fa2rr", "fa2r", "fa1rr", {"x":20, "y":-45, "z":-20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.4, "y":0, "z":0.05},"lightRange":50,"lightBrightness":0.2,"deformGroup":"hatch_headlightglass_R_break"}],
		["parking" , 		"SPOTLIGHT"        , "fa2ll", "fa2l", "fa1ll", {"x":160, "y":-45, "z":20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.4, "y":0, "z":-0.05},"lightRange":50,"lightBrightness":0.2,"deformGroup":"hatch_headlightglass_L_break"}],
	 ],