eulerjs API / @eulerjs/core / DistanceJoint
DistanceJoint
Defined in: packages/core/src/joints/DistanceJoint.ts:27
Keeps two points, on two bodies or on a body and the world, a fixed distance apart. Its settings can be changed between steps; the backend reads them every step.
Extends
Constructors
Constructor
new DistanceJoint(options): DistanceJoint;Defined in: packages/core/src/joints/DistanceJoint.ts:37
Parameters
| Parameter | Type |
|---|---|
options | DistanceJointOptions |
Returns
DistanceJoint
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|---|
anchorA | readonly | Vector3 | undefined | - | - | packages/core/src/joints/DistanceJoint.ts:28 |
anchorB | readonly | Vector3 | undefined | - | - | packages/core/src/joints/DistanceJoint.ts:29 |
bodyA | readonly | Body | undefined | - | BaseJoint.bodyA | packages/core/src/joints/BaseJoint.ts:23 |
bodyB | readonly | Body | undefined | undefined | - | BaseJoint.bodyB | packages/core/src/joints/BaseJoint.ts:24 |
breakForce | public | number | undefined | - | BaseJoint.breakForce | packages/core/src/joints/BaseJoint.ts:32 |
breakTorque | public | number | undefined | - | BaseJoint.breakTorque | packages/core/src/joints/BaseJoint.ts:33 |
broken | public | boolean | false | Set once the joint has broken. | BaseJoint.broken | packages/core/src/joints/BaseJoint.ts:42 |
collideConnectedSetting | readonly | boolean | "unlessOverlapping" | undefined | As asked for, before a world decides 'unlessOverlapping'. | BaseJoint.collideConnectedSetting | packages/core/src/joints/BaseJoint.ts:30 |
compliance | public | number | undefined | - | - | packages/core/src/joints/DistanceJoint.ts:31 |
damping | public | number | undefined | - | - | packages/core/src/joints/DistanceJoint.ts:33 |
force | readonly | Vector3 | ... | The force the joint put on body B over the last step (on body A, for a joint to the world), in N, world space; on the other it is the opposite. Written by the backend. | BaseJoint.force | packages/core/src/joints/BaseJoint.ts:38 |
length | public | number | undefined | - | - | packages/core/src/joints/DistanceJoint.ts:30 |
slack | public | boolean | undefined | - | - | packages/core/src/joints/DistanceJoint.ts:32 |
tension | public | number | 0 | Tension in newtons, written by the backend after each step; 0 while a rope is slack. | - | packages/core/src/joints/DistanceJoint.ts:35 |
torque | readonly | Vector3 | ... | The torque the joint put on the same body over the last step, in N·m. Written by the backend. | BaseJoint.torque | packages/core/src/joints/BaseJoint.ts:40 |
Accessors
bodies
Get Signature
get bodies(): readonly Body[];Defined in: packages/core/src/joints/BaseJoint.ts:59
The bodies the joint ties together.
Returns
readonly Body[]
Inherited from
collideConnected
Get Signature
get collideConnected(): boolean;Defined in: packages/core/src/joints/BaseJoint.ts:26
Whether the two bodies collide with each other; fixed once the joint is in a world.
Returns
boolean
Inherited from
isOverloaded
Get Signature
get isOverloaded(): boolean;Defined in: packages/core/src/joints/BaseJoint.ts:64
Whether the loads of the last step are more than the joint can take.
Returns
boolean
Inherited from
Methods
currentAnchors()
currentAnchors(): object;Defined in: packages/core/src/joints/DistanceJoint.ts:48
The anchors in world space and the distance between them, as of the last step.
Returns
object
| Name | Type | Defined in |
|---|---|---|
distance | number | packages/core/src/joints/DistanceJoint.ts:48 |
pointA | Vector3 | packages/core/src/joints/DistanceJoint.ts:48 |
pointB | Vector3 | packages/core/src/joints/DistanceJoint.ts:48 |
