Beginning Android C++ Game Development by Bruce Sutherland

Beginning Android C++ Game Development by Bruce Sutherland

Author:Bruce Sutherland [Sutherland, Bruce]
Language: eng
Format: epub, pdf
Tags: Programming, C, Computers, Games, Programming Languages
ISBN: 9781430258308
Publisher: Apress
Published: 2013-08-21T04:00:00+00:00


Broad-Phase Filtering in Droid Runner

Our needs for broad-phase filtering are much more modest. Our level is of a fixed height, and all objects exist on a 2D plane, so we can get away with splitting our level into equally sized bins. We've already seen that our level is defined with an array split into rows and columns, so we will use a bin for every eight columns.

Collision Bins

We take a look at the code for a collision bin in Listing 7-11.

Listing 7-11. The CollisionBin Class Declaration

class CollisionBin

{

private:

typedef std::vector<CollisionComponent*> CollisionComponentVector;

typedef CollisionComponentVector::iterator CollisionComponentVectorIterator;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.