Skip to content

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 ​

ts
new DistanceJoint(options): DistanceJoint;

Defined in: packages/core/src/joints/DistanceJoint.ts:37

Parameters ​

ParameterType
optionsDistanceJointOptions

Returns ​

DistanceJoint

Overrides ​

BaseJoint.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
anchorAreadonlyVector3undefined--packages/core/src/joints/DistanceJoint.ts:28
anchorBreadonlyVector3undefined--packages/core/src/joints/DistanceJoint.ts:29
bodyAreadonlyBodyundefined-BaseJoint.bodyApackages/core/src/joints/BaseJoint.ts:23
bodyBreadonlyBody | undefinedundefined-BaseJoint.bodyBpackages/core/src/joints/BaseJoint.ts:24
breakForcepublicnumberundefined-BaseJoint.breakForcepackages/core/src/joints/BaseJoint.ts:32
breakTorquepublicnumberundefined-BaseJoint.breakTorquepackages/core/src/joints/BaseJoint.ts:33
brokenpublicbooleanfalseSet once the joint has broken.BaseJoint.brokenpackages/core/src/joints/BaseJoint.ts:42
collideConnectedSettingreadonlyboolean | "unlessOverlapping"undefinedAs asked for, before a world decides 'unlessOverlapping'.BaseJoint.collideConnectedSettingpackages/core/src/joints/BaseJoint.ts:30
compliancepublicnumberundefined--packages/core/src/joints/DistanceJoint.ts:31
dampingpublicnumberundefined--packages/core/src/joints/DistanceJoint.ts:33
forcereadonlyVector3...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.forcepackages/core/src/joints/BaseJoint.ts:38
lengthpublicnumberundefined--packages/core/src/joints/DistanceJoint.ts:30
slackpublicbooleanundefined--packages/core/src/joints/DistanceJoint.ts:32
tensionpublicnumber0Tension in newtons, written by the backend after each step; 0 while a rope is slack.-packages/core/src/joints/DistanceJoint.ts:35
torquereadonlyVector3...The torque the joint put on the same body over the last step, in N·m. Written by the backend.BaseJoint.torquepackages/core/src/joints/BaseJoint.ts:40

Accessors ​

bodies ​

Get Signature ​

ts
get bodies(): readonly Body[];

Defined in: packages/core/src/joints/BaseJoint.ts:59

The bodies the joint ties together.

Returns ​

readonly Body[]

Inherited from ​

BaseJoint.bodies


collideConnected ​

Get Signature ​

ts
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 ​

BaseJoint.collideConnected


isOverloaded ​

Get Signature ​

ts
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 ​

BaseJoint.isOverloaded

Methods ​

currentAnchors() ​

ts
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

NameTypeDefined in
distancenumberpackages/core/src/joints/DistanceJoint.ts:48
pointAVector3packages/core/src/joints/DistanceJoint.ts:48
pointBVector3packages/core/src/joints/DistanceJoint.ts:48

Released under the MIT License.