Skip to content

Commit

Permalink
feat(Polygon): add getBoundingBox
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed Jun 2, 2024
1 parent b76eb6b commit fa1faac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,14 @@ export class Polygon {
this.vertices[3].uv.y *= -1
}
}

getBoundingBox() {
const box = new Box3()

for (let i = 0; i < (this.isQuad() ? 4 : 3); i++) {
box.expandByPoint(this.vertices[i])
}

return box
}
}

0 comments on commit fa1faac

Please sign in to comment.