@property
def aabb(self):
return (self._x, self._y,
self._x + (self._texture.width * self._scale),
self._y + (self._texture.height * self._scale))def is_overlapping(first_aabb, second_aabb):
aleft, atop, aright, abottom = first_aabb
bleft, btop, bright, bbottom = second_aabb
# An overlap has occured if ALL of these are True, otherwise return False:
return bleft < aright and bright > aleft and btop < abottom and bbottom > atopMy suggestion would be to integrate pymunk support, or to develop a guide to using it. It's quite nice and works with pyglet just fine. Just my opinion.
I understand why some people would like this, but pyglet supports rotated sprites and I feel like AABB would be too limited. It would also open endless requests for collisions with rotated sprites, fast detection, etc. If pyglet were to include a collision detection system for sprites, it should be full featured and probably written as a compiled extension module, since the pure Python nature of pyglet would be super slow.My suggestion would be to integrate pymunk support, or to develop a guide to using it. It's quite nice and works with pyglet just fine. Just my opinion.
--
You received this message because you are subscribed to a topic in the Google Groups "pyglet-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyglet-users/Ybr1zk6j358/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyglet-users...@googlegroups.com.
To post to this group, send email to pyglet...@googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.