Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Irlan

Member Since 08 May 2012
Offline Last Active Today, 05:54 PM

Posts I've Made

In Topic: linking to a static library which references other static libraries?

16 June 2015 - 06:05 PM

Personally, I link all library dependencies with the application manually instead of compiling a 1TB static library. I think the dependencies this way becomes more explicit. This doesn't defeats the modularized approach.


In Topic: Adding restitution to the MLCP

14 June 2015 - 09:21 AM

Ok. Thanks!


In Topic: stable constraint solver with no warmstarting

13 June 2015 - 11:48 AM


Hi people!

Short story, I was trying to understand how physics engine work, and proceeded to code a simple 3d physics engine based on a very nice presentation from erin catto. I took a peek inside box2d-lite source code and implemented my 3d version. It works, I got boxes colliding and stacking nicely (wiggle a bit at start, but converge into a stable configuration quickly).
 
Now as I understand it, box2d-lite used iterative solver. This kind of solver gives a quite-close-to-correct solution in every iteration, based on the answer of previous iteration. That makes the "warmstarting" very essential. In fact, without it, the solver would be "wrong". The thing is, keeping a list of arbiters for every pair of touching bodies is quite a lot of work. Are there any other physics engine schemes that don't need "warmstarting" but very stable and simple enough to implement? I don't want to have to do the housekeeping of records of touching bodies. I simply want to do it the "sweep, prune, solve and forget" kind of style.
 
Do you know any tutorial/articles that might be useful? Or maybe a source code to take a look at? Thank you!

 

Box2D uses Projected-Gauss-Seidel (PGS) to satisfy velocity constraints subject to mixed complementarity conditions (MLCP) (a general complementarity problem for collision and contact, and the mixed part for friction (motor joint) ). The Gauss-Seidel part is for solving a simple generalized linear equation, and the Projected essentially is just a clamping procedure on the impulse magnitudes. Generally you find the PGS algorithm for a generalized system, so it is not completely explicit by the sequential impulses technique at first. Iterative solutions (iterative numerical methods and solvers) algorithms are used in interactive applications. Global solutions such Baraff's techniques are generally used in real-time ones or even discarded. If you want to understand how really this works I recommend all Baraff papers (89-2000), and Kenny Erleben thesis (2004), as well Florian and Potra papers. So, the sequential impulses is a specialization of the PGS algorithm. The sequential impulses technique will search for the corrective impulses, that's why you don't want clamping the solution directly. In the sense of being an iterative solver the PGS algorithm uses an initial guess for the lambdas. You need a way of matching contact points. This depends of the discrete collision detection scheme that you have. Iterative algorithms (GJK, MPR) generally are distance algorithms, so you get only two points in every geometry (and you also need to adjust to work for penetrating cases). This way you need to match new and old points using some criteria such the contact area projected on the gravity direction. For SAT you need contact point IDs (as mentioned), then, it is definately a better solution. 

 

The sweep-prune-solve and forget requires a lot of tunning. Specifically with the discrete collision detection scheme.

 

At the end, you should have something like this for an interactive application:

 

BVH (AABB) Tree/Sweep and Prune;

SAT;

Semi-implicit Euler for integration;

Contact Graph;

 

[Update]

 

In this thread

 

http://www.gamedev.net/topic/667499-3d-sat-problem/

 

Dirk Gregorius answered a lot of questions with the SAT detection scheme excellently (all credits for him).


In Topic: Solvin multiple contact points on a rigid body

25 May 2015 - 07:54 AM


I disagree. Two shapes are in contact when they are touching or overlapping.

 

Did you mean "Two shapes are in contact when they are touching or touching and overlapping?"


In Topic: Adding restitution to the MLCP

25 May 2015 - 07:49 AM

I'm using the (generalized) LCP approach. So in this case does the restitution can be added  to the constraint equation as well the Baumgarte (correction term)?

 

This paper

 

https://www.cs.ubc.ca/grads/resources/thesis/Nov02/Michael_Cline.pdf

 

adds the restitution to the constraint equation, but it doesn't says if the solver stops at some point to solve for contact and impuses separately (like Barraf's 89 approach).

 

So basically, is the sequential impulses method an simplified version of the PGS?


PARTNERS