[ODE] Particles

Simon Barratt Barog at pineapple-interactive.com
Tue Sep 21 13:39:20 MST 2004


What you are probably after is a geom which represents all the particles
in his particle system. This geom can store the position, velocity, mass
etc of his particles and can be stepped outside of the ODE Step
function. So possibly inside the collide functions for the
particlesystem vs (box, mesh etc) the collision impulses are applied
directly to the velocitys of the particles which hit the other geom.
Then once the collisions are all done the particle system can be ticked
and you'll have your particles bouncing off other geoms. 

You'll probably want a sphere or some other larger object around the
particles (and their previous positions) in the system so you can do a
quick reject check with the geom being tested against rather than going
through each particle, you may also want to have a hierarchy of these
larger representations if you have 1000's of particles you need to
check. To do the actual checks you'll probably want to use the stored
velocity from last frame (in case the current velocity was changed in a
previous collide check this frame) and make a swept sphere (capped
cylinder/capsule) or ray check.

Hope some of that helps, it doesn't really fit in TOO well but it's a
working system.
Good luck.

--
Simon Barratt, Lead Developer, Pineapple Interactive Ltd
e: barog at pineapple-interactive.com
w: www.pineapple-interactive.com
t: +44 (0)1274 480185

-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org] On Behalf Of Gary
R. Van Sickle
Sent: 21 September 2004 03:42
To: ode at q12.org
Subject: RE: [ODE] Particles

> What is a particle? If it's for a particle system, then you probably 
> want to have some extent to the particles. At that point, a sphere 
> with an appropriately small radius is the best way to do it.
> 
> Actually, the difference in math between particle and sphere is so 
> small that using spheres with millimeter radius should be fine, even 
> if you want "point" particles.

Well, a particle doesn't have angular momentum, so there's actually a
pretty big difference.  While what you suggest could probably be made to
work, I'd just roll my own.  Then again, if you want them to actually
interact with the other bodies....

--
Gary R. Van Sickle


_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode







More information about the ODE mailing list