constraints/point_to_point_constraint
library
Classes
-
PointToPointConstraint
-
Connects two bodies at given offset points.
@example
const bodyA = Body({ mass: 1 })
const bodyB = Body({ mass: 1 })
bodyA.position.set(-1, 0, 0)
bodyB.position.set(1, 0, 0)
bodyA.addShape(shapeA)
bodyB.addShape(shapeB)
world.addBody(bodyA)
world.addBody(bodyB)
const localPivotA = Vec3(1, 0, 0)
const localPivotB = Vec3(-1, 0, 0)
const constraint = PointToPointConstraint(bodyA, localPivotA, bodyB, localPivotB)
world.addConstraint(constraint)