Hi,
I have simulation set consisting of thousands of objects, densely packed, which are subjected to stress.
At different times during simulation, movements of rigid bodies are detected, and sometimes not.
How can I calculate the energy inside my system? Kinetic energy and potential energy?
Is there any parameter/function in bullet to calculate that?
Note: from potential energy I mean the energy exist between to rigid bodies when they are pressed towards eachother.
Thanks
Energy inside the system
- drleviathan
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Energy inside the system
No, I don't think there is functionality in Bullet to measure the potential energy of two objects that are being compressed. As far as I know the engine does not track internal stress forces at contact points during the simulation. Instead constraints are solved for new velocities and the internal forces involved are implicit in the solution -- they are never explicitly known in the simulation algorithm.
Re: Energy inside the system
The only way to have potential energy in the way you state is to have deformations, but by definition rigid bodies don't deform. I guess you can try to estimate the potential energy using the penetration depth of collisions, but that will probably be very resource intensive and not exactly correct.
Kinetic energy is a bit easier, you simply need to use E=1/2 sum(m*V^2), and that can give you the total kinetic energy. Just remember that if you expect rotation to be important you'll need to use the full mass and velocity matrix rather than just linear mass and velocity magnitudes.
Kinetic energy is a bit easier, you simply need to use E=1/2 sum(m*V^2), and that can give you the total kinetic energy. Just remember that if you expect rotation to be important you'll need to use the full mass and velocity matrix rather than just linear mass and velocity magnitudes.