Chipmunk2D Pro API Reference
7.0.1
|
Constraints connect two ChipmunkBody objects together. More...
#import <ChipmunkConstraint.h>
Inherits NSObject, and <ChipmunkBaseObject>.
Inherited by ChipmunkDampedRotarySpring, ChipmunkDampedSpring, ChipmunkGearJoint, ChipmunkGrooveJoint, ChipmunkPinJoint, ChipmunkPivotJoint, ChipmunkRatchetJoint, ChipmunkRotaryLimitJoint, ChipmunkSimpleMotor, and ChipmunkSlideJoint.
Instance Methods | |
(void) | - preSolve: |
Override this method to update a constraints parameters just before running the physics each step. | |
(void) | - postSolve: |
Override this method to poll values from a constraint each frame after the physics runs. More... | |
Class Methods | |
(ChipmunkConstraint *) | + constraintFromCPConstraint: |
Get the ChipmunkConstraint object associciated with a cpConstraint pointer. More... | |
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). More... | |
cpFloat | errorBias |
The rate at which joint error is corrected. More... | |
cpFloat | maxBias |
Maximum rate (speed) that a joint can be corrected at (defaults to infinity). More... | |
BOOL | collideBodies |
Whether or not the connected bodies should checked for collisions. More... | |
cpFloat | impulse |
Get the most recent impulse applied by this constraint. | |
ChipmunkSpace * | space |
Get the space the body is added to. | |
id | userData |
An object that this constraint is associated with. More... | |
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.
- (void) postSolve: | (ChipmunkSpace *) | space |
Override this method to poll values from a constraint each frame after the physics runs.
This can be used to implement breakable joints for instance.
|
readwritenonatomicassign |
Whether or not the connected bodies should checked for collisions.
Collisions are filtered before calling callbacks. Defaults to TRUE.
|
readwritenonatomicassign |
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.
|
readwritenonatomicassign |
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 servo motor.
|
readwritenonatomicassign |
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.
|
readwritenonatomicassign |
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.