java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.tessellation.TessellationEdge

public class TessellationEdge extends Object
Represents an edge of a triangle in the tessellation pipeline.

A TessellationEdge connects two Vertex endpoints and carries an identification count used by the TexturedPolygonTessellator to determine which edge of the original triangle this edge corresponds to (1, 2, or 3). This identification is essential for correct recursive tessellation -- when the longest edge is split, the tessellator uses the count to decide how to partition the triangle into two smaller triangles.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The edge identifier (1, 2, or 3) indicating which edge of the original triangle this tessellation edge represents.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an uninitialized tessellation edge for reuse.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Computes the 3D Euclidean distance between the two endpoint vertices.
    Computes the midpoint vertex of this edge by averaging both the 3D coordinates and the 2D texture coordinates of the two endpoints.
    void
    set(Vertex c1, Vertex c2, int count)
    Sets the endpoints and edge identifier for this tessellation edge.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • count

      public int count
      The edge identifier (1, 2, or 3) indicating which edge of the original triangle this tessellation edge represents. Used by TexturedPolygonTessellator during recursive tessellation.
  • Constructor Details

    • TessellationEdge

      public TessellationEdge()
      Creates an uninitialized tessellation edge for reuse.
  • Method Details

    • set

      public void set(Vertex c1, Vertex c2, int count)
      Sets the endpoints and edge identifier for this tessellation edge.
      Parameters:
      c1 - the first vertex endpoint
      c2 - the second vertex endpoint
      count - the edge identifier (1, 2, or 3)
    • getLength

      public double getLength()
      Computes the 3D Euclidean distance between the two endpoint vertices.
      Returns:
      the length of this edge in world-space units
    • getMiddlePoint

      public Vertex getMiddlePoint()
      Computes the midpoint vertex of this edge by averaging both the 3D coordinates and the 2D texture coordinates of the two endpoints.
      Returns:
      a new Vertex at the midpoint, with interpolated texture coordinates