Skip to content

intersect should only be a wrapper #3

@tmpvar

Description

@tmpvar

Do argument surgery for times when you don't really know what you are intersecting

circle

  • Vec2-like and a scalar
  • Circle2 - obj.position and obj.radius (which may be a function)

segment

  • 2 Vec2 like objects
  • 2 arrays
  • x1, y1, x2, y2

line

  • 2 scalars (slope + yintercept)
  • Line2 signature

polygon

  • obj.points
  • array of
    • Vec2-like objects
    • [x,y]

It would be really cool if there was a parameterized function exposed by each of these primitives that didn't care what they were. Then intersections and potentially other things become circle.solve(line.equation.bind(line)) where .equation is a function to be called by the circle "solver".

Sounds complicated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions