iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Possible linking area #771

Open MonoTovarisj opened 10 years ago

MonoTovarisj commented 10 years ago

Would love to see a highlight plugin that could show the area from a portal that is linkable, within the range of the specific portal chosen.

It would be nice to have a quick way of seeing how a specific portal is linkable.

I've made a graphical mockup of how I imagine it would look like for a random portal.

green link region

Fragger commented 10 years ago

This is going to require some kind of inverse shadow calculation with the selected portal being the "light source".

jonatkins commented 10 years ago

I've thought that such a feature could have it's uses, If anyone fancies having a go at this as a plugin I'd be happy to accept it.

There would be limitations - when zoomed out, smaller links aren't returned by the backend, so IITC wouldn't know they exist.

Note that to do it right, the calculations should be performed geodesically - not assuming a 2d surface.

The calculations shouldn't be too bad. I think a starting point would be to take the start/end vertex of every link, sort by angle from the selected portal, and calculate the distances of all links crossing that angle from the portal.

reckter commented 9 years ago

I've started to hack at this plugin and am now at the point, where I search for the right way to detect when to lines on the earth are crossing. I was hopping for a util function in IITC that does this already, but I could only find the one used in the cross_link plugin. I could of course copy the function, but this would decrease the maintainability of the function. I don't see a point to be dependent on that plugin though, especially because it depends on the draw plugin. Should I move the function into a util class of some sort in iitc itself? For now I will copy the function, so I can continue to code :)

MonoTovarisj commented 9 years ago

Cool that this plugin is seeing the light of day, I would love to beta test, if you have a test url?

reckter commented 9 years ago

I don't even have a working version yet. I will try to get it working, but I can not make any promise at this point. I will make a mergr request if I got it working to my pleasing.