Constructor
new Triangle(aopt, bopt, copt)
Methods
set(a, b, c) → {Triangle}
Sets the triangle's a, b and c properties to the passed vector3s.
Returns:
- Type:
- Triangle
(static) barycoordFromPoint(point, a, b, c, targetopt) → {Vector3}
static/instance method to calculate barycentric coordinates. based on: http://www.blackpawn.com/texts/pointinpoly/default.html
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
point | Vector3 | Vector3 | |
a | Vector3 | ||
b | Vector3 | ||
c | Vector3 | ||
target | Vector3 | <optional> | the result will be copied into this Vector3. |
Returns:
- Type:
- Vector3
(static) containsPoint(point, a, b, c) → {Vector3}
Returns true if the passed point, when projected onto the plane of the triangle, lies within the triangle.
Returns:
- Type:
- Vector3
(static) normal(a, b, c, optionalTargetopt) → {Vector3}
Calculate the normal vector of the triangle.
Returns:
- Type:
- Vector3