# Class Manifold

java.lang.Object
com.codename1.gaming.physics.box2d.collision.Manifold

public class Manifold extends Object

A manifold for two touching convex shapes. Box2D supports multiple types of contact:

- clip point versus plane with radius
- point versus point with radius (circles)

The local point usage depends on the manifold type:

- e_circles: the local center of circleA
- e_faceA: the center of faceA
- e_faceB: the center of faceB

Similarly the local normal usage:

- e_circles: not used
- e_faceA: the normal on polygonA
- e_faceB: the normal on polygonB

We store contacts in this way so that position correction can account for movement, which is critical for continuous physics. All contact scenarios must be expressed in one of these types. This structure is stored across time steps, so we keep it small.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `Manifold.ManifoldType`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final Vec2`
  `localNormal`
  not use for Type::e_points
  `final Vec2`
  `localPoint`
  usage depends on manifold type
  `int`
  `pointCount`
  The number of manifold points.
  `final ManifoldPoint[]`
  `points`
  The points of contact.
  `Manifold.ManifoldType`
  `type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Manifold()`
  creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.
  `Manifold(Manifold other)`
  Creates this manifold as a copy of the other

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `set(Manifold cp)`
  copies this manifold from the given one

  ### Methods inherited from class Object

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

- ## Field Details

  - ### points

    public final ManifoldPoint[] points
    The points of contact.

  - ### localNormal

    public final Vec2 localNormal
    not use for Type::e_points

  - ### localPoint

    public final Vec2 localPoint
    usage depends on manifold type

  - ### type

    public Manifold.ManifoldType type

  - ### pointCount

    public int pointCount
    The number of manifold points.

- ## Constructor Details

  - ### Manifold

    public Manifold()
    creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.

  - ### Manifold

    public Manifold(Manifold other)
    Creates this manifold as a copy of the other
    Parameters:
      `other` -

- ## Method Details

  - ### set

    public void set(Manifold cp)
    copies this manifold from the given one
    Parameters:
      `cp` - manifold to copy from