I'm currently trying to create a racing game and decided for JigLibX as the Physics engine of the game. I created a very simple track Model in milkshape 3D. No I was wondering, how I make the meshes of my track to fit primitive objects in JigLib? Can I handle my track like a terrain? Is there a regular way to do this? Sorry for the (maybe) stupid questions - but I have no idea how to make my track physicable. (The track shall be immovable, just containts of a plane and a street). Thank you in advance!
Date: 03 Dec 2009 20:23
Number of posts: 3
RSS: New posts
This is simple. You can create a static mesh (TriangleMeshObject/TriangleMesh).
IGameComponent world = new TriangleMeshObject(game, game.Content.Load<Model>("worldmodel"), Matrix.Identity, Vector3.Zero);
TriangleMeshObject can be found in the example. Please note, it is static and generating the collision map for large models can sometimes be daunting and take time. But it's great for static models like maps.
I'm also trying to load a mesh as a map, using TriangleMeshObject. However, I find that any model loaded with TriangleMeshObject will just hang in the air and is not affected by other objects. To clarify, cubes and such will work well and is affected by physics, but when the same cube is loaded as a TriangleMeshObject it will not work.
This is causing me much distress.