Package org.jbox2d.collision.shapes
Class CircleShape
- java.lang.Object
-
- org.jbox2d.collision.shapes.Shape
-
- org.jbox2d.collision.shapes.CircleShape
-
public class CircleShape extends Shape
A circle shape.
-
-
Constructor Summary
Constructors Constructor Description CircleShape()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shapeclone()voidcomputeAABB(AABB aabb, Transform transform, int childIndex)Given a transform, compute the associated axis aligned bounding box for a child shape.voidcomputeMass(MassData massData, float density)Compute the mass properties of this shape using its dimensions and density.intgetChildCount()Get the number of child primitivesintgetSupport(Vec2 d)Get the supporting vertex index in the given direction.Vec2getSupportVertex(Vec2 d)Get the supporting vertex in the given direction.Vec2getVertex(int index)Get a vertex by index.intgetVertexCount()Get the vertex count.booleanraycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex)Cast a ray against a child shape.booleantestPoint(Transform transform, Vec2 p)Test a point for containment in this shape.
-
-
-
Field Detail
-
m_p
public final Vec2 m_p
-
-
Method Detail
-
getChildCount
public final int getChildCount()
Description copied from class:ShapeGet the number of child primitives- Specified by:
getChildCountin classShape- Returns:
-
getSupport
public final int getSupport(Vec2 d)
Get the supporting vertex index in the given direction.- Parameters:
d-- Returns:
-
getSupportVertex
public final Vec2 getSupportVertex(Vec2 d)
Get the supporting vertex in the given direction.- Parameters:
d-- Returns:
-
getVertexCount
public final int getVertexCount()
Get the vertex count.- Returns:
-
getVertex
public final Vec2 getVertex(int index)
Get a vertex by index.- Parameters:
index-- Returns:
-
testPoint
public final boolean testPoint(Transform transform, Vec2 p)
Description copied from class:ShapeTest a point for containment in this shape. This only works for convex shapes.
-
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
public final void computeAABB(AABB aabb, Transform transform, int childIndex)
Description copied from class:ShapeGiven a transform, compute the associated axis aligned bounding box for a child shape.- Specified by:
computeAABBin classShape
-
computeMass
public final void computeMass(MassData massData, float density)
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.
-
-