Module org.dyn4j

Class IndexedManifoldPointId

  • All Implemented Interfaces:
    ManifoldPointId

    public class IndexedManifoldPointId
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      IndexedManifoldPointId​(int referenceEdge, int incidentEdge, int incidentVertex)
      Optional constructor.
      IndexedManifoldPointId​(int referenceEdge, int incidentEdge, int incidentVertex, boolean flipped)
      Full constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      int getIncidentEdge()
      Returns the incident edge index of this manifold on the other Shape.
      int getIncidentVertex()
      Returns the index of the deepest collision point of the incident edge of this manifold on the other Shape.
      int getReferenceEdge()
      Returns the reference edge index of this manifold on the Shape.
      int hashCode()  
      boolean isFlipped()
      Returns true if the reference edge and incident edges were swapped.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IndexedManifoldPointId

        public IndexedManifoldPointId​(int referenceEdge,
                                      int incidentEdge,
                                      int incidentVertex)
        Optional constructor.
        Parameters:
        referenceEdge - the reference edge index
        incidentEdge - the incident edge index
        incidentVertex - the incident vertex index
        Since:
        3.1.5
      • IndexedManifoldPointId

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

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getReferenceEdge

        public int getReferenceEdge()
        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
      • getIncidentEdge

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

        public int getIncidentVertex()
        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