- type
- class
- extends
- Constraint
PulleyJoint limiting the weighted sum of distances between 2 pairs of 4 local anchor points of Bodies.
The equation for this constraint could be written like:
* This constraint can be used in a full 4-body set up, or a 3-body set up or a 2-body set up permitting any arrangement as long as body1 != body2 and body3 != body4
The equation for this constraint could be written like:
jointMin <= distance(body2.localPointToWorld(anchor2), body1.localPointToWorld(anchor1)) + ratio * distance(body4.localPointToWorld(anchor4), body3.localPointToWorld(anchor3)) <= jointMaxThis joint is not designed to work when either of these pairs achieves a distance of 0, it will still work but may not be entirely ideal. *
* This constraint can be used in a full 4-body set up, or a 3-body set up or a 2-body set up permitting any arrangement as long as body1 != body2 and body3 != body4
Constructor
function
new(body1:Null<nape.phys.Body>, body2:Null<nape.phys.Body>, body3:Null<nape.phys.Body>, body4:Null<nape.phys.Body>, anchor1:nape.geom.Vec2, anchor2:nape.geom.Vec2, anchor3:nape.geom.Vec2, anchor4:nape.geom.Vec2, jointMin:Float, jointMax:Float, ratio:Float = null)
Construct a new PulleyJoint.
Instance Properties hide inherited show inherited
var active : Bool = true
inherited from nape.constraint.Constraint
var anchor1 : nape.geom.Vec2
var anchor2 : nape.geom.Vec2
var anchor3 : nape.geom.Vec2
var anchor4 : nape.geom.Vec2
var body1 : Null<nape.phys.Body>
var body2 : Null<nape.phys.Body>
var body3 : Null<nape.phys.Body>
var body4 : Null<nape.phys.Body>
var breakUnderError : Bool = false
inherited from nape.constraint.Constraint
var breakUnderForce : Bool = false
inherited from nape.constraint.Constraint
readonly var cbTypes : nape.callbacks.CbTypeList = [CbType.ANY_CONSTRAINT]
inherited from nape.constraint.Constraint
var compound : Null<nape.phys.Compound> = null
inherited from nape.constraint.Constraint
var damping : Float = 1
inherited from nape.constraint.Constraint
var debugDraw : Bool = true
inherited from nape.constraint.Constraint
var frequency : Float = 10
inherited from nape.constraint.Constraint
var ignore : Bool = false
inherited from nape.constraint.Constraint
readonly var isSleeping : Bool
inherited from nape.constraint.Constraint
var maxError : Float = infinity
inherited from nape.constraint.Constraint
var maxForce : Float = infinity
inherited from nape.constraint.Constraint
var removeOnBreak : Bool = true
inherited from nape.constraint.Constraint
var space : Null<nape.space.Space> = null
inherited from nape.constraint.Constraint
var stiff : Bool = true
inherited from nape.constraint.Constraint
readonly var userData : Dynamic<Dynamic> = {}
inherited from nape.constraint.Constraint
Instance Methods hide inherited show inherited
function bodyImpulse(body:nape.phys.Body):nape.geom.Vec3
overrides nape.constraint.Constraint
copy():Constraint
inherited from nape.constraint.Constraint
function impulse():nape.geom.MatMN
overrides nape.constraint.Constraint
function visitBodies(lambda:nape.phys.Body -> Void):Void
overrides nape.constraint.Constraint