mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 09:22:01 +01:00
vector/internal/math: Optimization
This commit is contained in:
parent
662a22461d
commit
6d51ff4a12
@ -127,11 +127,11 @@ func Triangulate(pts []Point) []uint16 {
|
||||
pt0 := pts[i0]
|
||||
pt1 := pts[i1]
|
||||
pt2 := pts[i2]
|
||||
for j := range currentIndices {
|
||||
if l := len(currentIndices); j == (i+l-1)%l || j == i || j == (i+1)%l {
|
||||
for _, j := range currentIndices {
|
||||
if j == i0 || j == i1 || j == i2 {
|
||||
continue
|
||||
}
|
||||
if InTriangle(pts[currentIndices[j]], pt0, pt1, pt2) {
|
||||
if InTriangle(pts[j], pt0, pt1, pt2) {
|
||||
// If the triangle includes another point, the triangle is not an ear.
|
||||
continue index
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user