[ODE] Naive newbie questions
Martin C. Martin
martin at metahuman.org
Thu Aug 21 19:58:01 2003
> Last night I was pondering writing my own physics engine for a project
> of mine, but discovered ODE.
If you want to learn about how to simulate physics, and get an
appreciation for all the things that can go wrong when you go about it
naively, then trying to write your own is a good way to go. You'll have a
lot of context later, when you look at existing physics engines. You'll
be better able to understand what they do and why.
> imaginable. Initially I'm interested in basic collision detection,
> force and gravity. I'll probably create object primitives for
> cylinders, spheres, etc. and MUD objects will be groupings of those
> (I.e. I'll probably just model most humanoids as cylinders.) Is it
> possible to use ODE in this capacity? Could I define objects only as
> shapes, vehicles as boxes, humanoids as cylinders, and simply apply
> forces to them without necessarily, say, modeling the engine of a tank
> or the leg of a troll?
Yes, although controlling them to do what you want may be harder than you
expect.
> ODE uses the concept of a world, with gravity. Does ODE
> model gravitational attraction with sufficiently large objects? Could
> my "world" then be a 0-gravity universe, with the perceptual world
> being a large sphere with a given mass and radius?
ODE's world is what you're calling the universe. It's easy enough to put
in gravitational attraction between objects, but keep in mind, ODE won't
conserve quantities. So, your planets with either slowly spiral in to the
sun, or slowly spiral out.
Also keep in mind, when two objects collide, you don't want their masses
to differ by more than about an order of magnitude.
Basically, ODE is the wrong tool for simulating planetary orbits. ODE's
strength is impulsive physics that comes from collisions. The easiest,
most stable, most reliable way to do the planetary simulation you're
talking about is to just pick the shape of the orbit and set each planets
position every time step.
- Martin
#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################