getTotalForce not showing gravity force

dcofer
Posts: 14
Joined: Mon Feb 18, 2013 3:38 pm

getTotalForce not showing gravity force

Post by dcofer »

I am trying to get the total force acting on my rigid body, but gravity was never showing up. At first I tried calling getTotalForce before the btDynamicsWorld->StepSimulation. Then I saw that ApplyGravity() was called within StepSim, so it made sense why I would only see any externally applied forces I had added there and not the gravity force. However, I then switched to calling it after StepSim, and I got all 0's. I then noticed that one of the last lines of StepSim is ClearForces, which clears out the data I need. Is there a callback or something I am missing here for people to get the force data they need after gravity and internally applied forces are calculated, but before the force data is cleared out? How have other people done this? I can add something to fix this, but I would think there must be a way of handling this already.
dcofer
Posts: 14
Joined: Mon Feb 18, 2013 3:38 pm

Re: getTotalForce not showing gravity force

Post by dcofer »

Doh! Never mind. With a little more digging I was able to find the internalTickCallback and use that.