nape.constraint.WeldJoint

type
class
extends
Constraint
WeldJoint constraining two bodies to be exactly locked together.

The equation for this constraint is:
[ body2.localPointToWorld(anchor2) ] = [ body1.localPointToWorld(anchor1) ]
[          body2.rotation          ]   [      body1.rotation + phase      ]
This constraint is equivalent to using a PivotJoint and AngleJoint together except that it is solved as a single constraint and thus will be more stable.

This constraint is 3 dimensional.

Although this constraint is very stable, if you chain bodies together using this constraint, you should except to see a small amount of rotation about the anchor points so you should chose them accordingly.

Constructor

function new(body1:Null<nape.phys.Body>, body2:Null<nape.phys.Body>, anchor1:nape.geom.Vec2, anchor2:nape.geom.Vec2, phase:Float = 0)
+ Construct a new WeldJoint.

Instance Properties hide inherited show inherited

var active : Bool = true

+ Whether this constraint is active or not.

var anchor1 : nape.geom.Vec2

+ Anchor point on first Body.

var anchor2 : nape.geom.Vec2

+ Anchor point on second Body.

var body1 : Null<nape.phys.Body>

+ First Body in constraint.

var body2 : Null<nape.phys.Body>

+ Second Body in constraint.

var breakUnderError : Bool = false

+ Whether constraint will break once maxError is reached.

var breakUnderForce : Bool = false

+ Whether constraint will break once maxForce is reached.

readonly var cbTypes : nape.callbacks.CbTypeList = [CbType.ANY_CONSTRAINT]

+ Set of CbTypes for this constraints for callbacks.

var compound : Null<nape.phys.Compound> = null

+ Compound this Constraints belong to.

var damping : Float = 1

+ Damping ratio of elastic properties of constraint.

var debugDraw : Bool = true

+ Set to disable debug drawing/

var frequency : Float = 10

+ Frequency of elastic properties of constraint.

var ignore : Bool = false

+ Whether interactions between related Bodys will be ignored.

readonly var isSleeping : Bool

+ Whether this constraint is sleeping or not.

var maxError : Float = infinity

+ The maximum amount of error this constraint is allowed to use.

var maxForce : Float = infinity

+ The maximum amount of force this constraint is allowed to use.

var phase : Float = 0

Angular phase of bodies in WeldJoint.

var removeOnBreak : Bool = true

+ Whether constraint will be removed when it breaks.

var space : Null<nape.space.Space> = null

+ Space this constraint is inside of.

var stiff : Bool = true

+ Whether constraint is stiff, or elastic.

readonly var userData : Dynamic<Dynamic> = {}

+ Dynamic object for user to store additional data.

Instance Methods hide inherited show inherited

function bodyImpulse(body:nape.phys.Body):nape.geom.Vec3

+ Compute impulse that was applied to the given Body.

copy():Constraint

+ Produce copy of constraint.

function impulse():nape.geom.MatMN

+ Return the constraint-space impulse applied in previous step.

function visitBodies(lambda:nape.phys.Body -> Void):Void

+ Apply given function to all Bodys linked to the constraint.