Interface Triangles

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default long add​(double v0x, double v0y, double v0z, double v1x, double v1y, double v1z, double v2x, double v2y, double v2z)
      Adds a triangle to the mesh's triangles list.
      default long add​(double v0x, double v0y, double v0z, double v1x, double v1y, double v1z, double v2x, double v2y, double v2z, double nx, double ny, double nz)
      Adds a triangle to the mesh's triangles list.
      default int add​(int v0, int v1, int v2, double nx, double ny, double nz)
      Adds a triangle to the mesh's triangles list, using int indices.
      default long add​(long v0, long v1, long v2)
      Adds a triangle to the mesh's triangles list.
      default long add​(long v0, long v1, long v2, double nx, double ny, double nz)
      Adds a triangle to the mesh's triangles list.
      default long addf​(float v0x, float v0y, float v0z, float v1x, float v1y, float v1z, float v2x, float v2y, float v2z)
      Adds a triangle to the mesh's triangles list.
      default long addf​(float v0x, float v0y, float v0z, float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float nx, float ny, float nz)
      Adds a triangle to the mesh's triangles list.
      default int addf​(int v0, int v1, int v2)
      Adds a triangle to the mesh's triangles list, using ints.
      default int addf​(int v0, int v1, int v2, float nx, float ny, float nz)
      Adds a triangle to the mesh's triangles list, using ints.
      default long addf​(long v0, long v1, long v2)
      Adds a triangle to the mesh's triangles list.
      long addf​(long v0, long v1, long v2, float nx, float ny, float nz)
      Adds a triangle to the mesh's triangles list.
      default Iterator<Triangle> iterator()  
      Mesh mesh()
      The mesh to which the collection of triangles belongs.
      default double nx​(long tIndex)
      X coordinate of triangle's normal, as a double.
      float nxf​(long tIndex)
      X coordinate of triangle's normal, as a float.
      default double ny​(long tIndex)
      Y coordinate of triangle's normal, as a double.
      float nyf​(long tIndex)
      Y coordinate of triangle's normal, as a float.
      default double nz​(long tIndex)
      Z coordinate of triangle's normal, as a double.
      float nzf​(long tIndex)
      Z coordinate of triangle's normal, as a float.
      default int size()
      Number of triangles in the collection as an int value.
      long sizel()
      Number of triangles in the collection as a long value.
      default int vertex0​(int tIndex)
      Index of first vertex in a triangle, as an int.
      long vertex0​(long tIndex)
      Index of first vertex in a triangle.
      default int vertex1​(int tIndex)
      Index of second vertex in a triangle, as an int.
      long vertex1​(long tIndex)
      Index of second vertex in a triangle.
      default int vertex2​(int tIndex)
      Index of third vertex in a triangle, as an int.
      long vertex2​(long tIndex)
      Index of third vertex in a triangle.
    • Method Detail

      • mesh

        Mesh mesh()
        The mesh to which the collection of triangles belongs.
      • sizel

        long sizel()
        Number of triangles in the collection as a long value.
      • vertex0

        long vertex0​(long tIndex)
        Index of first vertex in a triangle.
      • vertex1

        long vertex1​(long tIndex)
        Index of second vertex in a triangle.
      • vertex1

        default int vertex1​(int tIndex)
        Index of second vertex in a triangle, as an int. *
        Throws:
        RuntimeException - if the index exceeds Integer.MAX_VALUE.
      • vertex2

        long vertex2​(long tIndex)
        Index of third vertex in a triangle.
      • nxf

        float nxf​(long tIndex)
        X coordinate of triangle's normal, as a float.
      • nyf

        float nyf​(long tIndex)
        Y coordinate of triangle's normal, as a float.
      • nzf

        float nzf​(long tIndex)
        Z coordinate of triangle's normal, as a float.
      • addf

        long addf​(long v0,
                  long v1,
                  long v2,
                  float nx,
                  float ny,
                  float nz)
        Adds a triangle to the mesh's triangles list.
        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        nx - X coordinate of triangle's normal.
        ny - Y coordinate of triangle's normal.
        nz - Z coordinate of triangle's normal.
        Returns:
        Index of newly added triangle.
      • addf

        default int addf​(int v0,
                         int v1,
                         int v2,
                         float nx,
                         float ny,
                         float nz)
        Adds a triangle to the mesh's triangles list, using ints.
        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        nx - X coordinate of triangle's normal.
        ny - Y coordinate of triangle's normal.
        nz - Z coordinate of triangle's normal.
        Returns:
        Index of newly added triangle.
        Throws:
        RuntimeException - if the return triangle index exceeds Integer.MAX_VALUE.
      • addf

        default long addf​(long v0,
                          long v1,
                          long v2)
        Adds a triangle to the mesh's triangles list.

        Normal is computed with counterclockwise (i.e., right-hand) orientation.

        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        Returns:
        Index of newly added triangle.
      • addf

        default int addf​(int v0,
                         int v1,
                         int v2)
        Adds a triangle to the mesh's triangles list, using ints.

        Normal is computed with counterclockwise (i.e., right-hand) orientation.

        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        Returns:
        Index of newly added triangle.
        Throws:
        RuntimeException - if the return triangle index exceeds Integer.MAX_VALUE.
      • addf

        default long addf​(float v0x,
                          float v0y,
                          float v0z,
                          float v1x,
                          float v1y,
                          float v1z,
                          float v2x,
                          float v2y,
                          float v2z,
                          float nx,
                          float ny,
                          float nz)
        Adds a triangle to the mesh's triangles list.

        This is a convenience method that first creates the vertices using Vertices.addf(float, float, float), then calls addf(long, long, long, float, float, float).

        Parameters:
        v0x - X coordinate of triangle's first vertex.
        v0y - Y coordinate of triangle's first vertex.
        v0z - Z coordinate of triangle's first vertex.
        v1x - X coordinate of triangle's second vertex.
        v1y - Y coordinate of triangle's second vertex.
        v1z - Z coordinate of triangle's second vertex.
        v2x - X coordinate of triangle's third vertex.
        v2y - Y coordinate of triangle's third vertex.
        v2z - Z coordinate of triangle's third vertex.
        nx - X coordinate of triangle's normal.
        ny - Y coordinate of triangle's normal.
        nz - Z coordinate of triangle's normal.
        Returns:
        Index of newly added triangle.
      • addf

        default long addf​(float v0x,
                          float v0y,
                          float v0z,
                          float v1x,
                          float v1y,
                          float v1z,
                          float v2x,
                          float v2y,
                          float v2z)
        Adds a triangle to the mesh's triangles list.

        This is a convenience method that first creates the vertices using Vertices.addf(float, float, float), then calls addf(long, long, long).

        Parameters:
        v0x - X coordinate of triangle's first vertex.
        v0y - Y coordinate of triangle's first vertex.
        v0z - Z coordinate of triangle's first vertex.
        v1x - X coordinate of triangle's second vertex.
        v1y - Y coordinate of triangle's second vertex.
        v1z - Z coordinate of triangle's second vertex.
        v2x - X coordinate of triangle's third vertex.
        v2y - Y coordinate of triangle's third vertex.
        v2z - Z coordinate of triangle's third vertex.
        Returns:
        Index of newly added triangle.
      • nx

        default double nx​(long tIndex)
        X coordinate of triangle's normal, as a double.
      • ny

        default double ny​(long tIndex)
        Y coordinate of triangle's normal, as a double.
      • nz

        default double nz​(long tIndex)
        Z coordinate of triangle's normal, as a double.
      • add

        default long add​(long v0,
                         long v1,
                         long v2,
                         double nx,
                         double ny,
                         double nz)
        Adds a triangle to the mesh's triangles list.
        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        nx - X coordinate of triangle's normal.
        ny - Y coordinate of triangle's normal.
        nz - Z coordinate of triangle's normal.
        Returns:
        Index of newly added triangle.
      • add

        default int add​(int v0,
                        int v1,
                        int v2,
                        double nx,
                        double ny,
                        double nz)
        Adds a triangle to the mesh's triangles list, using int indices.
        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        nx - X coordinate of triangle's normal.
        ny - Y coordinate of triangle's normal.
        nz - Z coordinate of triangle's normal.
        Returns:
        Index of newly added triangle.
        Throws:
        RuntimeException - if the return triangle index exceeds Integer.MAX_VALUE.
      • add

        default long add​(long v0,
                         long v1,
                         long v2)
        Adds a triangle to the mesh's triangles list.

        Normal is computed with counterclockwise (i.e., right-hand) orientation.

        Parameters:
        v0 - Index of triangle's first vertex.
        v1 - Index of triangle's second vertex.
        v2 - Index of triangle's third vertex.
        Returns:
        Index of newly added triangle.
      • add

        default long add​(double v0x,
                         double v0y,
                         double v0z,
                         double v1x,
                         double v1y,
                         double v1z,
                         double v2x,
                         double v2y,
                         double v2z,
                         double nx,
                         double ny,
                         double nz)
        Adds a triangle to the mesh's triangles list.

        This is a convenience method that first creates the vertices using Vertices.add(double, double, double), then calls add(long, long, long, double, double, double).

        Parameters:
        v0x - X coordinate of triangle's first vertex.
        v0y - Y coordinate of triangle's first vertex.
        v0z - Z coordinate of triangle's first vertex.
        v1x - X coordinate of triangle's second vertex.
        v1y - Y coordinate of triangle's second vertex.
        v1z - Z coordinate of triangle's second vertex.
        v2x - X coordinate of triangle's third vertex.
        v2y - Y coordinate of triangle's third vertex.
        v2z - Z coordinate of triangle's third vertex.
        nx - X coordinate of triangle's normal.
        ny - Y coordinate of triangle's normal.
        nz - Z coordinate of triangle's normal.
        Returns:
        Index of newly added triangle.
      • add

        default long add​(double v0x,
                         double v0y,
                         double v0z,
                         double v1x,
                         double v1y,
                         double v1z,
                         double v2x,
                         double v2y,
                         double v2z)
        Adds a triangle to the mesh's triangles list.

        This is a convenience method that first creates the vertices using Vertices.add(double, double, double), then calls add(long, long, long).

        Parameters:
        v0x - X coordinate of triangle's first vertex.
        v0y - Y coordinate of triangle's first vertex.
        v0z - Z coordinate of triangle's first vertex.
        v1x - X coordinate of triangle's second vertex.
        v1y - Y coordinate of triangle's second vertex.
        v1z - Z coordinate of triangle's second vertex.
        v2x - X coordinate of triangle's third vertex.
        v2y - Y coordinate of triangle's third vertex.
        v2z - Z coordinate of triangle's third vertex.
        Returns:
        Index of newly added triangle.