Static Public Member Functions | Properties

ChipmunkConstraint Class Reference

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.

List of all members.

Static Public Member Functions

(ChipmunkConstraint *) + constraintFromCPConstraint:
 Get the ChipmunkConstraint object associciated with a cpConstraint pointer.

Properties

cpConstraintconstraint
 Returns a pointer to the underlying cpConstraint C struct.
ChipmunkBodybodyA
 The first ChipmunkBody the constraint controls.
ChipmunkBodybodyB
 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.

Detailed Description

Constraints connect two ChipmunkBody objects together.

Most often constraints are simple joints, but can also be things like motors, friction generators or servos.


Member Function Documentation

+ (ChipmunkConstraint *) constraintFromCPConstraint: (cpConstraint *)  constraint  

Get the ChipmunkConstraint object associciated with a cpConstraint pointer.

Undefined if the cpConstraint wasn't created using Objective-Chipmunk.


Property Documentation

- (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.

Attention:
Like most 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.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Properties