Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to find the net normal force acting on all object?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 pizza123   Members   -  Reputation: 107

Like
0Likes
Like

Posted 07 January 2013 - 07:37 PM

Hi,

 

So I'm making a physics engine and I'm having trouble calculating the net normal force of an object that is in touch with many other objects (it works for 2 but doesn't work for more). The scenario is a circle is between two other circles (ontop of them, in the middle) and there are more circles on top of that circle. There's also gravity acting on the circle. Right now the way im calculating the net force on the object is first I apply gravity to it, then I apply the normal force from the first object in contact and get a new net force, then I apply the normal force from the second object to the net force and get a new net force, and etc... However I'm not sure if what I'm doing is correct. Is this the way to do it or is it wrong? 

 

Thank you



Sponsor:

#2 Sepii   Members   -  Reputation: 200

Like
0Likes
Like

Posted 08 January 2013 - 03:41 AM

The net force on an object is just the sum of all the forces. So I think what you are doing is correct.<br />Just make sure that applying a force means adding the force to the net force.

#3 EWClay   Members   -  Reputation: 659

Like
0Likes
Like

Posted 08 January 2013 - 04:34 AM

The 'correct' way would be to use a contact solver.

This is quite a complex topic but in essence you first find a list of all contacts, then you calculate the force for all of them at once using an iterative method.

Two common techniques are treating each contact as a collision and accumulating impulses, or forming a linear system of equations and solving, using for example the Gauss-Seidel method.

#4 pizza123   Members   -  Reputation: 107

Like
0Likes
Like

Posted 08 January 2013 - 05:57 PM

I read about impulses, but the only thing I don't understand about them is when to apply them (right at the collision, or at the beginning of the loop? if it is in the beginning of the loop I would have to store them at collision?). Also, what should I apply them to, the current velocity or a temporary velocity that I will later apply to the current velocity? Also, currently I implemented a discrete system, and there is a lot of jittering (especially when objects are supposed to be at rest), is there any way around that?

 

Thank you



#5 EWClay   Members   -  Reputation: 659

Like
0Likes
Like

Posted 09 January 2013 - 10:36 AM

First apply gravity, then loop over all the contacts. You can apply impulses directly to the objects, but keep track of the total impulse for each contact. This is because you might need to apply a negative impulse if the initial estimate was too large. This is fine, as long as the total is positive. Stop after a fixed number of iterations, or if all the impulses are small enough.

 

As for jitter, my experience (which may or may not be universally true) is that it will only go away if you have a stable set of contacts, and you use the previous frame's solution as a starting point.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS