@ue-too/dynamics / index / FixedPinJoint
クラス: FixedPinJoint
定義: constraint.ts:50
Pin joint connecting a body to a fixed world point.
Remarks
Creates a pendulum-like constraint where a point on the body is pinned to a fixed location in world space. The body can rotate around this point.
Uses Baumgarte stabilization to prevent drift.
例
Create a pendulum
typescript
const bob = new Circle({ x: 0, y: 100 }, 20, 0, 10, false);
const joint = new FixedPinJoint(
bob,
{ x: 0, y: 0 }, // Anchor on bob (center)
{ x: 0, y: 0 } // World anchor (ceiling)
);
world.addRigidBody('bob', bob);
world.addConstraint(joint);実装
コンストラクター
コンストラクター
new FixedPinJoint(
bodyA,anchorA,worldAnchorA):FixedPinJoint
定義: constraint.ts:55
パラメータ
bodyA
anchorA
Point
worldAnchorA
Point
戻り値
FixedPinJoint
メソッド
enforce()
enforce(
dt):void
定義: constraint.ts:61
Enforces the constraint for one timestep.
パラメータ
dt
number
Timestep in seconds
戻り値
void
の実装
solveWorldPinJointConstraint()
solveWorldPinJointConstraint(
dt):void
定義: constraint.ts:65
パラメータ
dt
number
戻り値
void