Package org.robwork.sdurw_geometry
Class Triangle_f
- java.lang.Object
-
- org.robwork.sdurw_geometry.Triangle_f
-
public class Triangle_f 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 Summary
Constructors Constructor Description Triangle_f()
default constructorTriangle_f(long cPtr, boolean cMemoryOwn)
Triangle_f(Vector3Df p1, Vector3Df p2, Vector3Df p3)
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyTransform(Transform3Df t3d)
apply a transformation to this triangledouble
calcArea()
calculate the area of the triangleVector3Df
calcFaceNormal()
calculates the face normal of this triangle.void
delete()
Vector3Df
get(long i)
static long
getCPtr(Triangle_f obj)
Triangle_f
getTriangle()
Vector3Df
getVertex(long i)
get vertex at index iboolean
isInside(Vector3Df x)
tests wheather the point x is inside the trianglevoid
set(long i, Vector3Df d)
java.lang.String
toString()
Triangle_f
transform(Transform3Df t3d)
Returns Triangle transformed by t3d.
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Triangle_f obj)
-
delete
public void delete()
-
getVertex
public Vector3Df getVertex(long i)
get vertex at index i
-
get
public Vector3Df get(long i)
-
set
public void set(long i, Vector3Df d)
-
calcFaceNormal
public Vector3Df calcFaceNormal()
calculates the face normal of this triangle. It is assumed
that the triangle vertices are arranged counter clock wise.
-
isInside
public boolean isInside(Vector3Df 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(Transform3Df t3d)
apply a transformation to this triangle- Parameters:
t3d
- [in] transform that is to be applied
-
transform
public Triangle_f transform(Transform3Df t3d)
Returns Triangle transformed by t3d.
-
getTriangle
public Triangle_f getTriangle()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-