C# Class Box2D.Collision.Shapes.Shape

A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in World are created automatically when a Fixture is created. Shapes may encapsulate a one or more child shapes.
Mostrar archivo Open project: gerich-home/box2dnet Class Usage Examples

Public Methods

Method Description
Clone ( ) : Shape

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

ComputeAABB ( AABB aabb, Transform xf, int childIndex ) : void

Given a transform, compute the associated axis aligned bounding box for a child 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.

Raycast ( RayCastOutput output, RayCastInput input, Transform transform, int childIndex ) : bool

Cast a ray against a child shape.

TestPoint ( Transform xf, Vec2 p ) : bool

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

Protected Methods

Method Description
Shape ( ShapeType type ) : Box2D.Common

Method Details

Clone() public abstract method

* /// Compute the volume and centroid of this shape intersected with a half plane * ///
public abstract Clone ( ) : Shape
return Shape

ComputeAABB() public abstract method

Given a transform, compute the associated axis aligned bounding box for a child shape.
public abstract ComputeAABB ( AABB aabb, Transform xf, int childIndex ) : void
aabb AABB returns the axis aligned box.
xf Box2D.Common.Transform the world transform of the shape.
childIndex int
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.
public abstract ComputeMass ( MassData massData, float density ) : void
massData MassData returns the mass data for this shape.
density float the density in kilograms per meter squared.
return void

Raycast() public abstract method

Cast a ray against a child shape.
public abstract Raycast ( RayCastOutput output, RayCastInput input, Transform transform, int childIndex ) : bool
output RayCastOutput the ray-cast results.
input RayCastInput the ray-cast input parameters.
transform Box2D.Common.Transform the transform to be applied to the shape.
childIndex int the child shape index
return bool

Shape() protected method

protected Shape ( ShapeType type ) : Box2D.Common
type ShapeType
return Box2D.Common

TestPoint() public abstract method

Test a point for containment in this shape. This only works for convex shapes.
public abstract TestPoint ( Transform xf, Vec2 p ) : bool
xf Box2D.Common.Transform the shape world transform.
p Box2D.Common.Vec2 a point in world coordinates.
return bool