BToney005 / emo-framework

Automatically exported from code.google.com/p/emo-framework
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Sprite:collidesWith and Sprite:contains should be better than AABB #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/emo-framework/source/browse/trunk/Emo-Android/assets/ru
ntime.nut#1208

http://code.google.com/p/emo-framework/source/browse/trunk/Emo-Android/assets/ru
ntime.nut#1203

Right now, emo only does non-rotated and non-scaled rectangles.
Extend it to allow for rotation and scale of rectangles.

The workaround currently is to use box2d or supply our own implementation of 
polygon collision detection. But box2d comes with a lot of extra baggage and 
the polygon collision will be relatively the same for everyone.

Original issue reported on code.google.com by DannyFritz on 9 Oct 2011 at 6:59

GoogleCodeExporter commented 8 years ago
Yes, emo's rectangle doesn't take into account the rotation and scaling. It is 
because that I believe most of all sprites in games have different 
characteristics about collision areas and in most cases developers should 
override them to fit their individual needs. The collision detection 
(collidesWith and contains) can be extended when you create new class that 
extends the Sprite and override their function. Or, you can simply create new 
function that detect complex collisions. I think this would be enough:)

Original comment by infosia...@gmail.com on 10 Oct 2011 at 5:12