A Trigon is the building block of a Mesh and contains data for one-sided triangles in 3D space.
| Trigon(v0: Vector, v1: Vector, v2: Vector): Trigon | Initializes with the given values for the three points of the triangle. |
|---|
| applyTransform(transform: Urbject): Trigon | Transforms the Trigon to be in the spacial domain of the given Urbject and returns this. See also: Urbject |
|---|---|
| copy(): Trigon | Returns a copy of the Trigon. |
| getCenter(): Vector | Returns the calculated average of all points in the triangle. |
| getNormal(): Vector | Returns the calculated normal vector of the triangle's face according to the Right-hand Rule. |
| inverseNormal(): Trigon | Inverses the Trigon by swapping the first and second Vector and returns this. |
| qRotate(q: Quaternion): Trigon | Shorthand for quaternionRotate() |
| quaternionRotate(q: Quaternion): Trigon | Rotates the Trigon by the given quaternion and returns this. |
| rotateAxis(axis: number | Vector, angle: number): Trigon | Rotates the Trigon around the axis specified by the given angle in radians and returns this. One of the following number constants can also be given as the axis: (Vector.X_AXIS, Vector.Y_AXIS, Vector.Z_AXIS). |
| rotateX(angle: number): Trigon | Rotates the Trigon around the X-Axis by the given angle in radians and returns this. |
| rotateY(angle: number): Trigon | Rotates the Trigon around the Y-Axis by the given angle in radians and returns this. |
| rotateZ(angle: number): Trigon | Rotates the Trigon around the Z-Axis by the given angle in radians and returns this. |
| transform(M: Array<Array<number>>): Trigon | Transforms the Trigon by the given 3 or 4 dimensional transformation matrix and returns this. |
| translate(v: Vector): Trigon | Translates the Trigon by the given vector and returns this. |
| Trigon.applyTransform(t: Trigon, transform: Urbject): Trigon | Transforms a copy of the the given Trigon to be in the spacial domain of the given Urbject and returns the new Trigon. See also: Urbject |
|---|---|
| Trigon.copy(t: Trigon): Trigon | Returns a copy of the given Trigon or a new Trigon from an object with all public attributes from the Trigon class. |
| Trigon.getCenter(t: Trigon): Vector | Returns the calculated average of all points in the given Trigon. |
| Trigon.getNormal(t: Trigon): Vector | Returns the calculated normal vector of the triangle's face according to the Right-hand Rule. |
| Trigon.inverseNormal(t: Trigon): Trigon | Copies the Trigon and inverses the normal by swapping the first and second Vector and returns the new Trigon. |
| Trigon.qRotate(t: Trigon, q: Quaternion): Trigon | Shorthand for Trigon.quaternionRotate() |
| Trigon.quaternionRotate(t: Trigon, q: Quaternion): Trigon | Rotates a copy of the Trigon by the given quaternion and returns the new Trigon. |
| Trigon.rotateAxis(t: Trigon, axis: number | Vector, angle: number): Trigon | Rotates a copy of the given Trigon around the axis specified by the given angle in radians and returns the new Trigon. One of the following number constants can also be given as the axis: (Vector.X_AXIS, Vector.Y_AXIS, Vector.Z_AXIS). |
| Trigon.rotateX(t: Trigon, angle: number): Trigon | Rotates a copy of the Trigon around the X-Axis by the given angle in radians and returns the new Trigon. |
| Trigon.rotateY(t: Trigon, angle: number): Trigon | Rotates a copy of the Trigon around the Y-Axis by the given angle in radians and returns the new Trigon. |
| Trigon.rotateZ(t: Trigon, angle: number): Trigon | Rotates a copy of the Trigon around the Z-Axis by the given angle in radians and returns the new Trigon. |
| Trigon.transform(t: Trigon, M: Array<Array<number>>): Trigon | Transforms a copy of the Trigon by the given 3 or 4 dimensional transformation matrix and returns the new Trigon. |
| Trigon.translate(t: Trigon, v: Vector): Trigon | Translates a copy of the Trigon by the given vector and returns the new Trigon. |
Copyright © 2020 Trevor Richard