Advertisement Jump to content

Archived

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

aash29

Fully elastic collision using Verlet integration

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

If you intended to correct an error in the post then please contact us.

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 this post


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

Share this post


Link to post
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?


thanks for reply, but
n.vPos = p.vPos + vn
obviously gets my particle even further in the wall



Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!