Advertisement

"Game Physics Engine Development"

Started by July 23, 2007 09:32 PM
16 comments, last by Tom Sloper 10 years, 1 month ago
All right, so I guess my first step is to learn calculus. You mentioned that I should learn multivariable calculus. Is an example of a function from multivariable calc this (just using two variables)?
F(m,a) = (m*a)
Or, do both variables need to be non-constant?

I read Chris Hecker's site, and he suggests buying this book: Calculus and Analytic Geometry, Thomas and Finney, Addison Wesley. Would this cover most of the calculus I would need to know? Are the functions for finding position, velocity and acceleration multivariable or one dimensional? I'm just not sure which resource to learn calculus is best, there are soooo many out there :)

Once again, thanks for your patience. This should (hopefully) be my last question. The path I need to take to learn physics is pretty clear (what to read, how to start out, ect..). It's just a matter of finding which path to learning the prerequisites that I need to learn!
I would suggest learning the prerequesites along doing the implementation. This is much more fun and without having a specific question you will not identify the relevant topics for you.


Advertisement
I bought this book a while ago, and agree it falls short of what I wanted: something that bridged David Baraff's and Chris Hecker's excellent intoductory stuff, and Eberly's incomprehensible book. I suppose it might be more useful for beginners?

Anyway, I found some errata and couldn't see how to report it. In case anyone has bought this book and is making use of it, check http://taumuon.blogspot.com/2007/08/game-physics-engine-development-mini.html

cheers,
gary
C# Physics Engine Tutorials: www.taumuon.co.uk/jabuka/
Hi all,

While I fully agree that Christer's book is one of the best out there (I personally enjoyed every chapter and I've read it from top to bottom), I'm not sure there are very good books on physics.

For example, my wife got me "Physics-based animation" (forgot the author's name) for my birthday (hehe) and it's a very nice book but it doesn't have code, it has very simple pseudocode. True, I can deal with it of course but sometimes having a live example helps.

Another thing, why do people are so hung up on GJK ? It is a nice algorithm for sure but there are several reasons not to use it:

1. It can only be used to find distance/intersection of convex sets.
2. It will not work well for complex objects, but would work well as an intersection algorithm for bounding volumes, specifically convex hulls.
3. It will not work too well for deformable bodies.
4. Even when considering bounding volumes, most of them are sphere/OBB/AABB/etc. and their intersection algorithm are preferrable
5. There are simpler algorithms that are good (Chung-Wang, or using a Dopkin-Kirkpatrick hierarchy for closest features distance)
6. It's very hard to implement properly (unless you copy it from Bullet physics hehehe)


-----------------------------He moves in space with minimum waste and maximum joyGalactic Conflict demo reel -http://www.youtube.com/watch?v=hh8z5jdpfXY
Well, the biggest drawback of GJK is that it is complicated, and difficult to get robust for all cases, but it has some nice benefits. GJK is compact and generic and it proves to work well in practice. A nice benefit of compact is that all collision detection combinations fit on a single Cell SPU (256kb), which is nice for Playstation 3 SPUs and XBox 360 multi core implementations (cache friendly).

Quote:
Original post by voguemaster

1. It can only be used to find distance/intersection of convex sets.
2. It will not work well for complex objects, but would work well as an intersection algorithm for bounding volumes, specifically convex hulls.
3. It will not work too well for deformable bodies.
4. Even when considering bounding volumes, most of them are sphere/OBB/AABB/etc. and their intersection algorithm are preferrable


No, GJK can also be used for concave objects, when combined with compound objects or bounding volume hierarchies. Also, when using persistent contact point manifolds or one-shot 2D projected contact area clipping (Jan Bender implemented this using GJK results for polyhedra), you get all contacts. Penetration depth can be calculated using EPA or sampling methods, which cooperate with GJK.
Quote:

5. There are simpler algorithms that are good (Chung-Wang, or using a Dopkin-Kirkpatrick hierarchy for closest features distance)
6. It's very hard to implement properly (unless you copy it from Bullet physics hehehe)

Feel free to copy it from Bullet, that's why I distribute it under the ZLib license. However, special-case code using SAT can be useful too.

It looks there is some room for another physics book indeed, can't tell you more...

Thanks,
Erwin
http://bulletphysics.com
Quote:

For example, my wife got me "Physics-based animation" (forgot the author's name) for my birthday (hehe) and it's a very nice book but it doesn't have code, it has very simple pseudocode. True, I can deal with it of course but sometimes having a live example helps.



Actually this book comes with a full library: www.opentissue.org
Advertisement

I have a qeustion regarding the book's content, namely resting contacts, and decided to revive this subject. I suppose only people who have read the book might be able to answer my question but if you would like to help me but has not read it I can provide any problem's details if necessary.

I created a very simple sample using your framework. There is a particle
resting on position (0.0, -0.1, 0.0). Collision happens when Y
coordinate is below -0.1 so this contact is indeed resting. I also add
(0.0, -1.0, 0.0) force each frame. Since the contact is resting I
thought the particle would stand on the ground but it appears to be
bouncing. Why is that so?

Here is the Particle Contact Generator:

class CG : public cyclone::ParticleContactGenerator
{
public:
cyclone::Particle *particle;

virtual unsigned addContact(
    cyclone::ParticleContact *contact,
    unsigned limit
    ) const
{
    if (particle->getPosition().y <= -0.1f)
    {
        contact->contactNormal = cyclone::Vector3(0.0f, 1.0f, 0.0f);
        contact->restitution = 1.0f;
        contact->particle[0] = particle;
        contact->particle[1] = nullptr;
        contact->penetration = -0.1 - particle->getPosition().y;

        return 1;
    }

    return 0;
}
};

myPart particle creation:

    cg.particle = &myPart;
    world.getContactGenerators().push_back(&cg);

    myPart.setPosition(0.1f, -0.1f, 0.0f);
    myPart.setVelocity(0.0f, 0.0f, 0.0f);
    myPart.setDamping(1.0f);
    myPart.setAcceleration(0.0f, 0.0f, 0.0f);
    myPart.setMass(1.0f);
    myPart.clearAccumulator();

    world.getParticles().push_back(&myPart);

and force that I apply in the update function:

    myPart.addForce(cyclone::Vector3(0.0f, -1.0f, 0.0f));

Is that correct that particle myPart should be resting instead of
bouncing off the -0.1 ground?
maxest, please don't necro ancient threads. Also please don't hijack other threads to tack a new question onto - start your own thread.
Closing.

-- Tom Sloper -- sloperama.com

This topic is closed to new replies.

Advertisement