Skip to main content

b2ChainShape

b2ChainShape

Box2D.Collision.Shapes

Inheritance: System.Object → Box2D.Collision.Shapes.b2Shape

Constructors

b2ChainShape()

b2ChainShape()()

b2ChainShape(b2ChainShape)

b2ChainShape(b2ChainShape)(Box2D.Collision.Shapes.b2ChainShape clone)
Parameters:
clone (Box2D.Collision.Shapes.b2ChainShape)

Fields

Count(System.Int32)
HasNextVertex(System.Boolean)
HasPrevVertex(System.Boolean)
NextVertex(Box2D.Common.b2Vec2)
PrevVertex(Box2D.Common.b2Vec2)
Vertices(Box2D.Common.b2Vec2[])

Methods

Clone()

Box2D.Collision.Shapes.b2Shape Clone()()

Clone the concrete shape using the provided allocator.

Returns:
Box2D.Collision.Shapes.b2Shape
Example

ComputeAABB(out b2AABB, ref b2Transform, int)

ComputeAABB(out b2AABB, ref b2Transform, int)(Box2D.Collision.b2AABB output, Box2D.Common.b2Transform xf, System.Int32 childIndex)

Given a transform, compute the associated axis aligned bounding box for a child shape. @param aabb returns the axis aligned box. @param xf the world transform of the shape. @param childIndex the child shape

Parameters:
output (Box2D.Collision.b2AABB)
xf (Box2D.Common.b2Transform)
childIndex (System.Int32)
Example

ComputeMass(float)

Box2D.Collision.Shapes.b2MassData ComputeMass(float)(System.Single density)

Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin. @param massData returns the mass data for this shape. @param density the density in kilograms per meter squared.

Parameters:
density (System.Single)
Returns:
Box2D.Collision.Shapes.b2MassData
Example

CreateChain(b2Vec2[], int)

CreateChain(b2Vec2[], int)(Box2D.Common.b2Vec2[] vertices, System.Int32 count)
Parameters:
vertices (Box2D.Common.b2Vec2[])
count (System.Int32)

CreateLoop(b2Vec2[], int)

CreateLoop(b2Vec2[], int)(Box2D.Common.b2Vec2[] vertices, System.Int32 count)
Parameters:
vertices (Box2D.Common.b2Vec2[])
count (System.Int32)

GetChildCount()

System.Int32 GetChildCount()()

Get the number of child primitives.

Returns:
System.Int32
Example

GetChildEdge(int)

Box2D.Collision.Shapes.b2EdgeShape GetChildEdge(int)(System.Int32 index)
Parameters:
index (System.Int32)
Returns:
Box2D.Collision.Shapes.b2EdgeShape

RayCast(out b2RayCastOutput, b2RayCastInput, ref b2Transform, int)

System.Boolean RayCast(out b2RayCastOutput, b2RayCastInput, ref b2Transform, int)(Box2D.Collision.b2RayCastOutput output, Box2D.Collision.b2RayCastInput input, Box2D.Common.b2Transform xf, System.Int32 childIndex)

Cast a ray against a child shape. @param output the ray-cast results. @param input the ray-cast input parameters. @param transform the transform to be applied to the shape. @param childIndex the child shape index

Parameters:
output (Box2D.Collision.b2RayCastOutput)
input (Box2D.Collision.b2RayCastInput)
xf (Box2D.Common.b2Transform)
childIndex (System.Int32)
Returns:
System.Boolean
Example

SetNextVertex(b2Vec2)

SetNextVertex(b2Vec2)(Box2D.Common.b2Vec2 nextVertex)
Parameters:
nextVertex (Box2D.Common.b2Vec2)

SetPrevVertex(b2Vec2)

SetPrevVertex(b2Vec2)(Box2D.Common.b2Vec2 prevVertex)
Parameters:
prevVertex (Box2D.Common.b2Vec2)

TestPoint(ref b2Transform, b2Vec2)

System.Boolean TestPoint(ref b2Transform, b2Vec2)(Box2D.Common.b2Transform xf, Box2D.Common.b2Vec2 p)

Test a point for containment in this shape. This only works for convex shapes. @param xf the shape world transform. @param p a point in world coordinates.

Parameters:
xf (Box2D.Common.b2Transform)
p (Box2D.Common.b2Vec2)
Returns:
System.Boolean
Example