Jump to content

Question

Posted

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? 

 

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...