Archived

This topic is now archived and is closed to further replies.

superpig

Good idea?

Recommended Posts

Hey, all. I''m going to need a physics system for my current project, so I''ve been thinking about what to do. I looked at ODE and Tokamak as possible solutions, but they (a) only handle rigid bodies, and (b) aren''t terribly cross-platform (well, Tokamak isn''t at all, and ODE required me to download the GNU tools to build it when I have a perfectly good set of MSVC tools on my machine already). I want to be able to handle ''deforming'' volumes, not least because my game is cartoony and the main character will squash/stretch on impact; but also because I want to be able to do things like crush models. All of it needs to be linked into a skeletal animation system. So here''s what I''ve come up with. If you could read through and give me comments, suggestions, or possible problems, then I''ll appreciate that very much. A set of ''bounding volumes'' are created for each model, each volume being an ellipsoid or a cuboid. They are joined together with spring-dampers in such a way that each spring-damper corresponds to one bone in the skeleton of the model (in fact, the spring-damper will *be* the bone). By adjusting the rigidity of the spring-dampers, I can adjust how ''stiff'' my model is. When a collision occurs with a bounding volume and something else (not part of the model - say, the world), then an impulse force ''object'' (essentially just a vector) is created and added to a list of forces acting on that volume, this frame. (The delta-time will be the same for all of them, so there''s no need to store the length of time the impulse is applied for). Once all collisions have been tested for and all impulse forces have been given to the volume they act upon, then the model is processed. Each bounding volume is responsible for handling the forces applied to it - this means that a deforming volume could squish or stretch when detecting two opposing forces, while a non-deforming volume can just add the forces and pass them to it''s connected objects. So forces acting on a volume propagate through the model, staying as forces - a volume passing a force to another one (via a spring) is just the same as that second volume recieving a force from the environment. Each step, not *all* forces will have been processed (as processing one force usually creates others). However, the lists are not cleared between frames, so the model will react iteratively to the collision. How does that sound? I reckon it''s a standard rag-doll system, with the ability to deform volumes where needed, but I''m not a game physicist so I have no idea if that''s how a rag-doll system works or not. Superpig - saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by superpig
...they (a) only handle rigid bodies, and (b) aren''t terribly cross-platform (well, Tokamak isn''t at all, and ODE required me to download the GNU tools to build it when I have a perfectly good set of MSVC tools on my machine already).


Well, the GNU tools are cross platform, MSVC is not.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Well, the GNU tools are cross platform, MSVC is not.


True, but when I said ''platform'' I meant to include ''cross-compiler'' as well as ''cross-CPU'' and ''cross-architecture.''

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4

Share this post


Link to post
Share on other sites