#### Archived

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

# Fully elastic collision using Verlet integration

This topic is 5273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Shortly, is subj possible to do? I tried to implement rigid body simulation using Verlet (almost exactly followed 'Hitman' article - http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm). The only change I made was about collision response: afetr finding a collision, I updated both current and previous positions of the particle. v1:=vConstMult(-dist,normals); // how far we should push the verticle out v:=vMinus(p.vPos,p.vPrevPos); vrn:=vDotProduct(v,normals[i]); vn:=vConstMult(vrn,normals[i]); // - normal component of velocity p.vPrevPos:=vPlus(p.vPos,v1); // updating previous position p.vPos:=vPlus(p.vPrevPos,vMinus(vMinus(v,vn),vConstMult(1,vn))); // and current position (cofficent of restitution = 1) The problem is, when restoring distances between points right after collision, the velocity drops significantly, and impact is no longer elastic; Looks like principal trouble to me, but maybe there is a way to do it? thnx in advance [edited by - aash29 on June 8, 2004 8:14:13 AM] [edited by - aash29 on June 8, 2004 8:15:01 AM]

##### Share on other sites
Shouldn''t
n.vPos = p.vPos + vn;
and
n.vPrevPos = p.vPos - (v + vn);
where n is your next pos,prev_pos pair?

##### Share on other sites
quote:
Original post by sjelkjd
Shouldn''t
n.vPos = p.vPos + vn;
and
n.vPrevPos = p.vPos - (v + vn);
where n is your next pos,prev_pos pair?

n.vPos = p.vPos + vn
obviously gets my particle even further in the wall

1. 1
Rutin
22
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633308
• Total Posts
3011294
• ### Who's Online (See full list)

There are no registered users currently online

×