

I cannot say for certain that it will help you, but it may be useful for collisions with a terrain mesh and gravity. Here is a detailed description of a sphere/triangle technique I once adapted for 2D collision detection:

I would ideally like to load my single mesh from the database and be able to detect collisions with it as is, or alternatively automatically work out the constraints/bounding areas from the mesh data. For this reason, I don't want to have to separately/manually define the constraints of the level.

I should also mention that I am not creating a single level, but a game engine which will work with various levels loaded from a Database. The models that I want to check for collisions are: .Model Secondly, Is there a relatively simple way to check for the type of collision I need, using the XNA library itself, or some other library that doesn't require me to introduce an entirely new layer of physics.Firstly, Am I approaching this in the best way? With a single large-ish model for my world?.
#GIDEROS COMPLEX COLLISION DETECTION HOW TO#
The articles I have found all seem to explain how to use the sphere and box methods, or to implement some external physics engine (all of which seem really quite elaborate for what I want to achieve). I've spent a couple of hours on google searching (in vain) for some way of checking for a detailed collision between the bounding sphere of my character and the actual mesh of the world. What I want to do now is implement a gravity like force, which will allow characters to rise and fall with the flow of the terrain. However, the character models (at the moment) are stuck in a fixed place on the Y-axis, and so my world is really just a flat plane for them to glide across. I've put in some basic controls which allows the user/player to move one of the characters around the world - and even implemented some collision detection using BoundingSphere/BoundingBox with other character models. So far I've managed to load various character models onto a larger level/world model. I've been working on a basic 3D XNA game.
