mattrdowney / planetaria

A Unity framework for Euclidean 2-sphere games (e.g. 2D virtual reality games) [quasi-MIT license]
Other
10 stars 2 forks source link

PlanetariaPhysics.OverlapCircle() #124

Open mattrdowney opened 5 years ago

mattrdowney commented 5 years ago

The implementation is relatively straightforward (for convex hulls). The algorithm's documentation should have a disclaimer that it tests against the convex hull of objects (similar to other UnityEngine.Physics methods).

Internally, you 1) find the tangent sphere representing the circle, 2) Physics.OverlapSphere(), 3) determine intersecting points using PlanetariaShape.field_list data of type PlanetariaSphereCollider.

mattrdowney commented 5 years ago

Use cases: OnMouseOver-esque behavior. (I still need to figure out if I can/should/need to override cursor-canvas selection algorithms for user interfaces.)