Class pymunk.Shape

Known Subclasses:
Circle, Poly, Segment

Methods

  __init__(self, shape=None)
  __del__(self)
  cache_bb(self)

Properties

  id
  collision_type
  group
Shapes in the same non-zero group do not generate collisions.
  layers
Shapes only collide if they are in the same bit-planes.
  elasticity
Elasticity of the shape.
  friction
Friction coefficient.
  surface_velocity
The surface velocity of the object.
  body

Property Details

id

collision_type

group

Shapes in the same non-zero group do not generate collisions. Useful when creating an object out of many shapes that you don't want to self collide. Defaults to 0

layers

Shapes only collide if they are in the same bit-planes. i.e. (a->layers & b->layers) != 0 By default, a shape occupies all 32 bit-planes.

elasticity

Elasticity of the shape. A value of 0.0 gives no bounce, while a value of 1.0 will give a 'perfect' bounce. However due to inaccuracies in the simulation using 1.0 or greater is not recommended.

friction

Friction coefficient. Chipmunk uses the Coulomb friction model, a value of 0.0 is frictionless.

surface_velocity

The surface velocity of the object. Useful for creating conveyor belts or players that move around. This value is only used when calculating friction, not the collision.

body