Gear joints constrain the rotational speed of one body to another. More...
#import <ChipmunkConstraint.h>
Inherits ChipmunkConstraint.
Public Member Functions | |
(id) | - initWithBodyA:bodyB:phase:ratio: |
Initialize a gear joint between the given bodies. | |
Static Public Member Functions | |
(ChipmunkGearJoint *) | + gearJointWithBodyA:bodyB:phase:ratio: |
Create an autoreleased gear joint between the given bodies. | |
Properties | |
cpFloat | phase |
The angular offset in radians. | |
cpFloat | ratio |
The ratio of the rotational speeds. |
Gear joints constrain the rotational speed of one body to another.
A ratio of 1.0 will lock the rotation of two bodies together, and negative ratios will cause them to spin in opposite directions. You can also use gear joints as rotary servos by setting ChipmunkConstraint.maxForce and ChipmunkConstraint.maxBias to finite values and changing the ChipmunkGearJoint.phase property.
+ (ChipmunkGearJoint *) gearJointWithBodyA: | (ChipmunkBody *) | a | ||
bodyB: | (ChipmunkBody *) | b | ||
phase: | (cpFloat) | phase | ||
ratio: | (cpFloat) | ratio | ||
Create an autoreleased gear joint between the given bodies.
phase | The angular offset. | |
ratio | The ratio of the rotational speeds. |
- (id) initWithBodyA: | (ChipmunkBody *) | a | ||
bodyB: | (ChipmunkBody *) | b | ||
phase: | (cpFloat) | phase | ||
ratio: | (cpFloat) | ratio | ||
Initialize a gear joint between the given bodies.
phase | The angular offset in radians. | |
ratio | The ratio of the rotational speeds. |