Package org.jbox2d.collision.shapes
Class CircleShape
java.lang.Object
org.jbox2d.collision.shapes.Shape
org.jbox2d.collision.shapes.CircleShape
A circle shape.
- Author:
- Daniel Murphy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Shapeclone()final voidcomputeAABB(AABB aabb, Transform transform, int childIndex) Given a transform, compute the associated axis aligned bounding box for a child shape.floatcomputeDistanceToOut(Transform xf, Vec2 p, int childIndex, Vec2 normalOut) Compute the distance from the current shape to the specified point.final voidcomputeMass(MassData massData, float density) Compute the mass properties of this shape using its dimensions and density.final intGet the number of child primitivesfinal intgetSupport(Vec2 d) Get the supporting vertex index in the given direction.final Vec2Get the supporting vertex in the given direction.final Vec2getVertex(int index) Get a vertex by index.final intGet the vertex count.final booleanraycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex) Cast a ray against a child shape.final booleanTest a point for containment in this shape.
-
Field Details
-
p
-
-
Constructor Details
-
CircleShape
public CircleShape()
-
-
Method Details
-
clone
-
getChildCount
public final int getChildCount()Description copied from class:ShapeGet the number of child primitives- Specified by:
getChildCountin classShape
-
getSupport
Get the supporting vertex index in the given direction. -
getSupportVertex
Get the supporting vertex in the given direction. -
getVertexCount
public final int getVertexCount()Get the vertex count. -
getVertex
Get a vertex by index. -
testPoint
Description copied from class:ShapeTest a point for containment in this shape. This only works for convex shapes. -
computeDistanceToOut
Description copied from class:ShapeCompute the distance from the current shape to the specified point. This only works for convex shapes.- Specified by:
computeDistanceToOutin classShape- Parameters:
xf- The shape world transform.p- A point in world coordinates.normalOut- Returns the direction in which the distance increases.- Returns:
- distance returns the distance from the current shape.
-
raycast
public final boolean raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex) Description copied from class:ShapeCast a ray against a child shape. -
computeAABB
Description copied from class:ShapeGiven a transform, compute the associated axis aligned bounding box for a child shape.- Specified by:
computeAABBin classShape- Parameters:
aabb- Returns the axis aligned box.transform- The world transform of the shape.
-
computeMass
Description copied from class:ShapeCompute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.- Specified by:
computeMassin classShape- Parameters:
massData- Returns the mass data for this shape.density- The density in kilograms per meter squared.
-