Constraints connect two ChipmunkBody objects together. More...
#import <ChipmunkConstraint.h>
Inherits ChipmunkBaseObject-p.
Inherited by ChipmunkDampedRotarySpring, ChipmunkDampedSpring, ChipmunkGearJoint, ChipmunkGrooveJoint, ChipmunkPinJoint, ChipmunkPivotJoint, ChipmunkRatchetJoint, ChipmunkRotaryLimitJoint, ChipmunkSimpleMotor, and ChipmunkSlideJoint.
Properties | |
cpConstraint * | constraint |
Returns a pointer to the underlying cpConstraint C struct. | |
ChipmunkBody * | bodyA |
The first ChipmunkBody the constraint controls. | |
ChipmunkBody * | bodyB |
The second ChipmunkBody the constraint controls. | |
cpFloat | maxForce |
Maximum force this constraint is allowed to use (defalts to infinity). | |
cpFloat | biasCoef |
Amount of constraint error to correct each step (defaults to 10%). | |
cpFloat | maxBias |
Maximum rate (speed) that a joint can be corrected at (defaults to infinity). | |
id | data |
An object that this constraint is associated with. |
Constraints connect two ChipmunkBody objects together.
Most often constraints are simple joints, but can also be things like motors, friction generators or servos.
- (cpFloat) biasCoef [read, write, assign] |
Amount of constraint error to correct each step (defaults to 10%).
This can be used to fine tune constraint parameters.
- (id) data [read, write, assign] |
An object that this constraint is associated with.
You can use this get a reference to your game object or controller object from within callbacks.
delegate
properties this is a weak reference and does not call retain
. This prevents reference cycles from occuring. Reimplemented from <ChipmunkBaseObject>.
- (cpFloat) maxBias [read, write, assign] |
Maximum rate (speed) that a joint can be corrected at (defaults to infinity).
Setting this value to a finite value allows you to control a joint like a
- (cpFloat) maxForce [read, write, assign] |
Maximum force this constraint is allowed to use (defalts to infinity).
This allows joints to be pulled apart if too much force is applied to them. It also allows you to use constraints as force or friction generators for controlling bodies.