Advertisement

Verlet and Rigid Bodies

Started by December 16, 2002 08:16 AM
8 comments, last by Mark Duffill 22 years, 1 month ago
Quick Overview: I have a car represented by 4 particles roughly where you would expect the wheels to be. They are constrained as follows
  
    front of car
     *------*     
     |\    /| 
     |  \/  |
     |  /\  |
     |/    \|
     *------*    top down view
  
I use a sphere around each particle to collide with the world, apply constraints and it works nicely. You can flip the car on a slope etc. Problem: I''m aware you can simulate rigid bodies (RB) using particles and constrains, usually using a tetrahdrion[sic?!] sitting "inside" the RB. However force mapping an impact/impulse from the collision geometry to the particles is where I''m falling down. documentation I''ve found on verlet integration->RB seems to brush over this quickly with out much explenation. So any suggestions are welcome! ps: I had though of making a skew matrix from the impact, and then applying this to the particles, but the whole idea of Verlet paricles is that you don''t rotate anything, just translate a particle and the rotation is a result from this. Thanks.
I remember trying this a couple of years ago, and I think I had the same problem as you (if I understood you correctly).

I had box shapes with the particles sitting inside in the tetrahedron shape.

The problem was the following:

- applying a force to an arbitrary point in the box results in a force and a torque to that box
- because we model the box as four particles we need to find forces that can be applied to those particles that when added together will result in the same box force and box torque

After some calculations and some test cases I arrived to the conclusion that it couldn''t be done.
Of course, I could be wrong, and I can''t actually remember the full details of the calculations.
Advertisement
Thanks, if i figure it out i''ll let you know.
quote:
Original post by Mark Duffill
Thanks, if i figure it out i''ll let you know.


It can be done: convert your particles to rigid body form. Compute linear and angular momentum. Apply force-torque pair as you would with a simple rigid body system. Compute inertia tensor. Update linear and angular momentum. Compute linear and angular velocity. Update particles using a linear delta and angular delta (based on your Verlet fixed dt).

Another less accurate method is to use barycentric tetrahedrally weighted force updates on the particles (same concept as arbitrary particle updates for a tetrahedral Verlet system).

John Schultz
Brightland
www.brightland.com
Thanks for the info. I though I''d might have to go down that route.

Well, I thought the whole idea of representing a rigid body by particles was so you can avoid the whole angular side of calculations.

If you go down the route of simulating a full rigid body, then you already have the rigid body and you don''t need the particles to simulate it!

There must be a way to do it.

I was thinking about it and as we have four unknowns, then if we can find four equations that relate them then we should be able to solve it.

I can think of two equations:

- the linear force applied to the body equals the sum of the linear forces of all the particles

F = Fa + Fb + Fc + Fd

- the torque applied to the body equals the sum of all the torques generated by the forces on the particles

T = (ra x Fa) + (rb x Fb) + (rc x Fc) + (rd x Fd)

Vector ra is the vector that goes from the center of the body the the particle a, and x denotes cross product.

Two more equations and we should be able to solve the system.

Any ideas?
Advertisement
It''s not as easy as you think. Take a look at this article "All you need is force"..

http://www.win.tue.nl/dynamo/publications/aynif.pdf

But the idea is in the right direction.
--bart
quote:
Original post by lusinho

Well, I thought the whole idea of representing a rigid body by particles was so you can avoid the whole angular side of calculations.

If you go down the route of simulating a full rigid body, then you already have the rigid body and you don''t need the particles to simulate it!

There must be a way to do it.

I was thinking about it and as we have four unknowns, then if we can find four equations that relate them then we should be able to solve it.

I can think of two equations:

- the linear force applied to the body equals the sum of the linear forces of all the particles

F = Fa + Fb + Fc + Fd

- the torque applied to the body equals the sum of all the torques generated by the forces on the particles

T = (ra x Fa) + (rb x Fb) + (rc x Fc) + (rd x Fd)

Vector ra is the vector that goes from the center of the body the the particle a, and x denotes cross product.

Two more equations and we should be able to solve the system.

Any ideas?


Converting particles to Rigid Body form is relatively easy and fast. The advantage of using particles buys you easier collision handling and generalized constraints.


John Schultz
Brightland
www.brightland.com
Thanks for all the help guys. When I feel better I''ll give these ideas a go.

Why not just temporarily add a new particle to your tetrahedron at the collision point? You would also have to create some additional distance constraints to nearby particles.

*--*
|\ |
| \|
| * <-- collision point
| /|
|/ |
*--*

Once the collision has been resolved, you can then remove the additional particle. I don''t really know if this will work, but I intend to try it for a game I''m developing (that will hopefully support deformable objects)

Chris "What''s my Gamedev Password" Dion

This topic is closed to new replies.

Advertisement