XNA Creators Club Online
Page 1 of 1 (1 items)
Sort Posts: Previous Next

BoxCollider and back face culling

Last post 10-05-2008 5:57 PM by flend. 0 replies.
  • 10-05-2008 5:57 PM

    BoxCollider and back face culling

    I was playing around with BoxCollider today, trying to collide some rays with arbitrary meshes. I noticed that BoxCollider implements a back-face-culling version of ray/triangle intersection (see http://www.graphics.cornell.edu/pubs/1997/MT97.pdf).

    I was attempting to cast a ray from the camera to the lookAt-ed object and see if I intersected any walls (my collision mesh). If I did, I'd need to move the camera in front of the last wall. If the last wall is facing away from the camera, then it doesn't appear as a collision in BoxCollider, so this didn't work.

     I fixed the problem by implementing the non-back-face-culled version in CollisionFace.RayTriangleIntersect.

    Dunno if anyone has any comments (maybe there's a better way) but I thought I'd post so that the next person maybe wouldn't haven't to spend half a Sunday afternoon on this!

    -flend

Page 1 of 1 (1 items) Previous Next