Public Member Functions | Static Public Member Functions | Properties

ChipmunkGearJoint Class Reference

Gear joints constrain the rotational speed of one body to another. More...

#import <ChipmunkConstraint.h>

Inherits ChipmunkConstraint.

List of all members.

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.

Detailed Description

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.


Member Function Documentation

+ (ChipmunkGearJoint *) gearJointWithBodyA: (ChipmunkBody *)  a
bodyB: (ChipmunkBody *)  b
phase: (cpFloat)  phase
ratio: (cpFloat)  ratio 

Create an autoreleased gear joint between the given bodies.

Parameters:
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.

Parameters:
phase The angular offset in radians.
ratio The ratio of the rotational speeds.

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