Page 2 of 3

Re: ISO

Posted: Sat Feb 18, 2012 2:59 pm
by MarekkPie
I could be completely wrong. I have a tendency to give something about 10 seconds of thought before I express an opinion.

Re: ISO

Posted: Sat Feb 18, 2012 3:08 pm
by Camoy
I'll likely end up using HardonCollider and represent each Sprite with a rectangle of its dimensions. Sounds simple enough ;)

Re: ISO

Posted: Sat Feb 18, 2012 3:18 pm
by MarekkPie
I don't know if you want to to the full size on the sprite. The "grounding" part was to try and coincide with the z-indexing of an isometric map, since it's more representative of their place on it.

Re: ISO

Posted: Sat Feb 18, 2012 3:47 pm
by Camoy
MarekkPie wrote:I don't know if you want to to the full size on the sprite. The "grounding" part was to try and coincide with the z-indexing of an isometric map, since it's more representative of their place on it.
Then how much of the sprite should detect against collision?

Re: ISO

Posted: Sat Feb 18, 2012 5:16 pm
by MarekkPie
The black circle is kinda what I meant. You use the fact that its small enough to hide the fact that you are not colliding on the isometric plane.

Re: ISO

Posted: Sat Feb 18, 2012 5:29 pm
by tentus
I would, in this case, encourage a separation of collision and rendering. Doing the math on squares and circles colliding is easy. The math for parallelograms and ellipses is significantly more complex.

Re: ISO

Posted: Sat Feb 18, 2012 5:34 pm
by MarekkPie
Right. It may not be evident from the little image but the black circle is in fact a circle, not an ellipse.

Re: ISO

Posted: Sat Feb 18, 2012 6:01 pm
by Camoy
Collision detection is in ISO (complements to HardonCollider). Line 81 and 120 in this file decides what portion of the sprite is checked for collision. Right now it is using the entire sprite, but I'm interested MarekkPie's solution if you'd like to implement it.

Re: ISO

Posted: Sat Feb 18, 2012 7:18 pm
by MarekkPie
Was having trouble navigating through your source code, so I made a little mockup. It's not using ISO, but it shows my idea. Use the arrow keys to move and ESC to quit.

Re: ISO

Posted: Sat Feb 18, 2012 8:22 pm
by Camoy
MarekkPie wrote:Was having trouble navigating through your source code, so I made a little mockup. It's not using ISO, but it shows my idea. Use the arrow keys to move and ESC to quit.
I put it in, however in sprites whose width is greater than their height, the collision area is way too large. Here is the commit.