Package pymunk :: Class Circle
[frames] | no frames]

Class Circle

object --+    
         |    
     Shape --+
             |
            Circle

A circle shape defined by a radius

This is the fastest and simplest collision shape

Instance Methods
 
__init__(self, body, radius, offset=(0, 0))
body is the body attach the circle to, offset is the offset from the body's center of gravity in body local coordinates.
 
unsafe_set_radius(self, r)
Unsafe set the radius of the circle.
 
unsafe_set_offset(self, o)
Unsafe set the offset of the circle.
 
__del__(self) (Inherited from pymunk.Shape)
 
cache_bb(self)
Update and returns the bouding box of this shape (Inherited from pymunk.Shape)
 
point_query(self, p)
Check if the given point lies within the shape. (Inherited from pymunk.Shape)
 
segment_query(self, start, end)
Check if the line segment from start to end intersects the shape. (Inherited from pymunk.Shape)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  radius
The Radius of the circle
  offset
Offset.
  body
The body this shape is attached to (Inherited from pymunk.Shape)
  collision_type
User defined collision type for the shape. (Inherited from pymunk.Shape)
  elasticity
Elasticity of the shape. (Inherited from pymunk.Shape)
  friction
Friction coefficient. (Inherited from pymunk.Shape)
  group
Shapes in the same non-zero group do not generate collisions. (Inherited from pymunk.Shape)
  layers
Shapes only collide if they are in the same bit-planes. (Inherited from pymunk.Shape)
  sensor
A boolean value if this shape is a sensor or not. (Inherited from pymunk.Shape)
  surface_velocity
The surface velocity of the object. (Inherited from pymunk.Shape)

Inherited from object: __class__

Method Details

__init__(self, body, radius, offset=(0, 0))
(Constructor)

 
body is the body attach the circle to, offset is the offset from the body's center of gravity in body local coordinates.
Overrides: object.__init__

unsafe_set_radius(self, r)

 

Unsafe set the radius of the circle.

WARNING: This change is only picked up as a change to the position of the shape's surface, but not it's velocity. Changing it will not result in realistic physical behavior. Only use if you know what you are doing!

unsafe_set_offset(self, o)

 

Unsafe set the offset of the circle.

WARNING: This change is only picked up as a change to the position of the shape's surface, but not it's velocity. Changing it will not result in realistic physical behavior. Only use if you know what you are doing!


Property Details

radius

The Radius of the circle
Get Method:
_get_radius(self)

offset

Offset. (body space coordinates)
Get Method:
_get_offset(self)