Constructor
new Triangle(a, b, c)
Create a new triangle.
- Source
Methods
check(other) → {Object}
Check if this triangle is overlapping with another.
Parameters:
Name | Type | Description |
---|---|---|
other | Triangle | Triangle to check overlap with |
- Source
Returns:
Data containing result
- Type:
- Object
drawDebug(ctx)
Draw the triangles for debugging.
Parameters:
Name | Type | Description |
---|---|---|
ctx | CanvasRenderingContext2D | The canvas context to draw on |
- Source
project(axis, a, b, c) → {Object}
Projects points onto a specified axis and finds the minimum and maximum projection values.
Parameters:
Name | Type | Description |
---|---|---|
axis | Vec2 | Axis to project onto |
a | Vec2 | First point |
b | Vec2 | Second point |
c | Vec2 | Third point |
- Source
Returns:
Object containing minimum and maximum values.
- Type:
- Object
transform(matrix) → {Triangle}
Transform a triangle with a transformation matrix.
Parameters:
Name | Type | Description |
---|---|---|
matrix | Transformation matrix |
- Source
Returns:
Transformed version of triangle
- Type:
- Triangle