Page 1 of 1

Constrains to poligon?

Posted: Mon Dec 20, 2010 1:01 am
by JosepM
Hi,

It's posible to set the constrain to a poligon area? I've been reading the aengine docs but I don't found any. It's posible in some way?

Salut,
Josep

Re: Constrains to poligon?

Posted: Mon Dec 20, 2010 7:34 pm
by malte
Not yet, but I Want that too. However this is a tad bit complicated...

I would need to know how this should behave. It should be fairly simple to constrain the location of the dragged object, checking for the boundaries of any given dragged object in an n-sided polygon is not a trivial matter though.

Cheers,

Malte

Re: Constrains to poligon?

Posted: Mon Dec 20, 2010 9:33 pm
by JosepM
Hi Malte,

Maybe pointInPoly(x,y,pointlist) will be my friend, so I need to check if the tokens are inside of x zones, and these zones all are polygons.
Better check with pointInPoly or with the intersect?

Salut,
Josep

Re: Constrains to poligon?

Posted: Wed Dec 22, 2010 10:09 am
by malte
If you want to constrain an object pointInPoly indeed is your friend. If you only want the location costrained this should be pretty straightforward.


All the best,

Malte

Re: Constrains to poligon?

Posted: Wed Dec 22, 2010 2:05 pm
by JosepM
But how I can check all at the same time? I mean, the user move tokens over the board and I need to check where the tokens are,.. what is the technique to control all at same time?

Any tip?

Salut,
Josep