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.
Static Public Member Functions | |
(ChipmunkConstraint *) | + constraintFromCPConstraint: |
Get the ChipmunkConstraint object associciated with a cpConstraint pointer. | |
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 | errorBias |
The rate at which joint error is corrected. | |
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.
+ (ChipmunkConstraint *) constraintFromCPConstraint: | (cpConstraint *) | constraint |
Get the ChipmunkConstraint object associciated with a cpConstraint pointer.
Undefined if the cpConstraint wasn't created using Objective-Chipmunk.
- (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) errorBias [read, write, assign] |
The rate at which joint error is corrected.
Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.
- (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.