00001 00012 @interface ChipmunkConstraint : NSObject <ChipmunkBaseObject> { 00013 @private 00014 id data; 00015 } 00016 00018 @property (readonly) cpConstraint *constraint; 00019 00021 @property (retain) ChipmunkBody *bodyA; 00022 00024 @property (retain) ChipmunkBody *bodyB; 00025 00031 @property cpFloat maxForce; 00032 00037 @property cpFloat biasCoef; 00038 00043 @property cpFloat maxBias; 00044 00049 @property (assign) id data; 00050 00051 @end 00052 00053 00058 @interface ChipmunkPinJoint : ChipmunkConstraint { 00059 @private 00060 cpPinJoint _constraint; 00061 } 00062 00067 + (ChipmunkPinJoint *)pinJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00068 00073 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00074 00076 @property cpVect anchr1; 00077 00079 @property cpVect anchr2; 00080 00082 @property cpFloat dist; 00083 00084 @end 00085 00086 00091 @interface ChipmunkSlideJoint : ChipmunkConstraint { 00092 @private 00093 cpSlideJoint _constraint; 00094 } 00095 00099 + (ChipmunkSlideJoint *)slideJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; 00100 00104 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; 00105 00107 @property cpVect anchr1; 00108 00110 @property cpVect anchr2; 00111 00113 @property cpFloat min; 00114 00116 @property cpFloat max; 00117 00118 @end 00119 00120 00124 @interface ChipmunkPivotJoint : ChipmunkConstraint { 00125 @private 00126 cpPivotJoint _constraint; 00127 } 00128 00133 + (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00134 00138 + (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; 00139 00144 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; 00145 00149 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; 00150 00152 @property cpVect anchr1; 00153 00155 @property cpVect anchr2; 00156 00157 @end 00158 00159 00163 @interface ChipmunkGrooveJoint : ChipmunkConstraint { 00164 @private 00165 cpGrooveJoint _constraint; 00166 } 00167 00175 + (ChipmunkGrooveJoint *)grooveJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; 00176 00184 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; 00185 00186 // TODO groove setters 00187 00188 @end 00189 00190 00195 @interface ChipmunkDampedSpring : ChipmunkConstraint { 00196 @private 00197 cpDampedSpring _constraint; 00198 } 00199 00206 + (ChipmunkDampedSpring *)dampedSpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00207 00214 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00215 00217 @property cpVect anchr1; 00218 00220 @property cpVect anchr2; 00221 00223 @property cpFloat restLength; 00224 00226 @property cpFloat stiffness; 00227 00229 @property cpFloat damping; 00230 00231 @end 00232 00233 00237 @interface ChipmunkDampedRotarySpring : ChipmunkConstraint { 00238 @private 00239 cpDampedRotarySpring _constraint; 00240 } 00241 00242 00249 + (ChipmunkDampedRotarySpring *)dampedRotarySpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00250 00257 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; 00258 00260 @property cpFloat restAngle; 00261 00263 @property cpFloat stiffness; 00264 00266 @property cpFloat damping; 00267 00268 @end 00269 00270 00275 @interface ChipmunkRotaryLimitJoint : ChipmunkConstraint { 00276 @private 00277 cpRotaryLimitJoint _constraint; 00278 } 00279 00284 + (ChipmunkRotaryLimitJoint *)rotaryLimitJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; 00285 00290 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; 00291 00293 @property cpFloat min; 00294 00296 @property cpFloat max; 00297 00298 @end 00299 00300 00305 @interface ChipmunkSimpleMotor : ChipmunkConstraint { 00306 @private 00307 cpSimpleMotor _constraint; 00308 } 00309 00311 + (ChipmunkSimpleMotor *)simpleMotorWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; 00312 00314 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; 00315 00317 @property cpFloat rate; 00318 00319 @end 00320 00321 00327 @interface ChipmunkGearJoint : ChipmunkConstraint { 00328 @private 00329 cpGearJoint _constraint; 00330 } 00331 00337 + (ChipmunkGearJoint *)gearJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; 00338 00344 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; 00345 00347 @property cpFloat phase; 00349 @property cpFloat ratio; 00350 00351 @end 00352 00356 @interface ChipmunkRatchetJoint : ChipmunkConstraint { 00357 @private 00358 cpRatchetJoint _constraint; 00359 } 00360 00366 + (ChipmunkRatchetJoint *)ratchetJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; 00367 00373 - (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; 00374 00376 @property cpFloat angle; 00377 00379 @property cpFloat phase; 00380 00382 @property cpFloat ratchet; 00383 00384 @end