Hey all,
Just started my game engine and need to make collisions with some terrain/level stuff, I can draw it just fine, but I can't figure out how I should do my collisions. I thought I would make collision models for my objects(in maya) and then export them out to my game, and before I wasted to much time I thought I'd ask: Would making the collision models out of several meshes, and then giving each of the meshes bounding boxes/spheres/frustums and colliding with those work? I know the unreal engine has a DOP collision bound type collision system, but for my system, that's a bit extensive.
So essentially here's my idea:
| foreach (ModelMesh mesh in model.meshes) |
| { |
| foreach (ModelMesh Pmesh in Player.model.meshes) |
| { |
| if (mesh.boundingsphere.Intersects(Pmesh.boundingsphere)) |
| //Tell the Engine |
| } |
| } |
Do you think it would work?
-Chris