Replies: 1 comment
|
The accumulated impulses associated with contacts are the ground truth. The tricky bit is that they are impulses, not forces. If you interpret them as the change in momentum over the substep where they are applied, you can then derive a timestep-independent force. Just accumulatedImpulse / (simulationTimestep / substepCount). You can see the SolverContactEnumerationDemo for an example. As usual, the example is for the direct minimum overhead API so it's a bit crunchy, but you can wrap it up in a more convenient form factor. On events: Checking impulses works whether the body is asleep or not. |
Uh oh!
There was an error while loading. Please reload this page.
I need to determine the normal force exerted by an object resting on the surface of another object for a project I'm working on.
i.e. I would like to 'measure' the weight of an object under the current simulation gravity, but I cannot figure out to do it with bepu. The closest I've found is this post https://forum.bepuentertainment.com/viewtopic.php?t=2397 which I'm guessing is for bepuphysics1 (?), searching the current repo I couldn't find anything about deferred contact events, and this comment seems to imply that they don't exist in the current version of bepuphysics2.
I'm using Stride, which provides a method
ComputeImpactForcefor contacts but if I'm reading it correctly there's no way it will work for an object at rest, and it doesn't seem likely to be very accurate otherwise anyway. Testing it out it produces extremely small values for bodies at rest seemingly unconnected to their mass (I'm keeping the bodies awake by manually setting Awake to true every frame just to be sure.)Intuitively I would think bepu must already be calculating these forces somewhere, is there currently just no way to get them out of the simulation?
All reactions