uhhh not sure what am doing
uhhh not sure what am doing
i am currently creating a games (for the first time) and have recently downloaded the bepu physics engine into the included it, but i dont have a clue as to how to implement the bepu into the engine. any kind point in the right direction would be greatly appreciated
Re: uhhh not sure what am doing
If you're not yet familiar with C#, XNA, or programming in general, I'd recommend taking a look at the FAQ put up on the xna forums: http://forums.xna.com/forums/t/9181.aspx
Otherwise, to use the engine, all you need to do is add the .dll to your project's references. Then you can create a new Space in your initialization (Space mySpace = new Space() or supply the constructor with a BroadPhase type such as PersistentUniformGrid) and add entities, constraints, updateables and such to the space. Put a call to space.update in your game's update method. Whatever you added will now be bouncing and bumping around (though you'll need a way to render the objects or they'll all be invisible).
The BEPUphysicsDemos source on the downloads page provides many different simulations. You can look at these to see how to initialize your own simulations. If you have any other specific questions, let me know.
Otherwise, to use the engine, all you need to do is add the .dll to your project's references. Then you can create a new Space in your initialization (Space mySpace = new Space() or supply the constructor with a BroadPhase type such as PersistentUniformGrid) and add entities, constraints, updateables and such to the space. Put a call to space.update in your game's update method. Whatever you added will now be bouncing and bumping around (though you'll need a way to render the objects or they'll all be invisible).
The BEPUphysicsDemos source on the downloads page provides many different simulations. You can look at these to see how to initialize your own simulations. If you have any other specific questions, let me know.
Re: uhhh not sure what am doing
thank you sooo much man the help is much appreciated
Re: uhhh not sure what am doing
uh yeah i have set up the enviroment for the physics for my game, but i want to use my own models for within the space not exactly sure how to use the Static Triangle Groups for use lol, not to brilliant with reading the demo code any help would be appreciated
Re: uhhh not sure what am doing
There's a few convenience methods available for making a StaticTriangleGroup. They're the various .initializeData methods, and one of them takes a model. Passing that function a model you've loaded in through the content pipeline will usually get you set up. You can also make a custom content processor to extract index/vertex buffers to pass to another initializeData method. Adding the StaticTriangleGroup to the space with Space.add will then start its updates.
The above works primarily for level geometry. If you just want to render models for boxes and such, you can take a look at the DisplayModel class in the demos. Basically, the model is loaded in and then it is rendered at different locations and orientations (defined by the world matrix) as needed.
The above works primarily for level geometry. If you just want to render models for boxes and such, you can take a look at the DisplayModel class in the demos. Basically, the model is loaded in and then it is rendered at different locations and orientations (defined by the world matrix) as needed.