Package org.jbox2d.collision.shapes
Class CircleShape
java.lang.Object
org.jbox2d.collision.shapes.Shape
org.jbox2d.collision.shapes.CircleShape
A circle shape.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Shape
clone()
final void
computeAABB
(AABB aabb, Transform transform, int childIndex) Given a transform, compute the associated axis aligned bounding box for a child shape.final void
computeMass
(MassData massData, float density) Compute the mass properties of this shape using its dimensions and density.final int
Get the number of child primitivesfinal int
getSupport
(Vec2 d) Get the supporting vertex index in the given direction.final Vec2
Get the supporting vertex in the given direction.final Vec2
getVertex
(int index) Get a vertex by index.final int
Get the vertex count.final boolean
raycast
(RayCastOutput output, RayCastInput input, Transform transform, int childIndex) Cast a ray against a child shape.final boolean
Test a point for containment in this shape.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
m_p
-
-
Constructor Details
-
CircleShape
public CircleShape()
-
-
Method Details
-
clone
-
getChildCount
public final int getChildCount()Description copied from class:Shape
Get the number of child primitives- Specified by:
getChildCount
in classShape
- Returns:
-
getSupport
Get the supporting vertex index in the given direction.- Parameters:
d
-- Returns:
-
getSupportVertex
Get the supporting vertex in the given direction.- Parameters:
d
-- Returns:
-
getVertexCount
public final int getVertexCount()Get the vertex count.- Returns:
-
getVertex
Get a vertex by index.- Parameters:
index
-- Returns:
-
testPoint
Description copied from class:Shape
Test 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:Shape
Cast a ray against a child shape. -
computeAABB
Description copied from class:Shape
Given a transform, compute the associated axis aligned bounding box for a child shape.- Specified by:
computeAABB
in classShape
-
computeMass
Description copied from class:Shape
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.- Specified by:
computeMass
in classShape
- Parameters:
massData
- returns the mass data for this shape.density
- the density in kilograms per meter squared.
-