Welp... you're right, that didn't fix it. It just made it less common if anything at all.
The box is a box prefab. Gravity is 0,0,-9.8
Trying to replicate on the demos now...
Actually, the physics going on in the demo just looks straight... different from what I see in my creation.
Am I perhaps rendering something wrong?
I'm using OpenTK.
Code: Select all
public OpenTK.Matrix4 GetTransformationMatrix()
{
Matrix mat = Body.WorldTransform;
return new OpenTK.Matrix4(mat.M11, mat.M12, mat.M13, mat.M14, mat.M21, mat.M22, mat.M23,
mat.M24, mat.M31, mat.M32, mat.M33, mat.M34, mat.M41, mat.M42, mat.M43, mat.M44);
}
"Body" is the BEPU entity. Named Body because it was originally a Bullet RigidBody.
Code: Select all
public override void Render()
{
Matrix4 mat = Matrix4.CreateScale((float)HalfSize.X, (float)HalfSize.Y, (float)HalfSize.Z) * GetTransformationMatrix();
GL.UniformMatrix4(2, false, ref mat);
TheClient.Rendering.SetMinimumLight(0.0f);
for (int i = 0; i < VBOs.Count; i++)
{
VBOs[i].Render(true); // TODO: TheClient.RenderTextures
}
}
The VBOs definitely render a cube from (-1,-1,-1) to (1,1,1)
The GL.UniformMatrix4 call sends the matrix as the Model matrix in the shader I use for rendering.
In the shader it's used like so:
Code: Select all
gl_Position = proj_matrix * mv_matrix * position;
Where proj_matrix is a known-to-be-accurate left-hand (EDIT: actually, is it left handed? I'm not sure) projection/view matrix, and mv_matrix is the uploaded above.
This seems solid to me, but I get all sorts of weird bits of physics - the opening post lists ones, I've seen entities rotating backwards, ... I ... I don't know what I could be doing wrong D:
It's something somewhere on my end, otherwise the demos would have the same problem... but I don't have any idea where to start looking.
Perhaps a BEPUutilities matrix doesn't perfectly correspond to an OpenTK matrix? (EG Left-Hand vs. Right-Hand)? (I don't know too much about matrices, I just know how to use them for rendering tricks, and how to extract basic information from them)
EDIT: Tried to open the demo source code in Visual Studio 2013 Community, got an error:
https://i.imgur.com/VlySMjE.png
EDIT2: Helps if I download XNA, doesn't it?
EDIT3: Nope, have XNA, still the same error
EDIT4: Ooh, C# 2010 can open it though