Physics Interaction

Started by
-1 comments, last by jvff 18 years, 8 months ago
Hello once again, Sorry about brining this up again, but it's about the same thing as the modular physics post. My problem is I need a flexible physics engine core to allow interaction between different user defined solvers. So the API has basicly two groups: the Primitives and the Interaction Models. The primitives are placed inside a Scenario and checked periodically for intersections between each other (using primiteve's collision function). Each primitive has an interaction model called when there is a collision. No problems in this part. When two primitives interesect, each primitive's interaction model is called and each interaction model applies forces on each other. The idea is simple. Or so it seems. Applying a force is too generic. When do we apply the force? Next timestep? As I'm using swept volumes collision detection (to prevent "indetection bugs"), the ideal would seem to check for a collision between the "sweeps" and clip them on intersection (simulating it hit it) and continuing check old and new sweeps (however the old one is now clipped) until finally ending the simulation timeframe (ie. we call simulate for 100 ms, it simulates as if 100 ms ellapsed in the game world). So far so good. The problem is the creation of the new "sweep" as it can vary based on the interaction model. Supose we have a tank of water, a cube inside the tank (with higher density than water and almost as high as the water level) and a ball (lower density than water an up in mid air). First gravity is applied, the cube is already in the bottom of the tank and the water is already stable, so they are inactive (and "go to sleep"). The ball doesn't have a normal force cancelling it's weight force, meaning it will fall. So the simulation runs until collision detects the ball has hit the water. Now comes the problem. How do I apply the water buoncy (is that the name?) force to create the new swept sphere and still use it to check if it goes deep enough to hit the cube? What if there is an external force (say the user applies a force forcing the ball down) or what if it falls but it is in a pendulum (so it will swing to the water)? And there's another problem (relating to the pendulum). Say pendulum is a rope connected to a point in space and a point in the ball. What if the pendulum swings so fast linear swept volume doesn't intersect the water tank (same problem as if used without swept volumes and a bullet is so fast it steps through an object but this time the circular movement "steps" to rotated position creating a swept volume to that rotated position)? Am I way off and confused? Am I overcomplicated when there's a simple method to combine all this? I thought about using circular based swept volumes (based on linear acceleration/velocity, centripetal acceleration and tangent acceleration) but isn't that an overkill? Is this the right way despite the fact is dark and complex? Thank you for reading this long post and sorry for brining this up. Thanks in advance for any suggestions, JVFF
ThanQ, JVFF (Janito Vaqueiro Ferreira Filho)

This topic is closed to new replies.

Advertisement