Changes

Jump to: navigation, search

Team Guardian Physics

1,603 bytes added, 23:27, 6 April 2011
Collision Detector Only
=== Collision Detector Only ===
 
After copying/merging in the requisite files from the collision detection package and adding all new files to your solution, the project should now be compiling cleanly. To get any use out of the collision detection, you will want to create a collision space, assign it to be the global collision space and implement the iRigidBody interface for your custom object classes. Let's take a look at this one step at a time:
<ol>
<li>Create a global collision space for all of your collision geometry. For the time being, the only collision space available is the simple one so let's do that:
<pre>
#include "iCollisionSpace.h"
#include "iSimpleCollisionSpace.h"
 
iCollisionSpace* collisionSpace = CreateSimpleCollisionSpace();
</pre>
</li>
<li>
Assign this collision space to be the global collision space for all collision geometries that will be created from this point on. This should be done during initialization and prior to collision geometry creation.<br/><br/>
 
From a design perspective, it should be possible for multiple collision spaces to coexist in the world but at the moment this is not implemented correctly so you will have to live with a single global collision space, unfortunately.
</li>
<li>
Implement the <code>iRigidBody</code> interface in some of your custom classes. A collision geometry requires a RigidBody instance to be passed in on creation (it can also be attached to a RigidBody at a later time) for it to use to get its . Let's look at Please see the [[Team_Guardian_Physics#RigidBody |RigidBody reference]] for behaviour that is expected from a RigidBody.
</li>
</ol>
== Framework Reference ==

Navigation menu