You are here: Foswiki>WorldFoundry Web>AnalysisOfCurrentPhysicsSystem (08 May 2002, MrLin;)Edit Attach

In the ToDo list it was mentioned that adding rotation to the physics system was desirable.
Note that with arbitrary rotation, to have physics-stackable boxes and stable resting contact you need either

KevinSeghetti -- While it is true the existing method of determining the exact time of a collision is a bunch of math, it occurs in near constant time, there is no binary searching (see the function ComputeOverlapTimes in wfsource/source/physics/physical.cc Or click here . However, from reading this I now realize that if/when collision rotation is added it will either be a whole bunch more math (which I am probably not qualified to write, not really knowing any calculus) or become a binary search. Both of these other collision prevention systems sound interesting, I would like to work toward being able to plug in different physics behaviors so we can play with them.

MrLin -- BTW one other method I forgot to mention is the projective "fix-up" method, where physical evolution of the system is allowed to proceed in an unconstrained manner, then the geometric constraints are iteratively and procedurally "fixed up". This is an astonishingly simple and effective way to get "real-looking" rigid body dynamics while indirectly avoiding most of the math. See http://ns.ioi.dk/Homepages/tj/publications/gdc2001.htm Also the aero package http://www.aero-simulation.de is a penalty-based simulator and has excellent documentation (for understanding the theoretical basis) at http://www.ee.uwa.edu.au/!braunl/aero/ftp/docu.english.ps.gz A couple of other packages (GPL) worth looking at are DynaMo (constraint-based with iterative solution for constraint forces, but no direct support yet for resting contact) and ODE http://q12.org (constraint-based with analytical solution for constraint forces, support for resting contact). There are also several impulse-based simulators available, see http://d6.com/users/checker/dynamics.htm for a good tutorial with sample code. However impulse-based simulation does not support resting-contact (i.e. only good for bouncing boxes around, not stacking them). All of the above methods allow for arbitrary rotation. All of these physics systems need a better collision detector. For collision detection the ODE library provides several good box-box, box-sphere, box-cylinder, etc. tests. Also the FastCar library has a free collision detection library. If doing anything other than impulse-based physics, then the collision detector must provide the penetration depth (in the form of a penetration vector or closest-features points in space) of overlapping bodies; this penetration depth is used then to compute a constraint or a penalty force to correct the penetration. This is not necessary with impulse-based systems because the impulse is applied at the exact instant of collision, thus needing no penetration depth to compute the collision response. The availibility of penetration depth information is the reason that constraint- or penalty-based simulators can gracefully move from a penetrating to a non-penetrating configuration.

- a constraint-based physics system with an LCP (LinearComplementarityProblem) solver. Accurate and stable, no penetration of objects, but slow and hard to implement.
- a penalty method (springs and dampers). Easy to implement, but can be unstable (system blows up easily). Objects penetrate (sink slightly) into one another.

KevinSeghetti -- While it is true the existing method of determining the exact time of a collision is a bunch of math, it occurs in near constant time, there is no binary searching (see the function ComputeOverlapTimes in wfsource/source/physics/physical.cc Or click here . However, from reading this I now realize that if/when collision rotation is added it will either be a whole bunch more math (which I am probably not qualified to write, not really knowing any calculus) or become a binary search. Both of these other collision prevention systems sound interesting, I would like to work toward being able to plug in different physics behaviors so we can play with them.

MrLin -- BTW one other method I forgot to mention is the projective "fix-up" method, where physical evolution of the system is allowed to proceed in an unconstrained manner, then the geometric constraints are iteratively and procedurally "fixed up". This is an astonishingly simple and effective way to get "real-looking" rigid body dynamics while indirectly avoiding most of the math. See http://ns.ioi.dk/Homepages/tj/publications/gdc2001.htm Also the aero package http://www.aero-simulation.de is a penalty-based simulator and has excellent documentation (for understanding the theoretical basis) at http://www.ee.uwa.edu.au/!braunl/aero/ftp/docu.english.ps.gz A couple of other packages (GPL) worth looking at are DynaMo (constraint-based with iterative solution for constraint forces, but no direct support yet for resting contact) and ODE http://q12.org (constraint-based with analytical solution for constraint forces, support for resting contact). There are also several impulse-based simulators available, see http://d6.com/users/checker/dynamics.htm for a good tutorial with sample code. However impulse-based simulation does not support resting-contact (i.e. only good for bouncing boxes around, not stacking them). All of the above methods allow for arbitrary rotation. All of these physics systems need a better collision detector. For collision detection the ODE library provides several good box-box, box-sphere, box-cylinder, etc. tests. Also the FastCar library has a free collision detection library. If doing anything other than impulse-based physics, then the collision detector must provide the penetration depth (in the form of a penetration vector or closest-features points in space) of overlapping bodies; this penetration depth is used then to compute a constraint or a penalty force to correct the penetration. This is not necessary with impulse-based systems because the impulse is applied at the exact instant of collision, thus needing no penetration depth to compute the collision response. The availibility of penetration depth information is the reason that constraint- or penalty-based simulators can gracefully move from a penetrating to a non-penetrating configuration.

Edit | Attach | Print version | History: r1 | Backlinks | View wiki text | Edit wiki text | More topic actions

Topic revision: r1 - 08 May 2002, MrLin;

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding Foswiki? Send feedback

Ideas, requests, problems regarding Foswiki? Send feedback