Basroil wrote:
m_totalForce is an internal variable used to calculate how much force is accumulated in one stepping, and therefore is set to zero once you call stepsimulation(). If you want to find out the total force at the end of each step, you'll need to add a function for that directly into the solver code (just copy m_totalForce before it's deleted). Just remember that an object at rest produces zero force at the center of gravity, so you'll only get a non-zero result when the velocity changes (moment of impact only, once it stops it's back to zero)
Thank you Basroil,
Because I am very new to Bullet, I'm asking this: To add a function as "force collector" within the solver to collect all forces, I should do it in "btDiscreteDynamicsWorld.cpp" before the compilation, shouldn't I?
Another important question:
From your comment, it is clear that "m_totalForce" is the parameter that gets the "resultant" force applied on each rigid body.
However, if somebody is seeking for "interaction forces"*, is there any way to monitor it?
-------------------------------------
*more explanation on interaction forces:
Assume there is a cube on the ground with mass of 1kg (assume g=-10). the force applied on the cube , imparted from the ground, is 10 N.
If 2 identical cubes are going to be placed on top of that, the interaction forces between the bottom cube with ground will be: 10N x 3 = 30 N
-------------------------------------
In contrast to m_totalForce parameter, interaction forces tend to be non-zero when they are stopped and become larger when they are under pressure when they are static.
You may ask "what are you looking for such thing?"
The answer is that I am using Bullet for an engineering research program. Maybe in future it becomes possible to optimize Bullet in such a way to make it possible for engineers to make simulations with Bullet.
I would appreciate your comments and help beforehand.
Ehsan