Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

288 Neutral

About nire

  • Rank
  1. nire

    Constant Surface Area Constraint

    It doesn't seem like you have any restoring forces. Your constraint is basically conservation of mass. You could try adding the constraints: r - r0 = 0 length - length0 = 0 And model those as soft constraints.
  2. nire

    Sweep test and physics

    I agree that CA is just one piece of the puzzle. The TOI solver in Box2D handles rotation and is quite fast. However, generating a robust TOI response still remains challenging. I have iterated a lot on the TOI response code in Box2D. Initially I tried solving islands during the TOI events. However, any inaccuracy in the contact solver can lead to tunneling. For example, a heavy body can still push a light body through the floor (which is an infinitely thin line segment). So I had to abandon much of the desired dynamic-vs-dynamic interaction in the TOI response solver. This has the benefit that TOI events between dynamic and static bodies are handled quite accurately and quickly. I still retain support for bullets, which are fast moving bodies that can perform a TOI impact with dynamic bodies. However, piles of bullets will not work well. The predictive contact technique is interesting, so here's one more vote for an article by Paul. I think we cannot neglect fast rotations in general. Many games with destruction and explosions often have long beams that spin quickly. Consider the images below. The beam is not rotating, but moving very fast towards a thin floor. We can easily catch the first contact point. However, the beam will pick up a fast rotation while still in contact with the floor. Then the beam can rotate through the floor. This would seem to be a problem for any kind of solver, be it predictive, TOI, or CA based.
  3. nire

    Sweep test and physics

    This is an interesting topic and I know that several games use this technique. However, I think there are still some open questions. Does LBP use predictive contacts for dynamic-vs-dynamic? That would seem to create a lot of ghost forces. I am also concerned about fast rotations of slender objects. I don't see how a single contact point can prevent tunneling in those cases. Box2D has continuous physics using a TOI solver and sub-steps. It is working well for dynamic-vs-static and has limited support for dynamic-vs-dynamic. The code has good performance, yet adds a lot of complexity to the code. It would be nice to have something simpler.
  4. nire

    Continuous angular collision detection

    CA can takes hundreds of iterations in some cases (distance is small and angular velocity is large). The worst case for CA would be something like a hockey puck that is lying flat on the ice, but spinning very fast about the vertical axis. CA is basically one-sided root finding. This is an awful restriction on a root finder. It is better to bracket the root on both sides. Then you will have many root finding tools you can use.
  5. 1. Normally you solve Newton's law for the new velocity and stick that into the velocity constraint. Then you have an LCP for the constraint force. Solve the LCP for the constraint force and stick that into Newton's law to get the new velocity. 4. The LCP is solved numerically, so you can't differentiate the result.
  6. 1. First define your constraint. For example: a point should not penetrate a plane: dot(normal, point_moving - point_on_plane) >= 0. Then differentiate this with respect to time to get the velocity constraint: dot(normal, point_velocity) >= 0. Then use Newton's Law and the Principle of Virtual Work: mass * point_acceleration = -mass * gravity + normal * constraint_force. Apply Euler integration: mass * (point_velocity_new - point_velocity_old) = time_step * (-mass * gravity + normal * constraint_force). Now substitute this into the velocity constraint for the new velocity and you'll get an LCP. This is the velocity level LCP. In summary, the velocity level LCP is a combination of: velocity constraints, Newton's Law, Virtual Work, and Euler integration. 2. Barraff encounters infinite friction forces when working at the acceleration level. His example is a ruler sliding along the ground paradoxically can generate infinite friction forces when the ruler and ground are treated as completely rigid. You can avoid these infinite forces when working at the velocity level. 3. My approach is to specify the position constraint using geometry and then differentiate the position constraint with respect to time to get the velocity constraint. 4. You can use RK4 to integrate the applied forces. Dealing with constraints at the velocity level requires the constraints to be integrated with Euler's rule.
  7. nire

    Summary of available engines

    The conventional wisdom is that it is hard to write a physics engine or to understand how one works. This is somewhat true. It is hard to find capable physics programmers these days. Havok has profited from this situation. But how long will it be before a league of capable physics programmers is available? There is a handy term for this situation: http://en.wikipedia.org/wiki/Confusopoly
  8. nire

    2D rigid bodies - working tutorial?

    What compiler are you using? This version of Box2D is known to compile on VS2003, 2005, and on Linux with GCC (with small changes): Latest Box2D
  9. Another way to do this is to use constraints. The advantage is improved stability because you don't need to use a spring-damper system. You can make some aspects of the constraint very rigid (such as rotation) and other aspects can be weaker (such as lateral translation). However, if your system is very simple you can use implicit integration to get good stability without affecting performance too much.
  10. nire

    2D Physics and Collision Detection

    Here's a 2D physics engine and tutorial: Box2D
  11. nire

    Euler Stability

    Most physics engines end up using symplectic Euler without even realizing it. I'm guessing they wind up that way by trial-and-error. It's amazing the amount of resistance people have to using symplectic Euler. I guess it seems to good to be true. Really, it's the only integrator anyone should care about for game physics.
  12. Airo: Sorry, the slides were mostly designed for a live presentation. Hopefully looking at both the slides and code will clear things up. Yes, you can implement any type of joint with the method, but I did not go into full details on this. John: The main source of springiness is due to large mass ratios between the bomb and other boxes (up to 50-to-1). Sequential methods favor mass ratios close to one. You might try adjusting the bias factor to get a different look. I used a hard-coded value of 0.1f. The important distinction of this method from other published methods is the use of accumulated impulses and accumulated clamping. Also, the use of Arbiters to store the accumulated impulses is crucial for performance and stability.
  13. Thanks! I hope this will answer a lot of the questions people have about impulse methods. Box2D Demo
  14. Here's my physics tutorial from the GDC. It includes a 2D engine called "Box2D". Source code is included. The engine uses sequential impulses with some enhancements to enable stable stacking. http://www.gphysics.com/files/GDC2006_ErinCatto.zip Erin
  15. nire

    N-Body Collisions, Concurrent Updates, Stacking?

    At the beginning of the step you determine which objects are touching and store the pairs in a list. For the response you can iterate over the pair list a few times. This last step is only O(N^2) in the worst cast and allows for propagation of collisions.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!