Book Image

Direct3D Rendering Cookbook

Book Image

Direct3D Rendering Cookbook

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Further Reading
Index

Using a physics engine


In this recipe, we will extend our existing mesh renderer to support the simulation of physics within a scene. We will continue to use the built-in Visual Studio graphics content pipeline, and rely on a simple mesh naming convention to designate static and dynamic objects within our scene.

Getting ready

For our physics engine, we will use BulletSharp, a .NET wrapper of the popular Bullet Physics library used in many AAA game and movie titles. Consider the following steps:

  1. Download the BulletSharp library from https://code.google.com/p/bulletsharp/. It is also included in the \External folder within the downloadable content for this book.

  2. Add a reference to the \External\bulletsharp-2.82\Release SharpDX\BulletSharp.dll assembly.

    Note

    Referencing the SharpDX version of the BulletSharp assembly uses the existing SharpDX vector and matrix structures.

  3. We use an example scene to demonstrate the physics engine. This is available within the downloadable content.

  4. A debug renderer...