0
\$\begingroup\$

I am trying to use the Jitter physics engine, however, I can't get it to work correctly. For example, when I touch the side of a cube, it pushes me far back in the opposite direction. While I am flying back, if I hold the opposite directional key, I keep getting slower until I come to full stop.

Other times, I go right through the floor. I followed this tutorial.

I gave my floors BoxShapes and a RigidBody. I set them to static so the rigidbodies won't move. I did the same in my Player class but didn't set it to static.

How do I make it work correctly? If someone knows a better tutorial or physics engine I can use in C# with MonoGame/XNA, please let me know.

\$\endgroup\$
1

2 Answers 2

1
\$\begingroup\$

It's been a while since I used Jitter, but here's my two cents:

  • The push-back happens because a force is applied to your character in order to avoid penetration with the wall. Setting World.ContactSettings.BiasFactor to a lower value should reduce the force used, but may also cause slight penetration or other issues.

  • I had a similar problem with errant collision, which was caused by a Jitter bug. If you are using the 0.1.7.0 version (the last download, from Oct 2011), you are affected by it. The first line in JVector.TransposedTransform should be

    float num0 = ((position.X * matrix.M11) + (position.Y * matrix.M12)) + (position.Z * matrix.M13);

    The incorrect version has M31 instead of M13.

  • I don't know about current .Net physics engines, but Jitter certainly seems long since abandoned and somewhat incomplete.

\$\endgroup\$
0
\$\begingroup\$

Make sure your faces are oriented the right way; use IDebugDrawer to verify this.

\$\endgroup\$
1
  • \$\begingroup\$ This answer would be better if it gave some more details about how to use IDebugDrawer to check this - eg. what methods should the user call, and how should they interpret the results they see? If the faces are oriented incorrectly, what should they do to fix it? This kind of detail will tend to attract more upvotes. ;) \$\endgroup\$
    – DMGregory
    May 26, 2017 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .