Torsion Hydros

Torsion hydros are a variant of hydros , however instead of being a beam whose length varies on demand, they’re set-up as a torsion bar where the angle between both ends can be changed on demand.

The limits can either be set using the factor setting, which sets an identical limit in each direction, or using the inLimit and outLimit parameters. The values are the angle of rotation in radian, meaning a value of 6.28, or 2*PI, is equivalent to a full 360 degree turn.

Examples of uses include steering boxes on trucks and older vehicles, as well as openable panels.

As they are very similar to hydros and share some of the code, they use the same in/out notation as regular hydros, with out being used with positive electrics value, and in with negative values. The picture below shows which direction they correspond to.

If your torsion hydro turns the wrong way, the easiest way to fix it is to change the factor or inputfactor (if using in/outLimit) to a negative value.

Required arguments

string
type
The first lever end node
string
type
The first axis node
string
type
The second axis node
string
type
The second lever end node

Optional arguments

number
type
1
default
Rotation limit of the torsion hydro. (rad)

This angle limit of the torsion hydro in each direction.

The total lock to lock angle will be twice this value.

Negative values will cause the hydro to spin the opposite way.

number
type
-1
default
The inner limit of the torsion hydro. (rad)
Gets overwritten by “factor”.
number
type
1
default
The outer limit of the torsion hydro. (rad)
Gets overwritten by “factor”.
number
type
1
default
Multiplicator of the input value.

Used along with inLimit and outLimit. Gets overwritten by “factor”.

Negative values will cause the torsion hydro to spin the opposite way.

number
type
2
default
How fast the torsion hydro comes in. (rad/s)
number
type
inRate
default
How fast the torsion hydro comes out. (rad/s)
number
type
inRate
default
How fast the torsion hydro returns to center when the inputSource is 0. (rad/s)
string
type
steering
default
The electric value which will control this torsion hydro.
See the electrics page for more information.
number
type
0
default
Offset the torsion hydro’s center.
Changes the electric value that will arrive at the torsion hydro’s center. Used to offset the hydro’s center value. Has no effect on the hydro’s limits.
number
type
-1
default
The electric value at which the torsion hydro will be fully in.
All values of the electric above this will result in the torsion hydro staying at full lock.
number
type
1
default
The electric value at which the torsion hydro will be fully out.
All values of the electric above this will result in the torsion hydro staying at full lock.

Example

"torsionHydros": [
    ["id1:","id2:","id3:","id4:"],
    {"spring":200000, "damp":20, "deform":"FLT_MAX", "strength":50000},
    ["st2r","st2l","st3l","st1ll", {"factor":-0.57,"steeringWheelLock":570,"inRate":5,"outRate":5,"inputSource":"steering_input"}],
    ["st2l","st2r","st3r","st1rr", {"factor":-0.57,"steeringWheelLock":570,"inRate":5,"outRate":5,"inputSource":"steering_input"}],
],
"torsionHydros": [
    ["id1:","id2:","id3:","id4:"],
    {"spring":100000, "damp":100, "deform":"FLT_MAX", "strength":"FLT_MAX"},
    {"breakGroup":"spareholder_hinge_b"},
    ["bd9rr","sh2rrr","sh1rrr","sh1r", {"factor":1.55,"steeringWheelLock":650,"inRate":1.2,"outRate":1.8,"inputSource":"tailgate"}],
    {"breakGroup":""},
],
Last modified: November 13, 2024

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.