• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Mr_Nick

Contact force situation

10 posts in this topic

Hi, since no one has replied (though Im greatful for the number of views), I thought I'd clarify the situation.

A ball is in contact with a plane. At the contact point, the relative velocity along the contact normal is zero. The ball's centre of mass (COM) has accn of -g. The ball is spinning at such a rate that at the contact point, the centripetal accn cancels out the gravitational accn. So the calculated contact force to prevent penetration of the point is zero.

Obviously, this will not prevent the ball penetrating the plane.

I've now looked at the equations by Baraff, Eberly and Coutinho and all get this result of zero contact force.

What am I doing wrong? Do I ignore centripetal accn (even though the above authors don't)? Is it simply an unavoidable situation that I'll to code for?
Could anyone do an example calculation for me?
0

Share this post


Link to post
Share on other sites
I guess the authors use convex polyhedra in their algorithms. A ball has an infinite number of extremal points. The point of the ball actually touching the plane is not the point which is penetrating it in the next time step. If you approximate the ball with a polyhedron your algorithm should notice that there is a new point of contact and calculate the appropriate impulses to prevent penetration.
0

Share this post


Link to post
Share on other sites
Hey Inferiarum,
wow thats a really good point they do use convex polyhedra whereas I was using a perfect sphere. Guess Ill have to bite the bullet and implement a general intersection test for trimeshes. Im thinking either V-clip or GJK.. any recommendations?
Still, even if it were a polytope, the force required still wouldn't be enough in one go, it would take 1 or more iterations of the response algorithm to prevent penetration. Does that sound right? (I was previously under the impression that once the force was calculated, it would at least prevent penetration until the end of the time step).

Anyway thanks alot Inferiarum
0

Share this post


Link to post
Share on other sites
You do not have to do any iterations. In the case you described, you do not need a force preventing penetration, because the point will never penetrate the plane. If it was a polytope with only the one extremal point touching the plane, the center of mass would accelerate towards the plane, but the one point would stay on the plane because of the rotation. Your algorithm should then detect when the 'next' point would penetrate the plane and adjust the momenta accordingly. This would have the side effect of slowing down the rotation.

edit: concerning the algorithms I cannot really help you. Implement something you find easy to understand i guess. Edited by Inferiarum
0

Share this post


Link to post
Share on other sites
I think one of those authors you mentioned admitted that with the inclusion of friction into these LCP problems, the system may be "unsolvable". I got as far as checking out a book on the "Simplex" method, then promptly gave up on the whole thing. What I'd like to see is a solution similar to the Verlet which would work with classic RBD. Good luck with your quest, and keep us posted on your progress.
0

Share this post


Link to post
Share on other sites
Thanks for you're reply. Think I understand. It was just that in Coutinho's book, it said that after contact forces had been resolved, you can integrate to the end of the time step and no interpenetration will have occured. I guess he meant to add 'at that particular point on the body'? If that's the case I can see also why its necessary to use polytopes, as with the smooth sphere it would seem that in the above mentioned case that the simulation would be stuck in an infinite loop (because in the above case no state changes are made, the ball goes on to penetrate the plane, exactly as in the previous step, and then the system backs up the ball to the time of contact, and repeats the resolution - if that makes sense?). Either way thanks a lot think Ive had a big conceptual spoon up.
0

Share this post


Link to post
Share on other sites
Hi bpj1138, yes it says that there should always be a solution in the frictionless case (which Im currently [trying] to implement) but not always for the friction case.
0

Share this post


Link to post
Share on other sites
I strongly urge you to discard the force/acceleration model in favour of impulse/velocity. The later is a million times easier to implement and to find up to date tutorials / example code.

Have you seen my 'Physics engines for dummies' article?

http://www.wildbunny.co.uk/blog/2011/04/06/physics-engines-for-dummies/

It should give you some pointers :)

Cheers, Paul.
0

Share this post


Link to post
Share on other sites
[quote name='wildbunny' timestamp='1344712062' post='4968478']
I strongly urge you to discard the force/acceleration model in favour of impulse/velocity. The later is a million times easier to implement and to find up to date tutorials / example code.

Have you seen my 'Physics engines for dummies' article?

[url="http://www.wildbunny.co.uk/blog/2011/04/06/physics-engines-for-dummies/"]http://www.wildbunny...es-for-dummies/[/url]

It should give you some pointers [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Cheers, Paul.
[/quote]

I guess each physics simulator works with impulses implicitly because of the discrete nature of the simulations. The forces under consideration are used to keep bodies in resting contact.
0

Share this post


Link to post
Share on other sites
[quote name='Inferiarum' timestamp='1344727569' post='4968558']
I guess each physics simulator works with impulses implicitly because of the discrete nature of the simulations. The forces under consideration are used to keep bodies in resting contact.
[/quote]

Certainly it used to be the case that most simulators would treat collisions via impulses and then resting contacts via a force/acceleration model, but things have come a long way since then - these days its popular to treat collision and resting contact via impulses only - if handled correctly they are just visually stable, handle stacking very nicely, can treat friction without having to linearise and are numerically stable and you'll never end up in a situation where your LCP solver suddenly explodes due to an 'infeasible solution'. :)

For research, I suggest googling 'sequential impulses' ref Erin Catto.

Cheers, Paul.
0

Share this post


Link to post
Share on other sites
[quote name='Inferiarum' timestamp='1344727569' post='4968558']
I guess each physics simulator works with impulses implicitly because of the discrete nature of the simulations. The forces under consideration are used to keep bodies in resting contact.
[/quote]

I suppose you could integrate the equations symbolicly inside the time step. In classic RBD, you almost have to do this in order to conserve angular momentum properly, otherwise the system will leak energy. You can see this clearly when an object is nutating. A first order integrator will not work, or only work for a few seconds.

As far as stability, I haven't seen an LCP engine, so I can't say one way or another. I do know that adhoc methods have problems, because they have no concept that the solution depends on the entire system, rather work on pairs of objects separately from all the others.

This leads to impulses applied in opposite directions that grow in strength in order to componsate for the impulses working in the opposite directions. To use an analogy, think of people talking at a party, and having to talk louder and louder in order to be heard, meanwhile all the other people also start talking louder and louder so they can be heard, and so forth.
0

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  
Followers 0