Module org.dyn4j

Class IndexedManifoldPointId

  • All Implemented Interfaces:
    ManifoldPointId

    public class IndexedManifoldPointId
    extends Object
    implements ManifoldPointId
    Represents a ManifoldPointId that uses edge indexing.

    The the edge and vertex indicies are the indicies of the edges and verticies in the reference and incident Convex Shapes in the collision.

    The flipped flag is set when the default reference edge is swapped to be the incident edge.

    For a given Convex Shape the indicies should not change, although there is no mechanism preventing this. In the case they change, this should only affect any caching of this information.

    Since:
    1.0.0
    Version:
    3.2.0
    Author:
    William Bittle
    See Also:
    ManifoldPointId.DISTANCE
    • Constructor Detail

      • IndexedManifoldPointId

        public IndexedManifoldPointId​(int referenceEdgeIndex,
                                      int incidentEdgeIndex,
                                      int incidentVertexIndex)
        Optional constructor.
        Parameters:
        referenceEdgeIndex - the reference edge index
        incidentEdgeIndex - the incident edge index
        incidentVertexIndex - the incident vertex index
        Since:
        3.1.5
      • IndexedManifoldPointId

        public IndexedManifoldPointId​(int referenceEdgeIndex,
                                      int incidentEdgeIndex,
                                      int incidentVertexIndex,
                                      boolean flipped)
        Full constructor.
        Parameters:
        referenceEdgeIndex - the reference edge index
        incidentEdgeIndex - the incident edge index
        incidentVertexIndex - the incident vertex index
        flipped - whether the reference and incident features flipped
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getReferenceEdgeIndex

        public int getReferenceEdgeIndex()
        Returns the reference edge index of this manifold on the Shape.

        The reference edge is the edge that is most perpendicular to the collision normal.

        Returns:
        int
      • getIncidentEdgeIndex

        public int getIncidentEdgeIndex()
        Returns the incident edge index of this manifold on the other Shape.
        Returns:
        int
      • getIncidentVertexIndex

        public int getIncidentVertexIndex()
        Returns the index of the deepest collision point of the incident edge of this manifold on the other Shape.
        Returns:
        int
      • isFlipped

        public boolean isFlipped()
        Returns true if the reference edge and incident edges were swapped.
        Returns:
        boolean