public class CircleShape

  1. Object
  2. Shape
  3. CircleShape
A circle shape.

Fields

public final Vec2 m_p

Constructors

public CircleShape()

Methods

public final Shape clone()
public final int getChildCount()Get the number of child primitives
public final int getSupport(Vec2 d)Get the supporting vertex index in the given direction.
public final Vec2 getSupportVertex(Vec2 d)Get the supporting vertex in the given direction.
public final int getVertexCount()Get the vertex count.
public final Vec2 getVertex(int index)Get a vertex by index.
public final boolean testPoint(Transform transform, Vec2 p)Test a point for containment in this shape.
public final boolean raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex)Cast a ray against a child shape.
public final void computeAABB(AABB aabb, Transform transform, int childIndex)Given a transform, compute the associated axis aligned bounding box for a child shape.
public final void computeMass(MassData massData, float density)Compute the mass properties of this shape using its dimensions and density.

Inherited fields

Inherited methods

Field details

m_p

public final Vec2 m_p

Constructor details

CircleShape

public CircleShape()

Method details

clone

public final Shape clone()

getChildCount

public final int getChildCount()
Get the number of child primitives

getSupport

public final int getSupport(Vec2 d)
Get the supporting vertex index in the given direction.

getSupportVertex

public final Vec2 getSupportVertex(Vec2 d)
Get the supporting vertex in the given direction.

getVertexCount

public final int getVertexCount()
Get the vertex count.

getVertex

public final Vec2 getVertex(int index)
Get a vertex by index.

testPoint

public final boolean testPoint(Transform transform, Vec2 p)
Test a point for containment in this shape. This only works for convex shapes.

Parameters

transform Transform
the shape world transform.
p Vec2
a point in world coordinates.

raycast

public final boolean raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex)
Cast a ray against a child shape.

Returns

if hit

computeAABB

public final void computeAABB(AABB aabb, Transform transform, int childIndex)
Given a transform, compute the associated axis aligned bounding box for a child shape.

computeMass

public final void computeMass(MassData massData, float density)
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.

Parameters

massData MassData
returns the mass data for this shape.
density float
the density in kilograms per meter squared.