b2Shape
b2Shape
Box2D.Collision.ShapesA shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in b2World are created automatically when a b2Fixture is created. Shapes may encapsulate a one or more child shapes.
Inheritance: System.Object
Constructors
b2Shape()
b2Shape()()
b2Shape(b2Shape)
b2Shape(b2Shape)(Box2D.Collision.Shapes.b2Shape copy)
Parameters:
copy
(Box2D.Collision.Shapes.b2Shape)Fields
Radius(System.Single)
ShapeType(Box2D.Collision.Shapes.b2ShapeType)
Methods
Clone()
Box2D.Collision.Shapes.b2Shape Clone()()
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)
Parameters:
output
(Box2D.Collision.b2AABB)xf
(Box2D.Common.b2Transform)childIndex
(System.Int32)Example
ComputeMass(float)
Box2D.Collision.Shapes.b2MassData ComputeMass(float)(System.Single density)
Parameters:
density
(System.Single)Returns:
Box2D.Collision.Shapes.b2MassData
Example
GetChildCount()
System.Int32 GetChildCount()()
Returns:
System.Int32
Example
GetShapeType()
Box2D.Collision.Shapes.b2ShapeType GetShapeType()()
Returns:
Box2D.Collision.Shapes.b2ShapeType
Example
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 transform, System.Int32 childIndex)
Parameters:
output
(Box2D.Collision.b2RayCastOutput)input
(Box2D.Collision.b2RayCastInput)transform
(Box2D.Common.b2Transform)childIndex
(System.Int32)Returns:
System.Boolean
Example
TestPoint(ref b2Transform, b2Vec2)
System.Boolean TestPoint(ref b2Transform, b2Vec2)(Box2D.Common.b2Transform xf, Box2D.Common.b2Vec2 p)
Parameters:
xf
(Box2D.Common.b2Transform)p
(Box2D.Common.b2Vec2)Returns:
System.Boolean
Example