C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Shape ( ShapeType type ) : Box2D.Common

Описание методов

Clone() публичный абстрактный Метод

* /// Compute the volume and centroid of this shape intersected with a half plane * ///
public abstract Clone ( ) : Shape
Результат Shape

ComputeAABB() публичный абстрактный Метод

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
Результат void

ComputeMass() публичный абстрактный Метод

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.
Результат void

Raycast() публичный абстрактный Метод

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
Результат bool

Shape() защищенный Метод

protected Shape ( ShapeType type ) : Box2D.Common
type ShapeType
Результат Box2D.Common

TestPoint() публичный абстрактный Метод

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.
Результат bool