PointToPointConstraint class
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)
- Inheritance
-
- Object
- Constraint
- PointToPointConstraint
- Implementers
Constructors
- PointToPointConstraint(Body bodyA, Body bodyB, [Vec3? pivotA, Vec3? pivotB, double maxForce = 1e6])
-
pivotA
The point relative to the center of mass of bodyA which bodyA is constrained to.bodyB
Body that will be constrained in a similar way to the same point as bodyA. We will therefore get a link between bodyA and bodyB. If not specified, bodyA will be constrained to a static point.pivotB
The point relative to the center of mass of bodyB which bodyB is constrained to.maxForce
The maximum force that should be applied to constrain the bodies.
Properties
- bodyA ↔ Body
-
getter/setter pairinherited
- bodyB ↔ Body
-
getter/setter pairinherited
- collideConnected ↔ bool
-
Set to false if you don't want the bodies to collide when they are connected.
getter/setter pairinherited
-
equations
↔ List<
Equation> -
Equations to be solved in this constraint.
getter/setter pairinherited
- equationX ↔ ContactEquation
-
getter/setter pair
- equationY ↔ ContactEquation
-
getter/setter pair
- equationZ ↔ ContactEquation
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int
-
getter/setter pairinherited
- pivotA ↔ Vec3
-
Pivot, defined locally in bodyA.
getter/setter pair
- pivotB ↔ Vec3
-
Pivot, defined locally in bodyB.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
disable(
) → void -
Disables all equations in the constraint.
inherited
-
enable(
) → void -
Enables all equations in the constraint.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → void -
Update all the equations with data.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited