Scripting API

Scripting API

WheelJoint2D

Struct in Abyss.Physics2D, from Abyss.Physics2D.

A wheel on a body: WheelJoint2D.ConnectedBody, the wheel, turning freely about WheelJoint2D.ConnectedAnchor and held to the body this is on — the car — by a suspension along a line, a spring of WheelJoint2D.SuspensionFrequency and WheelJoint2D.SuspensionDampingRatio. Its motor turns the wheel.

public struct WheelJoint2D

Remarks

The suspension is at WheelJoint2D.SuspensionAngle degrees in the world as the joint is made, 90 straight up, and turns with the car after. Anchors and breaking as HingeJoint2D's; with no wheel, it holds the car to the world.

Fields

ConnectedBody

public EntityRef ConnectedBody

The wheel: an entity with a Rigidbody 2D, 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 Vector2 Anchor

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

ConnectedAnchor

public Vector2 ConnectedAnchor

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

SuspensionDampingRatio

public float SuspensionDampingRatio

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

SuspensionFrequency

public float SuspensionFrequency

How stiff the suspension's spring is, in times a second it bounces.

SuspensionAngle

public float SuspensionAngle

Which way the suspension moves, in degrees anticlockwise from the world's X as it is made.

UseMotor

public bool UseMotor

Whether the motor turns the wheel.

MotorSpeed

public float MotorSpeed

How fast the motor turns the wheel against the car, in degrees a second, anticlockwise.

MaxMotorTorque

public float MaxMotorTorque

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

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.