C# Class Box2DX.Collision.Shape

Inheritance: IDisposable
Show file Open project: KrugerHeavyIndustries/box2d-unity Class Usage Examples

Protected Properties

Property Type Description
_type ShapeType

Public Methods

Method Description
ComputeAABB ( AABB &aabb, Box2DX.Common.Transform xf ) : void

Given a Transform, compute the associated axis aligned bounding box for this shape.

ComputeMass ( MassData &massData, float density ) : void

Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.

ComputeSubmergedArea ( Vector2 normal, float offset, Box2DX.Common.Transform xf, Vector2 &c ) : float

Compute the volume and centroid of this shape intersected with a half plane.

ComputeSweepRadius ( Vector2 pivot ) : float

Compute the sweep radius. This is used for conservative advancement (continuous collision detection).

Dispose ( ) : void
GetSupport ( Vector2 d ) : int
GetSupportVertex ( Vector2 d ) : Vector2
GetVertex ( int index ) : Vector2
TestPoint ( Box2DX.Common.Transform xf, Vector2 p ) : bool

Test a point for containment in this shape. This only works for convex shapes.

TestSegment ( Box2DX.Common.Transform xf, float &lambda, Vector2 &normal, Segment segment, float maxLambda ) : SegmentCollide

Perform a ray cast against this shape.

Protected Methods

Method Description
Shape ( ) : System

Method Details

ComputeAABB() public abstract method

Given a Transform, compute the associated axis aligned bounding box for this shape.
public abstract ComputeAABB ( AABB &aabb, Box2DX.Common.Transform xf ) : void
aabb AABB Returns the axis aligned box.
xf Box2DX.Common.Transform The world Transform of the shape.
return void

ComputeMass() public abstract method

Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.
public abstract ComputeMass ( MassData &massData, float density ) : void
massData MassData Returns the mass data for this shape
density float
return void

ComputeSubmergedArea() public abstract method

Compute the volume and centroid of this shape intersected with a half plane.
public abstract ComputeSubmergedArea ( Vector2 normal, float offset, Box2DX.Common.Transform xf, Vector2 &c ) : float
normal Vector2 Normal the surface normal.
offset float Offset the surface offset along normal.
xf Box2DX.Common.Transform The shape Transform.
c Vector2 Returns the centroid.
return float

ComputeSweepRadius() public abstract method

Compute the sweep radius. This is used for conservative advancement (continuous collision detection).
public abstract ComputeSweepRadius ( Vector2 pivot ) : float
pivot Vector2 Pivot is the pivot point for rotation.
return float

Dispose() public method

public Dispose ( ) : void
return void

GetSupport() public abstract method

public abstract GetSupport ( Vector2 d ) : int
d Vector2
return int

GetSupportVertex() public abstract method

public abstract GetSupportVertex ( Vector2 d ) : Vector2
d Vector2
return Vector2

GetVertex() public abstract method

public abstract GetVertex ( int index ) : Vector2
index int
return Vector2

Shape() protected method

protected Shape ( ) : System
return System

TestPoint() public abstract method

Test a point for containment in this shape. This only works for convex shapes.
public abstract TestPoint ( Box2DX.Common.Transform xf, Vector2 p ) : bool
xf Box2DX.Common.Transform The shape world Transform.
p Vector2 A point in world coordinates.
return bool

TestSegment() public abstract method

Perform a ray cast against this shape.
public abstract TestSegment ( Box2DX.Common.Transform xf, float &lambda, Vector2 &normal, Segment segment, float maxLambda ) : SegmentCollide
xf Box2DX.Common.Transform The shape world Transform.
lambda float Returns the hit fraction. You can use this to compute the contact point /// p = (1 - lambda) * segment.P1 + lambda * segment.P2.
normal Vector2 Returns the normal at the contact point. If there is no intersection, /// the normal is not set.
segment Segment Defines the begin and end point of the ray cast.
maxLambda float A number typically in the range [0,1].
return SegmentCollide

Property Details

_type protected property

protected ShapeType _type
return ShapeType