C# Class Box2D.Collision.Shapes.ChainShape

A chain shape is a free form sequence of line segments. The chain has two-sided collision, so you can use inside and outside collision. Therefore, you may use any winding order. Since there may be many vertices, they are allocated using Alloc. Connectivity information is used to create smooth collisions. WARNING The chain will not collide properly if there are self-intersections.
Inheritance: Shape
Mostra file Open project: gerich-home/box2dnet Class Usage Examples

Public Properties

Property Type Description
Count int
HasNextVertex bool
HasPrevVertex bool
Vertices Box2D.Common.Vec2[]

Public Methods

Method Description
ChainShape ( ) : System.Diagnostics
Clone ( ) : Shape
ComputeAABB ( AABB aabb, Transform xf, int childIndex ) : void
ComputeMass ( MassData massData, float density ) : void
CreateChain ( Vec2 vertices, int count ) : void

Create a chain with isolated end vertices.

CreateLoop ( Vec2 vertices, int count ) : void

Create a loop. This automatically adjusts connectivity.

GetChildEdge ( EdgeShape edge, int index ) : void

Get a child edge.

Raycast ( RayCastOutput output, RayCastInput input, Transform xf, int childIndex ) : bool
TestPoint ( Transform xf, Vec2 p ) : bool

Method Details

ChainShape() public method

public ChainShape ( ) : System.Diagnostics
return System.Diagnostics

Clone() public method

public Clone ( ) : Shape
return Shape

ComputeAABB() public method

public ComputeAABB ( AABB aabb, Transform xf, int childIndex ) : void
aabb AABB
xf Box2D.Common.Transform
childIndex int
return void

ComputeMass() public method

public ComputeMass ( MassData massData, float density ) : void
massData MassData
density float
return void

CreateChain() public method

Create a chain with isolated end vertices.
public CreateChain ( Vec2 vertices, int count ) : void
vertices Box2D.Common.Vec2 an array of vertices, these are copied
count int the vertex count
return void

CreateLoop() public method

Create a loop. This automatically adjusts connectivity.
public CreateLoop ( Vec2 vertices, int count ) : void
vertices Box2D.Common.Vec2 an array of vertices, these are copied
count int the vertex count
return void

GetChildEdge() public method

Get a child edge.
public GetChildEdge ( EdgeShape edge, int index ) : void
edge EdgeShape
index int
return void

Raycast() public method

public Raycast ( RayCastOutput output, RayCastInput input, Transform xf, int childIndex ) : bool
output RayCastOutput
input RayCastInput
xf Box2D.Common.Transform
childIndex int
return bool

TestPoint() public method

public TestPoint ( Transform xf, Vec2 p ) : bool
xf Box2D.Common.Transform
p Box2D.Common.Vec2
return bool

Property Details

Count public_oe property

public int Count
return int

HasNextVertex public_oe property

public bool HasNextVertex
return bool

HasPrevVertex public_oe property

public bool HasPrevVertex
return bool

Vertices public_oe property

public Vec2[],Box2D.Common Vertices
return Box2D.Common.Vec2[]