Package toxi.geom
Class Triangle3D
java.lang.Object
toxi.geom.Triangle3D
- All Implemented Interfaces:
Shape3D
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionComputes the the point closest to the current vector on the surface of triangle abc.boolean
Checks if point vector is inside the triangle created by the points a, b and c.static Triangle3D
createEquilateralFrom
(Vec3D a, Vec3D b) Finds and returns the closest point on any of the triangle edges to the point given.Vec3D[]
Vec3D[]
getVertexArray
(Vec3D[] array, int offset) boolean
static boolean
isClockwiseInXY
(Vec3D a, Vec3D b, Vec3D c) boolean
static boolean
isClockwiseInXZ
(Vec3D a, Vec3D b, Vec3D c) boolean
static boolean
isClockwiseInYZ
(Vec3D a, Vec3D b, Vec3D c) void
toString()
-
Field Details
-
a
-
b
-
c
-
normal
-
centroid
-
-
Constructor Details
-
Triangle3D
public Triangle3D() -
Triangle3D
-
-
Method Details
-
createEquilateralFrom
-
isClockwiseInXY
-
isClockwiseInXZ
-
isClockwiseInYZ
-
closestPointOnSurface
Computes the the point closest to the current vector on the surface of triangle abc. From Real-Time Collision Detection by Christer Ericson, published by Morgan Kaufmann Publishers, Copyright 2005 Elsevier Inc- Returns:
- closest point on triangle (result may also be one of a, b or c)
-
computeCentroid
-
computeNormal
-
containsPoint
Checks if point vector is inside the triangle created by the points a, b and c. These points will create a plane and the point checked will have to be on this plane in the region between a,b,c (triangle vertices inclusive).- Specified by:
containsPoint
in interfaceShape3D
- Returns:
- true, if point is in triangle.
-
flipVertexOrder
-
fromBarycentric
-
getBoundingBox
-
getClosestPointTo
Finds and returns the closest point on any of the triangle edges to the point given.- Parameters:
p
- point to check- Returns:
- closest point
-
getVertexArray
-
getVertexArray
-
isClockwiseInXY
public boolean isClockwiseInXY() -
isClockwiseInXZ
public boolean isClockwiseInXZ() -
isClockwiseInYZ
public boolean isClockwiseInYZ() -
set
-
toBarycentric
-
toString
-