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

Class Segment

object --+    
         |    
     Shape --+
             |
            Segment

A line segment shape between two points This shape is mainly intended as a static shape.
Instance Methods
 
__init__(self, body, a, b, radius)
Create a Segment
 
__del__(self) (Inherited from pymunk.Shape)
 
cache_bb(self) (Inherited from pymunk.Shape)

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

Properties
  a
One of the two endpoints for this segment
  b
One of the two endpoints for this segment
  body (Inherited from pymunk.Shape)
  collision_type (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)
  id (Inherited from pymunk.Shape)
  layers
Shapes only collide if they are in the same bit-planes. (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, a, b, radius)
(Constructor)

 
Create a Segment
Parameters:
  • body (Body) - The body to attach the segment to
  • a ((x,y) or Vec2d) - The first endpoint of the segment
  • b ((x,y) or Vec2d) - The first endpoint of the segment
  • radius (float) - The thickness of the segment
Overrides: object.__init__

Property Details

a

One of the two endpoints for this segment
Get Method:
_get_a(self)
Set Method:
_set_a(self, a)

b

One of the two endpoints for this segment
Get Method:
_get_b(self)
Set Method:
_set_b(self, b)