C# Class Box2DX.Collision.PolygonShape

A convex polygon. It is assumed that the interior of the polygon is to the left of each edge.
Inheritance: Shape
Show file Open project: danielpcox/Crisis-at-Swiss-Station Class Usage Examples

Public Methods

Method Description
Centroid ( XForm xf ) : Vec2

Get the centroid and apply the supplied transform.

ComputeAABB ( AABB &aabb, XForm xf ) : void
ComputeCentroid ( Vec2 vs, int count ) : Vec2
ComputeMass ( MassData &massData ) : void
ComputeOBB ( OBB &obb, Vec2 vs, int count ) : void
ComputeSubmergedArea ( Vec2 normal, float offset, XForm xf, Vec2 &c ) : float
ComputeSweptAABB ( AABB &aabb, XForm transform1, XForm transform2 ) : void
GetCentroid ( ) : Vec2

Get local centroid relative to the parent body.

GetCoreVertices ( ) : Box2DX.Common.Vec2[]

Get the core vertices in local coordinates. These vertices represent a smaller polygon that is used for time of impact computations.

GetFirstVertex ( XForm xf ) : Vec2

Get the first vertex and apply the supplied transform.

GetOBB ( ) : OBB

Get the oriented bounding box relative to the parent body.

GetVertices ( ) : Box2DX.Common.Vec2[]

Get the vertices in local coordinates.

Support ( XForm xf, Vec2 d ) : Vec2

Get the support point in the given world direction. Use the supplied transform.

TestPoint ( XForm xf, Vec2 p ) : bool
TestSegment ( XForm xf, float &lambda, Vec2 &normal, Segment segment, float maxLambda ) : SegmentCollide

Private Methods

Method Description
PolygonShape ( ShapeDef def ) : System
UpdateSweepRadius ( Vec2 center ) : void

Method Details

Centroid() public method

Get the centroid and apply the supplied transform.
public Centroid ( XForm xf ) : Vec2
xf Box2DX.Common.XForm
return Box2DX.Common.Vec2

ComputeAABB() public method

public ComputeAABB ( AABB &aabb, XForm xf ) : void
aabb AABB
xf Box2DX.Common.XForm
return void

ComputeCentroid() public static method

public static ComputeCentroid ( Vec2 vs, int count ) : Vec2
vs Box2DX.Common.Vec2
count int
return Box2DX.Common.Vec2

ComputeMass() public method

public ComputeMass ( MassData &massData ) : void
massData MassData
return void

ComputeOBB() public static method

public static ComputeOBB ( OBB &obb, Vec2 vs, int count ) : void
obb OBB
vs Box2DX.Common.Vec2
count int
return void

ComputeSubmergedArea() public method

public ComputeSubmergedArea ( Vec2 normal, float offset, XForm xf, Vec2 &c ) : float
normal Box2DX.Common.Vec2
offset float
xf Box2DX.Common.XForm
c Box2DX.Common.Vec2
return float

ComputeSweptAABB() public method

public ComputeSweptAABB ( AABB &aabb, XForm transform1, XForm transform2 ) : void
aabb AABB
transform1 Box2DX.Common.XForm
transform2 Box2DX.Common.XForm
return void

GetCentroid() public method

Get local centroid relative to the parent body.
public GetCentroid ( ) : Vec2
return Box2DX.Common.Vec2

GetCoreVertices() public method

Get the core vertices in local coordinates. These vertices represent a smaller polygon that is used for time of impact computations.
public GetCoreVertices ( ) : Box2DX.Common.Vec2[]
return Box2DX.Common.Vec2[]

GetFirstVertex() public method

Get the first vertex and apply the supplied transform.
public GetFirstVertex ( XForm xf ) : Vec2
xf Box2DX.Common.XForm
return Box2DX.Common.Vec2

GetOBB() public method

Get the oriented bounding box relative to the parent body.
public GetOBB ( ) : OBB
return OBB

GetVertices() public method

Get the vertices in local coordinates.
public GetVertices ( ) : Box2DX.Common.Vec2[]
return Box2DX.Common.Vec2[]

Support() public method

Get the support point in the given world direction. Use the supplied transform.
public Support ( XForm xf, Vec2 d ) : Vec2
xf Box2DX.Common.XForm
d Box2DX.Common.Vec2
return Box2DX.Common.Vec2

TestPoint() public method

public TestPoint ( XForm xf, Vec2 p ) : bool
xf Box2DX.Common.XForm
p Box2DX.Common.Vec2
return bool

TestSegment() public method

public TestSegment ( XForm xf, float &lambda, Vec2 &normal, Segment segment, float maxLambda ) : SegmentCollide
xf Box2DX.Common.XForm
lambda float
normal Box2DX.Common.Vec2
segment Segment
maxLambda float
return SegmentCollide