Class | CP::Space |
In: |
doc_dummy.rb
|
Parent: | Object |
The Chipmunk space class.
damping | [RW] | The amount of damping to apply to the system when updating. |
gravity | [RW] | The amount of gravity in the system. Must be a CP::Vect. |
iterations | [RW] | The number of iterations to use when solving constraints. (collisions and joints) |
Add a block to be called when a collision between a shape with a collision_type of type_a and a shape with a collision_type of type_b is found. Supplying no block or _&nil_ will reject any collision between the two given collision types.
Add the given shape to the space‘s active spatial hash. Shapes attached to moving bodies should be added here as they will be rehashed on every call to Space#step
Add the given shape to the space‘s static spatial hash. Static shapes are only rehashed when Space#rehash_static is called, so they should not move.
Set the default collision function to be used when no specifid function is found. Normally this simply accepts all collisions. Supplying no block or _&nil_ will reject collisions by default. Keep in mind that the default func will handle a lot of collisions, and you don‘t want 100,000 block calls a second!