00001 00012 @interface ChipmunkConstraint : NSObject <ChipmunkBaseObject> { 00013 @private 00014 id data; 00015 } 00016 00018 @property (readonly) cpConstraint *constraint; 00019 00021 @property (retain, readonly) ChipmunkBody *bodyA; 00022 00024 @property (retain, readonly) ChipmunkBody *bodyB; 00025 00028 +(ChipmunkConstraint *)constraintFromCPConstraint:(cpConstraint *)constraint; 00029 00035 @property cpFloat maxForce; 00036 00041 @property cpFloat errorBias; 00042 00047 @property cpFloat maxBias; 00048 00053 @property (assign) id data; 00054 00055 @end 00056 00057 00062 @interface ChipmunkPinJoint : ChipmunkConstraint { 00063 @private 00064 cpPinJoint _constraint; 00065 } 00066 00071 + (ChipmunkPinJoint *)pinJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00072 00077 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00078 00080 @property cpVect anchr1; 00081 00083 @property cpVect anchr2; 00084 00086 @property cpFloat dist; 00087 00088 @end 00089 00090 00095 @interface ChipmunkSlideJoint : ChipmunkConstraint { 00096 @private 00097 cpSlideJoint _constraint; 00098 } 00099 00103 + (ChipmunkSlideJoint *)slideJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; 00104 00108 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; 00109 00111 @property cpVect anchr1; 00112 00114 @property cpVect anchr2; 00115 00117 @property cpFloat min; 00118 00120 @property cpFloat max; 00121 00122 @end 00123 00124 00128 @interface ChipmunkPivotJoint : ChipmunkConstraint { 00129 @private 00130 cpPivotJoint _constraint; 00131 } 00132 00137 + (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00138 00142 + (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; 00143 00148 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00149 00153 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; 00154 00156 @property cpVect anchr1; 00157 00159 @property cpVect anchr2; 00160 00161 @end 00162 00163 00167 @interface ChipmunkGrooveJoint : ChipmunkConstraint { 00168 @private 00169 cpGrooveJoint _constraint; 00170 } 00171 00179 + (ChipmunkGrooveJoint *)grooveJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; 00180 00188 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; 00189 00190 // TODO groove setters 00191 00192 @end 00193 00194 00199 @interface ChipmunkDampedSpring : ChipmunkConstraint { 00200 @private 00201 cpDampedSpring _constraint; 00202 } 00203 00210 + (ChipmunkDampedSpring *)dampedSpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00211 00218 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00219 00221 @property cpVect anchr1; 00222 00224 @property cpVect anchr2; 00225 00227 @property cpFloat restLength; 00228 00230 @property cpFloat stiffness; 00231 00233 @property cpFloat damping; 00234 00235 @end 00236 00237 00241 @interface ChipmunkDampedRotarySpring : ChipmunkConstraint { 00242 @private 00243 cpDampedRotarySpring _constraint; 00244 } 00245 00246 00253 + (ChipmunkDampedRotarySpring *)dampedRotarySpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00254 00261 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00262 00264 @property cpFloat restAngle; 00265 00267 @property cpFloat stiffness; 00268 00270 @property cpFloat damping; 00271 00272 @end 00273 00274 00279 @interface ChipmunkRotaryLimitJoint : ChipmunkConstraint { 00280 @private 00281 cpRotaryLimitJoint _constraint; 00282 } 00283 00288 + (ChipmunkRotaryLimitJoint *)rotaryLimitJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; 00289 00294 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; 00295 00297 @property cpFloat min; 00298 00300 @property cpFloat max; 00301 00302 @end 00303 00304 00309 @interface ChipmunkSimpleMotor : ChipmunkConstraint { 00310 @private 00311 cpSimpleMotor _constraint; 00312 } 00313 00315 + (ChipmunkSimpleMotor *)simpleMotorWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; 00316 00318 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; 00319 00321 @property cpFloat rate; 00322 00323 @end 00324 00325 00331 @interface ChipmunkGearJoint : ChipmunkConstraint { 00332 @private 00333 cpGearJoint _constraint; 00334 } 00335 00341 + (ChipmunkGearJoint *)gearJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; 00342 00348 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; 00349 00351 @property cpFloat phase; 00353 @property cpFloat ratio; 00354 00355 @end 00356 00360 @interface ChipmunkRatchetJoint : ChipmunkConstraint { 00361 @private 00362 cpRatchetJoint _constraint; 00363 } 00364 00370 + (ChipmunkRatchetJoint *)ratchetJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; 00371 00377 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; 00378 00380 @property cpFloat angle; 00381 00383 @property cpFloat phase; 00384 00386 @property cpFloat ratchet; 00387 00388 @end