Package pybox2d :: Module Box2D :: Class b2PolygonDef
[hide private]
[frames] | no frames]

type b2PolygonDef

source code


Convex polygon. The vertices must be in CCW order for a right-handed coordinate system with the z-axis coming out of the screen.

Instance Methods [hide private]
b2PolygonDef
__init__(self)
Convex polygon.
source code
 
__getstate__(self, additional_ignore=[])
Returns a dictionary representation of self, with dict(var=value [, ...])
source code
 
__setstate__(self, dict)
Takes each variable=value pair in the dictionary and sets the attributes based on them
source code
 
__repr__(self) source code
 
checkValues(self) source code
 
getVertices_tuple(self)
Returns all of the vertices as a list of tuples [ (x1,y1), (x2,y2) ...
source code
 
getVertices_b2Vec2(self)
Returns all of the vertices as a list of b2Vec2's [ (x1,y1), (x2,y2) ...
source code
 
setVertices(self, vertices)
Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ...
source code
 
setVertices_tuple(self, vertices)
Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ...
source code
 
setVertices_b2Vec2(self, vertices)
Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ...
source code
 
__swig_destroy__(...)
delete_b2PolygonDef(b2PolygonDef self)
 
SetAsBox(...)
SetAsBox(float32 hx, float32 hy) b2PolygonDef_SetAsBox(b2PolygonDef self, float32 hx, float32 hy, b2Vec2 center, float32 angle)
source code
 
getVertex(...)
b2PolygonDef_getVertex(b2PolygonDef self, uint16 vnum) -> b2Vec2
source code
 
setVertex(...)
setVertex(uint16 vnum, b2Vec2 value) b2PolygonDef_setVertex(b2PolygonDef self, uint16 vnum, float32 x, float32 y)
source code
    Inherited from b2ShapeDef
 
ClearUserData(...)
b2ShapeDef_ClearUserData(b2ShapeDef self)
source code
 
GetUserData(...)
b2ShapeDef_GetUserData(b2ShapeDef self) -> PyObject
source code
 
SetUserData(...)
b2ShapeDef_SetUserData(b2ShapeDef self, PyObject data)
source code
 
__del__(self) source code
Properties [hide private]
  thisown
The membership flag
  vertexCount
b2PolygonDef_vertexCount_get(b2PolygonDef self) -> int32
  vertices
Returns all of the vertices as a list of tuples [ (x1,y1), (x2,y2) ...
    Inherited from b2ShapeDef
  density
b2ShapeDef_density_get(b2ShapeDef self) -> float32
  filter
b2ShapeDef_filter_get(b2ShapeDef self) -> b2FilterData
  friction
b2ShapeDef_friction_get(b2ShapeDef self) -> float32
  isSensor
b2ShapeDef_isSensor_get(b2ShapeDef self) -> bool
  restitution
b2ShapeDef_restitution_get(b2ShapeDef self) -> float32
  type
b2ShapeDef_type_get(b2ShapeDef self) -> b2ShapeType
  userData
GetUserData(self) -> PyObject
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Convex polygon. The vertices must be in CCW order for a right-handed coordinate system with the z-axis coming out of the screen.

Returns: b2PolygonDef
Overrides: b2ShapeDef.__init__

__getstate__(self, additional_ignore=[])

source code 

Returns a dictionary representation of self, with 
 dict(var=value [, ...])

additional_ignore can be specified to ignore certain
properties. 

Overrides: _generic_getstate

__setstate__(self, dict)

source code 

Takes each variable=value pair in the dictionary and sets the attributes based on them

Overrides: _generic_setstate

__repr__(self)
(Representation operator)

source code 
Overrides: b2ShapeDef.__repr__

getVertices_tuple(self)

source code 

Returns all of the vertices as a list of tuples [ (x1,y1), (x2,y2) ... (xN,yN) ]

getVertices_b2Vec2(self)

source code 

Returns all of the vertices as a list of b2Vec2's [ (x1,y1), (x2,y2) ... (xN,yN) ]

setVertices(self, vertices)

source code 

Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ... (xN,yN) ) where each vertex is a list/tuple/b2Vec2

setVertices_tuple(self, vertices)

source code 

Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ... (xN,yN) ) where each vertex is a list/tuple/b2Vec2

setVertices_b2Vec2(self, vertices)

source code 

Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ... (xN,yN) ) where each vertex is a list/tuple/b2Vec2

__swig_destroy__(...)

 

delete_b2PolygonDef(b2PolygonDef self)

Overrides: b2ShapeDef.__swig_destroy__

SetAsBox(...)

source code 

SetAsBox(float32 hx, float32 hy)
b2PolygonDef_SetAsBox(b2PolygonDef self, float32 hx, float32 hy, b2Vec2 center, 
    float32 angle)

Build vertices to represent an oriented box.

Parameters:
-----------

hx: the half-width.

hy: the half-height.

center: 
the center of the box in local coordinates.

angle: 
the rotation of the box in local coordinates.


Property Details [hide private]

thisown

The membership flag

vertexCount

b2PolygonDef_vertexCount_get(b2PolygonDef self) -> int32

vertices

Returns all of the vertices as a list of tuples [ (x1,y1), (x2,y2) ... (xN,yN) ]

Get Method:
getVertices_tuple(self) - Returns all of the vertices as a list of tuples [ (x1,y1), (x2,y2) ...
Set Method:
setVertices(self, vertices) - Sets all of the vertices given a tuple in the format ( (x1,y1), (x2,y2) ...