Jump to content
  • Advertisement
Sign in to follow this  
d07RiV

Modeling restitution

Recommended Posts

3 hours ago, d07RiV said:

Ah well, so most engines just ignore this and move on?

Well not all of them but lots of single developer made ones do. Physics engines like Bullet, Newton and Nvidia Physics can all resolve this.

If I had to say what is wrong it would be the order that the code executes. Have you tried first resolving all the math for a given step then animating it?

Share this post


Link to post
Share on other sites
Advertisement
2 hours ago, Scouting Ninja said:

Well not all of them but lots of single developer made ones do. Physics engines like Bullet, Newton and Nvidia Physics can all resolve this.

If I had to say what is wrong it would be the order that the code executes. Have you tried first resolving all the math for a given step then animating it?

If by "this" you meant magically move energy in the system in a realistic manner, then no they definitely can not. But if you meant, it's possible to tune the setup to make a Newton's cradle, then of course that's possible. But the behavior is not a natural emergence that can be easily replicated in other situations...

Share this post


Link to post
Share on other sites

For the games I've worked on, we use physics engines on things that we need to look "physically plausible" (destruction debris, tossed objects, etc.), but not on things that need be precise (e.g. character movement). In other words, we treat game physics engines as decorative tools, and we don't base core game mechanics on unsupervised physical simulation.

For things we need to be precise controls over, we always use specialized logic outside of the physics engine.

If a Newton's cradle never interacts with anything, then I'd just have it animated (simulating it physically is a waste of processing power). If it can interact with other objects, then I'd still have it animated, but physicalize it when touched by other objects. Once it's physically interacting with other objects, I doubt physical precision would be a concern, unless the Newton's cradle is the absolute major focus of the game.

Share this post


Link to post
Share on other sites
1 hour ago, Randy Gaul said:

If by "this" you meant magically move energy in the system in a realistic manner

I meant solving energy in a system in a Mathematical manner. You could solve it on paper as well. To be clear, I am talking about calculating the results of each impulse and then rendering it; not simulating all internal energies. 

https://en.wikipedia.org/wiki/Newton's_cradle the wiki here explains it in a very simple manner and many people have emulated it.

2 hours ago, Randy Gaul said:

But the behavior is not a natural emergence that can be easily replicated in other situations...

If you had a known situation where you needed it you could find a solution, but emulating it all the time; yes that is impossible for now. 

Share this post


Link to post
Share on other sites

It's definitely possible to simulate with some methods. In my old school project 2D solver it worked perfectly, because it handled contacts one at a time, so it took multiple frames to propagate the impulse. But that solver has tons of other limitations.

I was specifically asking about more general case solvers that can handle complex scenes. If all contacts are resolved simultaneously (iteratively or not), then it seems there is no way to specify which particular solution you're looking for.

Oh well, thanks anyway.

Share this post


Link to post
Share on other sites
Posted (edited)

So I asked Dirk specifically, and  he says LCP formulation cannot solve Newton cradle, and this is specifically a well-known topic in literature. I believe he referred to work by Kauffman.

Basically affirming what d07RiV and myself were talking about earlier.

Edited by Randy Gaul

Share this post


Link to post
Share on other sites

This is a good discussion of the problem:

http://www.cs.columbia.edu/cg/rosi/

In a nutshell there exist two collision/contact models I am aware of: simultaneous and sequential. For the Newton Craddle you need to propagate velocity sequentially in the right order to get the right behavior. It is probably something I would investigate for a pool game. For everything else simultaneous contact is really a good choice from my experience. Note the sequential impulses are really a simultaneous model since it solves the LCP formulation of the problem. It does not sequentially propagate velocity as the name might (incorrectly) suggest.

Share this post


Link to post
Share on other sites

I'm a little lost in the terminology here. Which model is sequential and which is simulatenous? Does simulatenous imply that you try to solve all contacts at the same time, or is it the same as iterating through them multiple times?

I also found an old discussion here https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=&f=4&t=1584

Jan Bender claims that the method in his paper handles newton cradle correctly, but the description of how it handles collisions seems identical to the classic constraint solver.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!