# Class Shape

java.lang.Object
com.codename1.gaming.physics.box2d.collision.shapes.Shape

Direct Known Subclasses:
  `ChainShape, CircleShape, EdgeShape, PolygonShape`

public abstract class Shape extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `float`
  `m_radius`
  `final ShapeType`
  `m_type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Shape(ShapeType type)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Shape`
  `clone()`
  `abstract void`
  `computeAABB(AABB aabb, Transform xf, int childIndex)`
  `abstract void`
  `computeMass(MassData massData, float density)`
  `abstract int`
  `getChildCount()`
  `float`
  `getRadius()`
  `ShapeType`
  `getType()`
  `abstract boolean`
  `raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex)`
  `void`
  `setRadius(float radius)`
  `abstract boolean`
  `testPoint(Transform xf, Vec2 p)`

  ### Methods inherited from class Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### m_type

    public final ShapeType m_type

  - ### m_radius

    public float m_radius

- ## Constructor Details

  - ### Shape

    public Shape(ShapeType type)

- ## Method Details

  - ### getType

    public ShapeType getType()

  - ### getRadius

    public float getRadius()

  - ### setRadius

    public void setRadius(float radius)

  - ### getChildCount

    public abstract int getChildCount()

  - ### testPoint

    public abstract boolean testPoint(Transform xf, Vec2 p)

  - ### raycast

    public abstract boolean raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex)

  - ### computeAABB

    public abstract void computeAABB(AABB aabb, Transform xf, int childIndex)

  - ### computeMass

    public abstract void computeMass(MassData massData, float density)

  - ### clone

    public abstract Shape clone()
    Overrides:
      `clone` in class `Object`