Bounce is an XNA demo application, written to demonstrate collision detection based on Binary Space Partitioning (BSP) trees. It consists of a small tool that can parse a given Wavefront .obj file, and compute a BSP tree from the geometry in the file. The tool writes the generated BSP tree to a file, which in turn can be read by a C# class of the Bounce XNA project.
The Bounce demo application puts the player in an arena in space. Using the keyboard and mouse, the player can navigate freely and a left mouse button press releases a small sphere. The released spheres are simulated by a rigid body physics engine, which lets them bounce off walls and floors of the arena in a physically correct way.
For the collision detection the BSP tree is used, allowing direct sphere-mesh collisions. On my test system (Pentium IV 2.8 Ghz, GeForce 7200LE), approximately 100 spheres can be simulated at 60 FPS, testing more than 7.000.000 triangles in approximately 10 ms for collision. On the graphics side, the demo implements hardware instancing to enable fast drawing of large numbers of spheres. Tangent space normal mapping improves the visual quality.
- Generation of BSP trees from Wavefront .obj files
- Direct sphere-mesh collision detection using BSP tree
- Rigid body physics engine
- Hardware instancing
- Normal mapping
- Microsoft XNA Framework Redistributables 2.0
- DirectX 9.0c*
- .Net 2.0 plus (C++ 2005 SP1 Redist – OR – .Net 2.0 SP1)
- Windows XP (Vista should also work)
- Graphics Card with support for shader model 3
Iâ€™ve ported the demo to XNA 4.0 and updated the code to use the CollidableModel content pipeline plugin. The updated XNA framework simplifies deployment of the built game by allowing creation of an installer package. So in order to run the demo you can simply download the package and run the installer. All dependencies should be installed automatically.
The project sources and binaries are now hosted on google code. For the sake of redundancy you can also download the files directly via the links below.