C# Class FarseerPhysics.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. Connectivity information is used to create smooth collisions. WARNING: The chain will not collide properly if there are self-intersections.
Inheritance: Shape
Datei anzeigen Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
vertices Vertices

Public Methods

Method Description
ChainShape ( ) : System.Diagnostics

Constructor for ChainShape. By default have 0 in density.

ChainShape ( Vertices vertices, bool createLoop = false ) : System.Diagnostics

Create a new chainshape from the vertices.

CompareTo ( ChainShape shape ) : bool

Compare the chain to another chain

clone ( ) : Shape
computeAABB ( AABB &aabb, Transform &transform, int childIndex ) : void
computeSubmergedArea ( Vector2 &normal, float offset, Transform &xf, Vector2 &sc ) : float
getChildEdge ( int index ) : EdgeShape

Get a child edge.

rayCast ( RayCastOutput &output, RayCastInput &input, Transform &transform, int childIndex ) : bool
setVertices ( Vertices vertices, bool createLoop = false ) : void
testPoint ( Transform &transform, Vector2 &point ) : bool

Protected Methods

Method Description
computeProperties ( ) : void

Private Methods

Method Description
getChildEdge ( EdgeShape edge, int index ) : void

This method has been optimized to reduce garbage.

Method Details

ChainShape() public method

Constructor for ChainShape. By default have 0 in density.
public ChainShape ( ) : System.Diagnostics
return System.Diagnostics

ChainShape() public method

Create a new chainshape from the vertices.
public ChainShape ( Vertices vertices, bool createLoop = false ) : System.Diagnostics
vertices Vertices The vertices to use. Must contain 2 or more vertices.
createLoop bool Set to true to create a closed loop. It connects the first vertice to the last, and automatically adjusts connectivity to create smooth collisions along the chain.
return System.Diagnostics

CompareTo() public method

Compare the chain to another chain
public CompareTo ( ChainShape shape ) : bool
shape ChainShape The other chain
return bool

clone() public method

public clone ( ) : Shape
return Shape

computeAABB() public method

public computeAABB ( AABB &aabb, Transform &transform, int childIndex ) : void
aabb AABB
transform Transform
childIndex int
return void

computeProperties() protected method

protected computeProperties ( ) : void
return void

computeSubmergedArea() public method

public computeSubmergedArea ( Vector2 &normal, float offset, Transform &xf, Vector2 &sc ) : float
normal Microsoft.Xna.Framework.Vector2
offset float
xf Transform
sc Microsoft.Xna.Framework.Vector2
return float

getChildEdge() public method

Get a child edge.
public getChildEdge ( int index ) : EdgeShape
index int The index.
return EdgeShape

rayCast() public method

public rayCast ( RayCastOutput &output, RayCastInput &input, Transform &transform, int childIndex ) : bool
output RayCastOutput
input RayCastInput
transform Transform
childIndex int
return bool

setVertices() public method

public setVertices ( Vertices vertices, bool createLoop = false ) : void
vertices Vertices
createLoop bool
return void

testPoint() public method

public testPoint ( Transform &transform, Vector2 &point ) : bool
transform Transform
point Microsoft.Xna.Framework.Vector2
return bool

Property Details

vertices public_oe property

The vertices. These are not owned/freed by the chain Shape.
public Vertices vertices
return Vertices