Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Physics Sim - GJK and Impulse

2 views
Skip to first unread message

Nemo

unread,
Apr 7, 2002, 7:55:24 PM4/7/02
to

Hi, I have a few questions about physics simulators:


1) Do most sims use double-precision? Can you get by with single-precision
if you care mostly about it "looking right", or will stability go haywire.

2) I'm using GJK for collision detection and Brian Mirtich's impulse-method
to resolve colliding/resting contacts. I'm having trouble with objects
sinking into each other. Apparently, the impulses aren't strong enough to
prevent penetration. I've tweaked the restitution to fix this somewhat, but
it does not work for every case.

3) What do most people do when a collision occurs? Even when you sub-divide
the timestep to get the "exact" time of collision, it seems that you will
slowly lose accuracy especially when objects are almost at resting contact.
I think this manifests in my sim when objects start sinking into the
ground.

4) Can you really rely on single-point contacts and micro-collisions to
resolve resting contacts. More importantly, can you do it in real-time
without sub-dividing timesteps? Right now, I can get a ball to rest on a
table, because there is only a single-point of contact for a sphere. But,
when I try it with a cube, the cube ends up rotating into the table.
Conceptually, when one corner hits, the other corners should immediately
get impulses a _very_ short time later. But, like I said, my sim can't
handle such minute changes, especially if I don't sub-divide the timestep.
So, what ends up happening is that the cube is rotated into the table, in
which case, GJK detects penetration, but it has no info about the new
corner that hit.

5) I really like the simplicity of a pure-impulse method, but given these
problems, I'm thinking of going with a constraint-based approach. I've also
heard John Nagle say on a thread that impulse-methods are not as great as
once thought. Is this the general consensus, because the video clips
showing impulse in action look great. Or do those sims require heavy
computation and/or specialized tweaking?

Thanks for any input.

Nemo

John Owens

unread,
Apr 8, 2002, 6:55:49 AM4/8/02
to
> 1) Do most sims use double-precision? Can you get by with single-precision
> if you care mostly about it "looking right", or will stability go haywire.

It's probably bad to rely on double-precision to improve stability anyway.
When I was working on my physics stuff I just used doubles however as
physics are used for PS2 games then I would amagine they used single floats.

> 5) I really like the simplicity of a pure-impulse method, but given these
> problems, I'm thinking of going with a constraint-based approach. I've
also
> heard John Nagle say on a thread that impulse-methods are not as great as
> once thought. Is this the general consensus, because the video clips
> showing impulse in action look great. Or do those sims require heavy
> computation and/or specialized tweaking?

I used a pure impulse method and the problems your having are all the ones I
had :-),
anyway what I did was to fudge it, a mixture of when there's a collision:
making sure neither object intersects after they are moved apart (use
Relative Velocity for this), and capping (so when it gets really small make
it 0) many variables such as angular velocity etc. At the end of the day
they are going to be fudges but this seemed to work ok.

To be honest I can't even remember what the constraint-based method was
allthough I do remember looking at it, so I can't say which is better.


Morfeas

unread,
Apr 8, 2002, 8:10:00 AM4/8/02
to
Wow, flashback! We need to talk!


Nemo wrote:

> 1) Do most sims use double-precision? Can you get by with single-precision

I'm using double precision, never tried single precision so don't know what
the effect would be

>
> 2) I'm using GJK for collision detection and Brian Mirtich's
> impulse-method to resolve colliding/resting contacts. I'm having trouble
> with objects sinking into each other. Apparently, the impulses aren't

I've had (still having occasionally) exactly the same problem!
Unfortunately it can be due to a number of reasons.

>
> 3) What do most people do when a collision occurs? Even when you
> sub-divide the timestep to get the "exact" time of collision, it seems
> that you will slowly lose accuracy especially when objects are almost at

Try using a 'penetration threshold'. If the penetration of object A into
object B is <penetration_threshold then collision occurs (no subdivision,
no nothing, send straight to your collision handler). If penetration >
penetration_threshold, then you have an actual penetration (that is not
allowed), and you need to backtrack and half (or whatever) your time step


>
> 4) Can you really rely on single-point contacts and micro-collisions to
> resolve resting contacts. More importantly, can you do it in real-time
> without sub-dividing timesteps?

Yes. All the stuff from Brian Mirtich's papers are meant to be real-time (I
think). In any way, I'm doing in real time at 40+ FPS (on really simple
models, unoptimised). Remember, you only need to divide the time-step if a
really deep penetration has occured

> Right now, I can get a ball to rest on a
> table, because there is only a single-point of contact for a sphere. But,
> when I try it with a cube, the cube ends up rotating into the table.

I presume you mean 'bouncing' on the table, not rotating parallel to the
table's surface. I think there are a couple of ways to deal with this.
either introduce some damping (which will make small velocities and
accelerations zero).

There is another way which I'm developing which seems to give me some nice
results. Dr Baraff has written a couple of papers on _resting_ (as opposed
to colliding) contact. The way to simulate resting contact is to work out
the contact forces necessary to keep the object 'afloat' (i.e. not sinking
into the table). I'm doing something different. When a collision occurs, I
work out the impulses (as usual) and use them to modify the velocities of
the objects. However, in a similar manner I also modify their
accelerations! So, when an object drops on the ground and comes to rest
(i.e. stops bouncing) its downwards acceleration will be zero.


> Conceptually, when one corner hits, the other corners should immediately
> get impulses a _very_ short time later.

In theory, they happen instantenuously (and I know I didn't spell that
right). You need to think about how you're going to handle multiple
collisions such as this.

You can either do it the proper way, which is to handle them all together
at once (see Baraff's paper on Resting contact forces, and do a search for
someone called Kawachi and his paper 'Technical issues of simulating
impulse and friction in three dimensional rigid body dynamics'). They deal
with some issues of multiple simultaneous collisions (e.g. Dantzig's
algorithm). You might also like to read Brian Mirtich's PhD thesis, we've
(the people of this newsgroup) managed to located (look at earlier
articles). I'm ashamed to admit that while I was the one who originally
asked for it, I still haven't had time to read it! :(

On the other had you can handle collisions one at a time (I imagine that's
what Brian Mirtich's doing). Personally I detect all collisions on an
object but only handle the deepest one.

> which case, GJK detects penetration, but it has no info about the new
> corner that hit.

Why doesn't it have info about it?


>
> 5) I really like the simplicity of a pure-impulse method, but given these

Me too!

> problems, I'm thinking of going with a constraint-based approach. I've
> also heard John Nagle say on a thread that impulse-methods are not as
> great as once thought. Is this the general consensus, because the video

If I remember correctly (and I can't be bothered looking for the article)
he said something in reply to me looking for Brian Mirtich's thesis. I
believe he said that _micro_ collisions are not the way to go (sorry if I'm
misquoting).

Personally I think impulses are the way to go for things like games and
simple sims, where you want something that looks realistic but is not
necessarily correct (as in engineering simulations for example).


Contraint based methods are more difficult I think. In a way I'm working on
a constrained based method as well because of my academic work (Discrete
Element Modelling) but it's too early to comment on that.


And now for a bit of self-promotion. I'm developing a website for the
game/sim I'm writing. Specifically I'm covering a lot of the theory that is
involved (altough I'm not repeating stuff that other people have published
papers about). Go there and have a look.

http://www.freecfm.com/m/morfeas/cartracer/index.htm

I'd be interested to know if you have any more problems that I've faced or
vice versa.

Let me know if you have any luck implementing Dantzig's algorithm.

Can anyone comment on handling multiple collisions?

Cheers,

Morfeas

--
www.freecfm.com/m/morfeas

John Nagle

unread,
Apr 8, 2002, 3:17:01 PM4/8/02
to
Nemo wrote:

> Hi, I have a few questions about physics simulators:
>
> 1) Do most sims use double-precision? Can you get by with single-precision
> if you care mostly about it "looking right", or will stability go haywire.


If you don't get too far from the origin, it can work.
But you have to pay more attention to significance.
Think about what happens when you're 100,000 units from
the origin. What's the smallest change in position you
can represent?

The Playstation 2 only has single-precision floating point,
and Havok runs on the PS2. I'm told that took some work.


> 2) I'm using GJK for collision detection and Brian Mirtich's impulse-method
> to resolve colliding/resting contacts. I'm having trouble with objects
> sinking into each other. Apparently, the impulses aren't strong enough to
> prevent penetration. I've tweaked the restitution to fix this somewhat, but
> it does not work for every case.


GJK is fine (but use a modern implementation; Rabbitz's can loop).
And make sure you have clean input geometry.

Pure impulses just don't do resting contact very well. Bounces,
yes; resting, no. Multiple resting contacts are even worse.


> 3) What do most people do when a collision occurs? Even when you sub-divide
> the timestep to get the "exact" time of collision, it seems that you will
> slowly lose accuracy especially when objects are almost at resting contact.
> I think this manifests in my sim when objects start sinking into the
> ground.


That's a classic problem. Commercial products of the mid-1990s
tended to do that. The physics built into Softimage had that problem.


>
> 4) Can you really rely on single-point contacts and micro-collisions to
> resolve resting contacts.


No. Spring/damper systems can be made to work, and
impulse/constraint systems can be made to work, but pure impulse
systems are fundamentally limited.


> 5) I really like the simplicity of a pure-impulse method, but given these
> problems, I'm thinking of going with a constraint-based approach. I've also
> heard John Nagle say on a thread that impulse-methods are not as great as
> once thought. Is this the general consensus, because the video clips
> showing impulse in action look great. Or do those sims require heavy
> computation and/or specialized tweaking?


Impulse-based systems handle stuff banging around just fine.
But the hard cases have problems. Multiple contacts are
tough.

There are a fair number of games out there that use
impulses plus some hacks. There are non-physical hack
solutions to resting contact that will make things
look reasonable most of the time. It's a cheat,
but often effective. Try Sega's "Crazy Taxi", for
example. Their physics looks good, even though, if
you push piles of junk too hard, sometimes an object
will disappear.

The basic hack is that, after you're done doing
the impulses, you "tweak" the positions of the objects
until the contact situation is satisfactory. If you
tweak the lowest objects first, the results are
more reasonable. This is a low-rent substitute for
a constraint system, which tweaks all the objects
simultaneously and consistently. If you're just
writing a first-person shooter, and the physics is for
banging obstacles around, this may be good enough.

There will be situations you can't resolve with
that hack, so figure out some gameplay solution to deal
with excessive interpenetration. Make unresolvable
objects disappear, turn to dust, catch fire, or blow up.
That can play better than strict rigid-body
physics, as when an object gets caught in a closing door
or a pile of objects blocks a vehicle.
It may be better for gameplay to make the obstacle
turn to dust or blow up, rather than jamming the door
or blocking the vehicle.

If you're doing a commercial game, I recommend
licensing Havok's engine. No way are you going to
crack this problem without spending more on R&D
than Havok will charge you to license their engine.
Everybody who's gotten this right has spent years
on it.

John Nagle
Animats

Marco Grubert

unread,
Apr 9, 2002, 2:35:00 AM4/9/02
to
Hello,

> 1) Do most sims use double-precision? Can you get by with single-precision
> if you care mostly about it "looking right", or will stability go haywire.

I am mostly using floats which works okay near the origin. For large scale
environments try changing to double or use some kind of offset.

> 2) I'm using GJK for collision detection and Brian Mirtich's
impulse-method
> to resolve colliding/resting contacts. I'm having trouble with objects
> sinking into each other. Apparently, the impulses aren't strong enough to
> prevent penetration. I've tweaked the restitution to fix this somewhat,
but
> it does not work for every case.

Check your impulse formulas and collision detection algorithms. I was having
problems with sinking objects because of an impulse response that was
slightly off. After correcting a typo my objects usually don´t penetrate
each other anymore, except for certain pathological cases.

> 3) What do most people do when a collision occurs? Even when you
sub-divide
> the timestep to get the "exact" time of collision, it seems that you will
> slowly lose accuracy especially when objects are almost at resting
contact.
> I think this manifests in my sim when objects start sinking into the
> ground.

Currently I am bounding the point of impact t with a reasonable epsilon
distance [t-eps, t+eps]. Then I first advance the involved objects to a
point t+eps to calculate the impulse, rewind time to t-eps (to make sure
objects are not yet colliding) and apply the impulse. Not sure how GJK
works, but I am using a collision detection routine that´s very fast but
does not return penetration depth- this requires more subdivisions yet the
performance cost of this does not seem to be too large.

> 4) Can you really rely on single-point contacts and micro-collisions to
> resolve resting contacts. More importantly, can you do it in real-time
> without sub-dividing timesteps?

I doubt that. Subdividing has greatly improved the reliability of my sim and
without subdivision you won´t be able to cope with strong impulses such as
those created by impacts at the far end of an object (high torque).


> Right now, I can get a ball to rest on a
> table, because there is only a single-point of contact for a sphere.

..and your sphere just sits there without falling over (accuracy) ? No
bouncing ? No sinking? That´s surprising.

> 5) I really like the simplicity of a pure-impulse method, but given these
> problems, I'm thinking of going with a constraint-based approach.

After reading Baraff´s notes I have decided that a constraint-based approach
is too complicated to write and probably too time-consuming for realtime
simulation. Hopefully several hacks and tweaks will give me similar results
without the extra costs :-/

> I've also
> heard John Nagle say on a thread that impulse-methods are not as great as
> once thought. Is this the general consensus, because the video clips
> showing impulse in action look great. Or do those sims require heavy
> computation and/or specialized tweaking?

The field of impulse-based simulation is very small, and I have only found a
few papers on it that are not by Mirtich et al. Most people seem to prefer
constraint-based simulation, but there the goal usually is precision and not
computer game demands.


<< anyway what I did was to fudge it, a mixture of when there's a collision:
making sure neither object intersects after they are moved apart (use
Relative Velocity for this), and capping (so when it gets really small make
it 0) many variables such as angular velocity etc. At the end of the day
they are going to be fudges but this seemed to work ok.>>

What do you mean by capping ? When you set the small relative velocity to 0,
won´t this cause sinking ?

<<If I remember correctly (and I can't be bothered looking for the article)
he said something in reply to me looking for Brian Mirtich's thesis. I
believe he said that _micro_ collisions are not the way to go (sorry if I'm
misquoting).>>

I am not sure I understood this chapter in Mirtich´s thesis. How are
micro-collisions supposed to help in close contact situations ?

- Marco Grubert

PS: Good to know that there are other people out there dealing with the same
issues :o)


Mark Sheeky

unread,
Apr 9, 2002, 12:49:08 PM4/9/02
to
>1) Do most sims use double-precision? Can you
>get by with single-precision
>if you care mostly about it "looking right",
>or will stability go haywire.


It depends on what you want to simulate and how accurate you want the
results. If it's for a game and only looks matter, like pool ball
motion or a lunar lander game, single is fine. Direct3D uses singles.

The rest of this email is byond me but to stop sinking/intersection
during colissions I simply force the objects apart until (in practice
a tiny bit beyond) touching, prior to any collision maths. This is
fine for a game but again it depends what you're trying to simulate
and how accurate it must be. It is possibile to calcluate the position
of both bodies at point of impact and place them there based only on
their motion and shape.

As a game developer and not a mathematician I can state that if things
look right, they are right :)

Mark
ma...@treality.freeserve.co.uk
http://www.treality.freeserve.co.uk/
http://www.noisestation.com/
------

Nemo wrote in message ...

Nathan Mates

unread,
Apr 9, 2002, 1:58:33 PM4/9/02
to
In article <Xns91E9AC2A29812n...@68.6.19.6>,

Nemo <ne...@somewhere.earth> wrote:
>1) Do most sims use double-precision? Can you get by with single-precision

Double-prevision takes double the amount of memory (probably not an
issue unless you're on a console) and double the amount of motherboard
bandwidth (possibly more of an issue). Further, there are some game
consoles on the market that can do floats, but not doubles. [Not going
to name names, but once you start working with them, this should be
ovbious.]

A whole lot of games use straight floats for 90+% of their
calculations, and doubles only where absolutely necessary. I'd really
recommend using a typedef in C/C++ throughout your code so you can
switch between the two at the cost of a rebuild (easy) vs a rewrite
(hard).

Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein

Gino van den Bergen

unread,
Apr 10, 2002, 10:25:43 AM4/10/02
to

"Nemo" <ne...@somewhere.earth> wrote in message
news:Xns91E9AC2A29812n...@68.6.19.6...

>
> Hi, I have a few questions about physics simulators:
>
>
> 1) Do most sims use double-precision? Can you get by with single-precision
> if you care mostly about it "looking right", or will stability go haywire.
>

My implementation of GJK as published in SOLID 2.0 requires
double-precision. Currently, I have a stable single-precision implementation
of GJK. The enhancements that are necessary in order to run GJK in single
precision are discussed in my upcoming book "Collision Detection in
Interactive 3D Environments" which will be published by Morgan-Kaufmann in
Q4 of this year.

> 2) I'm using GJK for collision detection and Brian Mirtich's
impulse-method
> to resolve colliding/resting contacts. I'm having trouble with objects
> sinking into each other. Apparently, the impulses aren't strong enough to
> prevent penetration. I've tweaked the restitution to fix this somewhat,
but
> it does not work for every case.
>

Impulses only change the linear and angular velocities of a rigid object.
Since an impulse may not completely cancel out the acceleration caused by
gravity due contact normals that are not exactly orthogonal to the contact
surface or other rounding errors, objects slowly drift into each other. This
cannot be resolved by impulses, since the relative velocity need to be kept
zero. The trick is to explicitly displace interpenetrating objects out of
each other. For multi-contact situations such as a pile of rocks it is wise
to use a relaxation technique for resolving overlap. By resolving the
overlap in a number of iterations, where each iteration only resolves part
of the overlap, the displacements do not shake up the configuration of
objects as much.

> 3) What do most people do when a collision occurs? Even when you
sub-divide
> the timestep to get the "exact" time of collision, it seems that you will
> slowly lose accuracy especially when objects are almost at resting
contact.
> I think this manifests in my sim when objects start sinking into the
> ground.
>
> 4) Can you really rely on single-point contacts and micro-collisions to
> resolve resting contacts. More importantly, can you do it in real-time
> without sub-dividing timesteps? Right now, I can get a ball to rest on a
> table, because there is only a single-point of contact for a sphere. But,
> when I try it with a cube, the cube ends up rotating into the table.
> Conceptually, when one corner hits, the other corners should immediately
> get impulses a _very_ short time later. But, like I said, my sim can't
> handle such minute changes, especially if I don't sub-divide the timestep.
> So, what ends up happening is that the cube is rotated into the table, in
> which case, GJK detects penetration, but it has no info about the new
> corner that hit.
>

The trick I used in Blender (now, sadly passed away) was to "collect" all
the impulses in a single time step as an iterative proces. The first
collision gives me a pair of contact points and a normal for which the
impulses are computed and applied. These impulses are applied not at the
time of collision but at the time frame before the collision. So the
positions and orientations of the objects are reset to the frame prior to
the collision and with the added impulses, the new positions and
orientations are found again by integrating the velocities. If a secondary
collision occurs, this process is repeated. In this way, the impulses are
applied to the corners of a resting box within the same time frame. This
solution works well for multi-contact situations, however, it is still hard
to get resting objects perfectly still. Resting objects need to be put to
sleep, at least partially. With "partially" I mean setting the inertia
tensor for angular momentum to infinity (setting the inverse of the tensor
to zero, since you only use the inverse of the inertia tensor in the impulse
computation). In this way, an object can no longer rotate, but it still can
translate, which is much easier to deal with in impulse-based simulations.


Gino


John Nagle

unread,
Apr 10, 2002, 2:28:23 PM4/10/02
to
Gino van den Bergen wrote:

> This
> solution works well for multi-contact situations, however, it is still hard
> to get resting objects perfectly still. Resting objects need to be put to
> sleep, at least partially. With "partially" I mean setting the inertia
> tensor for angular momentum to infinity (setting the inverse of the tensor
> to zero, since you only use the inverse of the inertia tensor in the impulse
> computation). In this way, an object can no longer rotate, but it still can
> translate, which is much easier to deal with in impulse-based simulations.


That's a hack, but it's a good hack.

John Nagle
Animats


Nemo

unread,
Apr 10, 2002, 2:35:25 PM4/10/02
to

Like Morfeas, I'm glad there are people actively interested/working with
physics. It's especially helpful when people like J.Nagle and Gino give
their input. Side note: I was able to understand GJK much better after
reading Gino's paper.

With all the suggestions on this thread, I will definitely try to fix the
errors I've been having. Recently, however, I am considering resolving
resting contacts by using constraint forces (ie Baraff's papers). Although
from initial research I thought a QP solver is needed, I found a solution
by Baraff that solves the problem directly instead of generalizing it to a
QP problem. It's supposed to be faster and much simpler to write. Also, it
resolves multiple contact points at once (whereas impulse-approach needs to
iterate). For these reasons, I'm going to try it, but I'm uncertain about a
few points.

1) If anyone knows, is a constraint-based approach practical for real-time
simulation. Since it solves the problem globally as opposed to locally like
impulse-approach, I have no clue as to what the performance would be.

2) You have to detect multiple contact points. As far as I know, both GJK
and Lin-Canny give you the closest points between two objects. As J.Nagle
pointed out in a thread, GJK can help you determine the contact surface
(and hence multiple contact points), but that involves finding
perpendicular faces to the contact normal, projecting them onto the contact
plane, and intersecting them. Now, is something like that practical for
realtime?

3) Is constraint-based approach overkill for realism in games? The impulse
approach, with the various hacks mentioned, does seem like the way to go.
This of course leads to the 4th question.

4) What level of sophistication in physics do games like Crazy Taxi, Grand
Theft Auto 3, Gran Turisimo, etc use. I know Crazi Taxi was sort of already
mentioned.

Again, thanks for any input.

Nemo

John Nagle

unread,
Apr 10, 2002, 3:12:32 PM4/10/02
to
Nemo wrote:


> 2) You have to detect multiple contact points. As far as I know, both GJK
> and Lin-Canny give you the closest points between two objects. As J.Nagle
> pointed out in a thread, GJK can help you determine the contact surface
> (and hence multiple contact points), but that involves finding
> perpendicular faces to the contact normal, projecting them onto the contact
> plane, and intersecting them. Now, is something like that practical for
> realtime?


It's a pain to write, but it's not a big consumer
of CPU time, because you're usually not examining that much data.

There are a few different ways to go at the problem,
but anything that only has single-point contacts
won't stabilize.


> 3) Is constraint-based approach overkill for realism in games? The impulse
> approach, with the various hacks mentioned, does seem like the way to go.


It depends on what you're doing. My real interest
is simulating walking and running, so I need a
good system that's reasonably close to correct
(say within 10%) and free of intermittent big
errors. Driving games also need good physics,
but the problem is specialized; the stuff you have
to get right is wheel vs. heightfield, and everything
else only has to be vaguely reasonable. If you're
just banging stuff around, impulses with position
adjustment hacks are probably good enough.

John Nagle
Animats


Morfeas

unread,
Apr 10, 2002, 7:15:06 PM4/10/02
to
Nemo wrote:

>
> their input. Side note: I was able to understand GJK much better after

Well, all you people writing about GJK made me curious and I've just
downloaded Gino's papers on it. I haven't spent too long on them, but I
already have a hard time understanding some concepts. Particularly I don't
understand what the 'configuration space obstacle' (CSO) is. I generally
understand things much better when I visualise the, and at the moment I
can't imagine what a CSO 'looks' like. Is it something like the overlap
area between the 2 objects? Can anyone share some info on this?

> errors I've been having. Recently, however, I am considering resolving
> resting contacts by using constraint forces (ie Baraff's papers). Although

When you say constraint forces, do you mean things like penalty functions?
For example, apply a force on both objects which is proportional to their
penetration, etc. I'm working on this from an engineering point of view
(i.e. for engineering simulations), so I'd be interested in comparing
results. At the moment I've got my program working quite nicely in terms of
accuracy and correctness, but I don't think it can do real time simulation
too well :(...well, unless you have less that 20 objects or so.

> from initial research I thought a QP solver is needed, I found a solution
> by Baraff that solves the problem directly instead of generalizing it to a
> QP problem. It's supposed to be faster and much simpler to write. Also, it
> resolves multiple contact points at once (whereas impulse-approach needs

Which paper is this? Is it the one with Dantzig's algorithm?

> 1) If anyone knows, is a constraint-based approach practical for real-time
> simulation. Since it solves the problem globally as opposed to locally
> like impulse-approach, I have no clue as to what the performance would be.

As I said I'm working on something like that. I'm not sure I understand what
you mean by globaly though. Do you mean for all the objects in the world at
the same time, or for the contacts in the same object at the same time?

Cheers,
Morfeas
--
www.freecfm.com/m/morfeas

Ruud van Gaal

unread,
Apr 11, 2002, 5:46:37 AM4/11/02
to
On Wed, 10 Apr 2002 18:35:25 GMT, Nemo <ne...@somewhere.earth> wrote:

...


>1) If anyone knows, is a constraint-based approach practical for real-time
>simulation. Since it solves the problem globally as opposed to locally like
>impulse-approach, I have no clue as to what the performance would be.

You may want to take a look at ODE, at www.q12.org. It uses constraint
forces to resolve collisions, has interpenetrating objects which get
resolved in multiple timesteps (so you can make materials a bit soft),
and is meant for use in realtime projects.
I use ODE in my racing sim, although in a simple way (not for the
suspensions or anything, just car vs. track triangles and in the
future for car-car and car-physical object).

It also has some collision detection routines, so for a cube vs plane
you get about 3 contact points (if not exactly 3 ;-) ).


Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/

Morfeas

unread,
Apr 11, 2002, 11:45:55 AM4/11/02
to
Ruud van Gaal wrote:

> I use ODE in my racing sim, although in a simple way (not for the
> suspensions or anything, just car vs. track triangles and in the
> future for car-car and car-physical object).

Am I right in thinking that ODE can do Sphere-Plane collision checks, but no
Sphere-Triangle checks? If that's the case, how do you check whether a
wheel is touching the terrain (represented as a triangle mesh (or mess in
my case))?

Another question, suppose you have a car on the terrain. How do you choose
which triangles to check for collision against the wheel at each time step?

In my case, the terrain is made of triangles at fixed spacings. The whole
car has a bounding sphere. At each time step I check against those
triangles that are underneath the sphere. Are there any better ways? What
about when the terrain is not made of fixed spaced triangles?

Cheers,
Morfeas

--
www.freecfm.com/m/morfeas

Piercarlo Grandi

unread,
Apr 12, 2002, 6:18:25 PM4/12/02
to
>>> On Sun, 07 Apr 2002 23:55:24 GMT, Nemo <ne...@somewhere.earth> said:

nemo> Hi, I have a few questions about physics simulators:
nemo> 1) Do most sims use double-precision?

I doubt anybody knows about ``most sims'', but broadly speaking if you
are doing real simulation on something like Alpha/SGI you go for double
precision, but for games I think that double precision is unthinkable.

nemo> Can you get by with single-precision if you care mostly about
nemo> it "looking right", or will stability go haywire. [ ... ]

A good understanding of numerical analysis and speed/fidelity tradeoffs
is required, but it is possible to get it right. Unfortunately numerical
analysis is hard work and some game programmers are in the industry
because they think it is cool fun (hahahahahahaha! :->).

Erwin Coumans

unread,
Apr 13, 2002, 4:26:15 PM4/13/02
to
the following link can be interesting (GJK/Impulse/Penalty):

The Physics That Brought Cel Damage To Life: A Case Study David Wu, 2002
http://www.pseudointeractive.com/games/CelDamagePhysics.ppt

a link on the Linear Complementarity Problem (LCP / Mathematics):
In case you are interested in a more mathematical approach

Linear Complementarity Online book
http://ioe.engin.umich.edu/books/murty/linear_complementarity_webbook/

Erwin Coumans

Dave Eberle

unread,
Apr 28, 2002, 12:44:08 PM4/28/02
to
Hi Erwin,

Thanks for the LCP link. Do you think it is still wise to purchase Cottle
and Pangs LCP book with this being available?

Dave


"Erwin Coumans" <er...@havok.com> wrote in message
news:d95d385b.02041...@posting.google.com...

0 new messages