Collision detection update

Planning and Development

Well, the short version is that I have a very basic collision detection and response system working.  My test scene has a sphere that I can move left or right.  If the sphere hits a triangle it slides along the surface of the triangle.  I even put two triangles with different slopes next to one another and the sphere slides along one then changes pace slightly as it slides along the other.  I simplified the code from the Faurby paper I was using and there’s probably some stuff I’ll find out later I’m missing, but the basic concept is working.

My next step is to generalize to code to handle meshes instead of individually defined triangles.  This is “narrow phase” collision detection and is relatively expensive to calculate, so I’ll need a broad phase scheme as well.  Fortunately, THREE.js includes a utility to generate an axis aligned bounding box around a mesh and these are pretty easy to use to eliminate most geometry from consideration during the broad phase.

Leave a Reply

Your email address will not be published. Required fields are marked *