Noel Llopis
  • Member for 11 years, 6 months
  • Last seen more than 11 years ago
Box2D Get Bounding Box of a Body
11 votes

In Box2D, bodies don't have bounding boxes associated with them, fixture do. So you need to iterate over all the fixtures and generate a new AABB. Something like this: b2AABB aabb; aabb.lowerBound = ...

View answer
Using The Box2D Polygon "Set()" function?
Accepted answer
10 votes

That's because the four vertices you provided are in clockwise order and Box2D assumes they're in counter-clockwise, like in your first example. So it should work fine if you change it to: b2Vec2 ...

View answer
API agnostic bridges (ie. OpenGL/D3D/Whatever). Do you use them, how you make them. Pro's and Con's
Accepted answer
10 votes

I'm not a fan of the least-common denominator approach. If you do that, you may end up with crippled features and poor performance. Instead, what I've done in the past, is to provide slightly higher ...

View answer
Updating OpenGL ES 1.1 based iPhone game to use Open GL ES 2.0
Accepted answer
9 votes

OpenGL ES 2.0 is very different from ES 1.1. You don't have a fixed-function pipeline anymore, so your familiar "push matrix, translate, rotate", etc are all gone. Instead, you have the concept of ...

View answer
Mixing 3D and 2D content on the iPhone?
Accepted answer
5 votes

You can render OpenGL views on top anything on the iPhone with no performance loss. However, if you're thinking of just doing the dice on top of other 2D graphics, that will be more costly (you'll ...

View answer
What are some low-level performance tweaks for iPhone games written in c?
Accepted answer
4 votes

Some low-level things that might help: Turn "thumb mode" off. This is especially important if you have lots of floating-point operations, like most games do. Use CADisplayLink to drive your loop If ...

View answer
Finding unoccluded tiles in tile-based game
2 votes

This is not a complete answer, but hopefully it will help. Is your map/tile set static or dynamic? If it's static, I would strongly encourage you to do offline processing and precompute as much as ...

View answer