Class PolygonShape

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

public class PolygonShape extends Shape
  • Field Details

    • m_centroid

      public final Vec2 m_centroid
    • m_vertices

      public final Vec2[] m_vertices
    • m_normals

      public final Vec2[] m_normals
    • m_count

      public int m_count
  • Constructor Details

    • PolygonShape

      public PolygonShape()
  • Method Details

    • clone

      public final Shape clone()
      Specified by:
      clone in class Shape
    • set

      public final void set(Vec2[] vertices, int count)
    • set

      public final void set(Vec2[] verts, int num, Vec2Array vecPool, IntArray intPool)
    • setAsBox

      public final void setAsBox(float hx, float hy)
    • setAsBox

      public final void setAsBox(float hx, float hy, Vec2 center, float angle)
    • getChildCount

      public int getChildCount()
      Specified by:
      getChildCount in class Shape
    • testPoint

      public final boolean testPoint(Transform xf, Vec2 p)
      Specified by:
      testPoint in class Shape
    • computeAABB

      public final void computeAABB(AABB aabb, Transform xf, int childIndex)
      Specified by:
      computeAABB in class Shape
    • getVertexCount

      public final int getVertexCount()
    • getVertex

      public final Vec2 getVertex(int index)
    • raycast

      public final boolean raycast(RayCastOutput output, RayCastInput input, Transform xf, int childIndex)
      Specified by:
      raycast in class Shape
    • computeCentroidToOut

      public final void computeCentroidToOut(Vec2[] vs, int count, Vec2 out)
    • computeMass

      public void computeMass(MassData massData, float density)
      Specified by:
      computeMass in class Shape
    • validate

      public boolean validate()
    • getVertices

      public Vec2[] getVertices()
    • getNormals

      public Vec2[] getNormals()
    • centroid

      public Vec2 centroid(Transform xf)
    • centroidToOut

      public Vec2 centroidToOut(Transform xf, Vec2 out)