Game1.cpp: https://gist.github.com/anonymous/b6574 ... 7b5dd63205
ConvertTo.cpp: https://gist.github.com/anonymous/39664 ... b15467964c
The three models are the default cubes from Blender with different colored materials on them.
------------------------------------------------------------------------------------
Original question:
I am new to 3D game development and stumbled upon BEPU physics engine. I am using MonoGame and installed BEPU Physics via NuGet.
I tried to follow the getting started page: http://bepuphysics.codeplex.com/wikipag ... umentation and was able to move a Box around.
However, the collision resolution is very weird. One cube is dynamic and the other is kinematic. When I move the dynamic one left and right, it doesn't slide smoothly (especially if I move to the edge of the other cube and move back). If I jump, it doesn't land perfectly either. It starts going a little crazy and becomes hard to control.
I have this to control:
Code: Select all
Space world;
Model cube;
Box cubeBox;
cube = this.Content.Load<Model>("Cube");
cubeBox = new Box(BEPUutilities.Vector3.Zero, 2f, 2f, 2f);
world.Add(cubeBox);
if(current != previous)
{
if (Keyboard.GetState().IsKeyDown(Keys.Left))
sphereBox.LinearVelocity += new BEPUutilities.Vector3(5f, 0f, 0f);
if (Keyboard.GetState().IsKeyDown(Keys.Right))
sphereBox.LinearVelocity -= new BEPUutilities.Vector3(5f, 0f, 0f);
if (Keyboard.GetState().IsKeyDown(Keys.Space))
sphereBox.LinearVelocity += new BEPUutilities.Vector3(0f, 5f, 0f);
}
Whole project (Visual Studio 2015): http://www.mediafire.com/download/i8uwf ... PUTest.zip
The cube is the default cube from Blender exported as a .dae.
Any help would be appreciated. Thank you!