11

I am trying to setup some physical simulation in the BGE where it would be best if the the total energy of the system is conserved. However, if looks like I can't get the physics engine to keep the energy level even remotely constant.

Things I've done:

  • Render Settings: Toggled Use framerate
  • World: Gravity set to 0, played around with the FPS and physics accuracy, sleep disabled.
  • Dynamics: All Damping set to 0, tried 'rigid body' as well as 'dynamics'
  • Material: Friction set to 0
  • Material: Elasticity of Collision set to 1

Here is a test file: Layer 1 and 2 has two separate test scenes. There is a notable increase in the speed of all objects after each collision (as seen in the console window)

Am I missing something? Or am I asking too much from a game-centric physics engine?

Mike Pan
  • 11,990
  • 1
  • 37
  • 58

2 Answers2

3

I've written a Blender/Bullet simulation of a Newton's Cradle that doesn't conserve energy. Here's two animations that illustrate the problem:

Newton's Cradle animation Newton's Cradle animation

It's all done with rigid bodies, and the wooden top piece doesn't participate in the physics. The initial angle of the first ball is an adjustable parameter - 90 degrees in the first animation, 60 degrees in the second. You can reproduce everything by running this script in Bullet 2.69. Make sure the Tool Shelf is open to get to the simulation controls.

I suspect that it's all the same problem.

Brent Baccala
  • 295
  • 2
  • 6
-1

Wala, the following video shows an amazing tutorial. I am very impressed.

https://www.youtube.com/watch?v=v_SEkirxgNU