Class Triangle

java.lang.Object
com.sk89q.worldedit.regions.polyhedron.Triangle

public class Triangle extends Object
  • Constructor Details

    • Triangle

      public Triangle(Vector3 v0, Vector3 v1, Vector3 v2)
      Constructs a triangle with the given vertices (counter-clockwise).
      Parameters:
      v0 - first vertex
      v1 - second vertex
      v2 - third vertex
  • Method Details

    • getVertex

      public Vector3 getVertex(int index)
      Returns the triangle's vertex with the given index, counter-clockwise.
      Parameters:
      index - Vertex index. Valid input: 0..2
      Returns:
      a vertex
    • getEdge

      public Edge getEdge(int index)
      Returns the triangle's edge with the given index, counter-clockwise.
      Parameters:
      index - Edge index. Valid input: 0..2
      Returns:
      an edge
    • below

      public boolean below(Vector3 pt)
      Returns whether the given point is above the plane the triangle is in.
      Parameters:
      pt - the point to test
      Returns:
      true if the point is below
    • above

      public boolean above(Vector3 pt)
      Returns whether the given point is above the plane the triangle is in.
      Parameters:
      pt - the point to test
      Returns:
      true if the point is above
    • tag

      public Triangle tag(String tag)
      Set the triangle's tag.
      Parameters:
      tag - the tag
      Returns:
      this object
    • toString

      public String toString()
      Overrides:
      toString in class Object