Skip to content

Commit

Permalink
docs: document what's going on with convex hull points
Browse files Browse the repository at this point in the history
  • Loading branch information
adroitwhiz committed Mar 3, 2024
1 parent 0554ed7 commit 37a0fa0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/RenderWebGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,10 @@ class RenderWebGL extends EventEmitter {
// *Not* Scratch Space-- +y is bottom
// Loop over all rows of pixels, starting at the top
for (let y = 0; y < height; y++) {
// See comment in Drawable.getLocalPosition for why we're adding 0.5 here.
// Essentially, _pixelPos is supposed to be in "texture space", and "texture space" positions are offset
// by 0.5. Notice that we're calling drawable.skin.isTouchingLinear (operates in texture space)
// and not drawable.isTouching (operates in Scratch space).
_pixelPos[1] = (y + 0.5) / height;

// We start at the leftmost point, then go rightwards until we hit an opaque pixel
Expand Down

0 comments on commit 37a0fa0

Please sign in to comment.