Scripting API

Scripting API

HingeJoint3D

Struct in Abyss.Physics3D, from Abyss.Physics3D.

Two bodies held turning about one line, as a door on its hinges or a wheel on its axle: the body this is on and HingeJoint3D.ConnectedBody, or the world where that is none. Its motor turns it, to a speed or to an angle; its limits stop it turning past two angles.

public struct HingeJoint3D

Remarks

The line is through HingeJoint3D.Anchor, along HingeJoint3D.Axis in its entity's own units, and turns with it. Its angle is this body's turn about it from the connected one's, from the angle they were at as it was made, anticlockwise looking down the axis: HingeJoint3D.LowerAngle no more than nothing, HingeJoint3D.UpperAngle no less, each within a half turn.

Anchors and breaking as FixedJoint3D's.

Fields

ConnectedBody

public EntityRef ConnectedBody

The other body: an entity with a Rigidbody 3D, or under one; none for the world.

EnableCollision

public bool EnableCollision

Whether the two bodies still meet each other.

AutoConfigureConnectedAnchor

public bool AutoConfigureConnectedAnchor

Whether the connected anchor is made where the anchor is as the joint is made.

Anchor

public Vector3 Anchor

Where it holds this body, in its entity's own units.

ConnectedAnchor

public Vector3 ConnectedAnchor

Where it holds the other, in its entity's own units, or in the world's where there is none.

Axis

public Vector3 Axis

What it turns about, in its entity's own units: up, for a door.

Motor

public JointMotor3D Motor

What the motor does: nothing, drive it at a speed, or to an angle.

MotorSpeed

public float MotorSpeed

How fast the motor turns it, in degrees a second, anticlockwise looking down the axis.

TargetAngle

public float TargetAngle

The angle the motor turns it to, in degrees from where it was made, within its limits.

MotorFrequency

public float MotorFrequency

How stiffly the motor holds it at its target, in times a second it would bounce there.

MotorDampingRatio

public float MotorDampingRatio

How the motor's spring is slowed at its target: 0 not at all, 1 at once.

MaxMotorTorque

public float MaxMotorTorque

The most torque the motor turns it with, in newton meters.

UseLimits

public bool UseLimits

Whether it stops turning at HingeJoint3D.LowerAngle and HingeJoint3D.UpperAngle.

LowerAngle

public float LowerAngle

The least it turns, in degrees from where it was made: from a half turn back to nothing.

UpperAngle

public float UpperAngle

The most it turns, in degrees from where it was made: from nothing to a half turn.

BreakForce

public float BreakForce

The force it breaks at, in newtons; infinity never.

BreakTorque

public float BreakTorque

The torque it breaks at, in newton meters; infinity never.