| Package | Box2D.Collision.Shapes |
| Class | public class b2PolygonDef |
| Inheritance | b2PolygonDef b2ShapeDef |
| Source | b2PolygonDef.as |
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | density : Number = 0.0
The shape's density, usually in kg/m^2.
| b2ShapeDef | |
![]() | filter : b2FilterData
Contact filtering data.
| b2ShapeDef | |
![]() | friction : Number = 0.2
The shape's friction coefficient, usually in the range [0,1].
| b2ShapeDef | |
![]() | isSensor : Boolean = false
A sensor shape collects contact information but never generates a collision
response.
| b2ShapeDef | |
![]() | restitution : Number = 0.0
The shape's restitution (elasticity) usually in the range [0,1].
| b2ShapeDef | |
![]() | type : int
Holds the shape type for down-casting.
| b2ShapeDef | |
![]() | userData : * = null
Use this to store application specify shape data.
| b2ShapeDef | |
| vertexCount : int
The number of polygon vertices.
| b2PolygonDef | ||
| vertices : Array
The polygon vertices in local coordinates.
| b2PolygonDef | ||
| Method | Defined by | ||
|---|---|---|---|
| b2PolygonDef | |||
|
SetAsBox(hx:Number, hy:Number):void
Build vertices to represent an axis-aligned box.
| b2PolygonDef | ||
|
SetAsOrientedBox(hx:Number, hy:Number, center:b2Vec2 = null, angle:Number = 0.0):void
| b2PolygonDef | ||
| vertexCount | property |
public var vertexCount:intThe number of polygon vertices.
| vertices | property |
public var vertices:ArrayThe polygon vertices in local coordinates.
| b2PolygonDef | () | constructor |
public function b2PolygonDef()
| SetAsBox | () | method |
public function SetAsBox(hx:Number, hy:Number):voidBuild vertices to represent an axis-aligned box.
Parametershx:Number — the half-width.
|
|
hy:Number — the half-height.
|
| SetAsOrientedBox | () | method |
public function SetAsOrientedBox(hx:Number, hy:Number, center:b2Vec2 = null, angle:Number = 0.0):voidParameters
hx:Number |
|
hy:Number |
|
center:b2Vec2 (default = null) |
|
angle:Number (default = 0.0) |