UserConstraint

Constraintnape.constraint.UserConstraint (Class)

UserConstraint providing a low-level API for user-defined Constraints.

This API is intended to be powerful enough to model any constraint that Nape can handle, but not so low level as to be completely prohibitive.
For instance, things like soft-constraints are automatically provided by this API.

Working with this API will require mathematical skills. A full manual for this API is provided at: http://napephys.com/help/Constraints.pdf

You may also be interested in the nape-symbolic module that is available on github/haxelib/nape downloads. Which provides a run-time compiled DSL using this API to make prototyping (or creating non-performance critical) user-defined constraints simple without the need for great mathematical skills as well as being much quicker to work with.

Instance Members

@private


nape
impulse(): nape.geom.MatMN

@inheritDoc

For user-defined constraints, this will be a dimensions * 1 MatMN.

Returns
nape.geom.MatMN

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

@inheritDoc

Name Type
body nape.phys.Body
Returns
nape.geom.Vec3

nape
visitBodies(lambda: Function): Void

@inheritDoc

Name Type
lambda Function

nape
new(dimensions: Int, ?velocityOnly: Bool = false): Void

Base constructor for user constraints.

You should never call this function directly, only though use of super(..) in sub-typed UserConstraint.

Name Type Default Description
dimensions Int The number of constraint space dimensions.
velocityOnly Bool false If true, then this constraint will be implemented as a velocity-only constraint like the MotorJoint.