eulerjs API / @eulerjs/core / TargetJoint
TargetJoint
Defined in: packages/core/src/joints/presets.ts:167
Pulls a body toward a pose in the world, as a spring and damper with limits: for dragging a body with the mouse, carrying it, or leading an active ragdoll along by its hips. Move the target with setTarget as often as you like. It pulls as hard as a spring of its frequency on the body's mass, so a body it holds up sags by g / (2π frequency)²; take away its gravity (gravityScale = 0) to have it hold the pose exactly.
Extends
Constructors
Constructor
new TargetJoint(options): TargetJoint;Defined in: packages/core/src/joints/presets.ts:170
Parameters
| Parameter | Type |
|---|---|
options | TargetJointOptions |
Returns
TargetJoint
Overrides
Properties
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
frequency
Get Signature
get frequency(): number;Defined in: packages/core/src/joints/presets.ts:200
How fast it springs to the target, in Hz; 0 lets the body go.
Returns
number
Set Signature
set frequency(frequency): void;Defined in: packages/core/src/joints/presets.ts:204
Parameters
| Parameter | Type |
|---|---|
frequency | number |
Returns
void
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
roles
Get Signature
get roles(): object;Defined in: packages/core/src/joints/SixDofJoint.ts:153
The joint's base frame and the frame that moves against it: frame A on body A and frame B on body B; or, for a joint to the world, the world's frame (frameB) and body A's (frameA), so that either way what is measured is how the second body moves.
Returns
object
| Name | Type | Defined in |
|---|---|---|
base | JointFrame | packages/core/src/joints/SixDofJoint.ts:153 |
baseBody | Body | undefined | packages/core/src/joints/SixDofJoint.ts:153 |
moving | JointFrame | packages/core/src/joints/SixDofJoint.ts:153 |
movingBody | Body | packages/core/src/joints/SixDofJoint.ts:153 |
Inherited from
target
Get Signature
get target(): JointFrame;Defined in: packages/core/src/joints/presets.ts:195
Where the anchor is pulled to and how the body is turned, in world space.
Returns
Methods
measure()
measure(): JointMeasurement;Defined in: packages/core/src/joints/SixDofJoint.ts:160
Where the moving frame is relative to the base frame (see roles), as the bodies are now.
Returns
Inherited from
setTarget()
setTarget(
position,
quaternion?,
velocity?
): void;Defined in: packages/core/src/joints/presets.ts:213
Moves the target: where to pull the anchor to, how to turn the body, and how fast the target itself is moving, which the body is pulled to match so that it keeps up instead of lagging.
Parameters
| Parameter | Type |
|---|---|
position | Vector3 |
quaternion? | Quaternion |
velocity? | Vector3 |
Returns
void
