Jump to content
  • 0

Distancetozone


Afou To Patisa

Question

Hi tryskell :) i got a question specificaly for you. in aCis and in other packs getDistanceToZone basically show the distance from the points you set in Zone.

So basically if you're inside zone in the middle of town it will still write Distance: 2250 cause it's away of points. 

What if we want to do this: 

 

iWPzlEI.jpg

 

Basically if the object is inside zone distance = 0

If the object is between 2 points close to the line it will write 50 

so the distance isbeing calculated after the line 2 points create. 

 

Is possible? 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

First I'm terrible in whatever mathematics (and even worst in geometry), you're probably better than me.

 

Second if the formula doesn't appeal you, you can edit it (and well you named it, ZoneNPoly.getDistanceToZone).

 

I guess you can simply consider if you're inside the square, you return 0 directly if that's your only problem. Since isInsideZone is part of the same class, you only have to generate a x/y version of isInsideZone (which currently verify x/y/z) and check that first.

 

PS : You don't need to name me on topic, it's disturbing.

Edited by Tryskell
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...