- type
- class
- extends
- Constraint
LineJoint constraining anchor of one body, to a line segment of the other.
The equation for this constraint could be written like:
When jointMin = jointMax , it would be better to use a PivotJoint nstead with suitable placed anchors.
The line segment is defined implicitly via the anchor1, direction, jointMin and jointMax properties with end points defined in local coordinate system of body1 like:
The equation for this constraint could be written like:
0 = [dir.cross(delta)] = 0 jointMin <= [dor.dot (delta)] <= jointMaxwhere:
dir = body1.localVectorToWorld(direction).unit(); delta = body2.localPointToWorld(anchor2).sub(body1.localPointToWorld(anchor1));This is a 2 dimensional constraint, and is (when at the limits) solved as a block constraint for better stability. This is however not the most stable of joint when chained and put under stress and is a rather rare case where using a non-stiff joint can actually be more stable than using a stiff one.
When jointMin = jointMax , it would be better to use a PivotJoint nstead with suitable placed anchors.
The line segment is defined implicitly via the anchor1, direction, jointMin and jointMax properties with end points defined in local coordinate system of body1 like:
start = anchor1.add(direction.unit().mul(jointMin)) end = anchor1.add(direction.unit().mul(jointMax))The reason for this more general description of a line segment is that one or both of jointMin, jointMax are permitted to be infinite and a line segment defined with a start and end point is not sufficient to describe such lines.
Constructor
function
new(body1:Null<nape.phys.Body>, body2:Null<nape.phys.Body>, anchor1:nape.geom.Vec2, anchor2:nape.geom.Vec2, direction:nape.geom.Vec2, jointMin:Float, jointMax:Float)
Construct a new LineJoint.
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 body1 : Null<nape.phys.Body>
var body2 : 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 direction : nape.geom.Vec2
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