Class Triangle


  • public class Triangle
    extends java.lang.Object
    plain triangle class. The second template argument specify
    the number of normals associated with the triangle.
    The triangle vertices should be arranged counter clock wise.
    • Constructor Detail

      • Triangle

        public Triangle​(long cPtr,
                        boolean cMemoryOwn)
      • Triangle

        public Triangle()
        default constructor
      • Triangle

        public Triangle​(Vector3D p1,
                        Vector3D p2,
                        Vector3D p3)
        constructor
        Parameters:
        p1 - [in] vertice 1
        p2 - [in] vertice 2
        p3 - [in] vertice 3
    • Method Detail

      • getCPtr

        public static long getCPtr​(Triangle obj)
      • delete

        public void delete()
      • getVertex

        public Vector3D getVertex​(long i)
        get vertex at index i
      • set

        public void set​(long i,
                        Vector3D d)
      • calcFaceNormal

        public Vector3D calcFaceNormal()
        calculates the face normal of this triangle. It is assumed
        that the triangle vertices are arranged counter clock wise.
      • isInside

        public boolean isInside​(Vector3D x)
        tests wheather the point x is inside the triangle
      • calcArea

        public double calcArea()
        calculate the area of the triangle
        Returns:
        area in m^2
      • applyTransform

        public void applyTransform​(Transform3D t3d)
        apply a transformation to this triangle
        Parameters:
        t3d - [in] transform that is to be applied
      • transform

        public Triangle transform​(Transform3D t3d)
        Returns Triangle transformed by t3d.
      • getTriangle

        public Triangle getTriangle()
      • toString

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