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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..