Class CP::Space
In: doc_dummy.rb
Parent: Object

The Chipmunk space class.

Methods

Attributes

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)

Public Class methods

Public Instance methods

Add the given rigid body to the space.

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 joint to the space.

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.

Rehash the static spatial hash.

Remove the given body from the space.

Remove a block added with _add_collision_func()_.

Remove the given joint from the space.

Remove the given joint from the space‘s static spatial hash.

Remove the given shape from the space‘s active spatial hash.

Resize the active spatial hash.

Resize the static spatial hash.

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!

Move the space forward by dt seconds. Using a fixed size time step is highly recommended for efficiency of the contact persistence algorithm.

[Validate]