Slick Forums

Discuss the Slick 2D Library
It is currently Sat May 25, 2013 3:19 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: bouncing
PostPosted: Fri Aug 10, 2007 10:16 pm 
Offline

Joined: Mon Nov 13, 2006 3:06 pm
Posts: 42
Location: Argentina
I'm doing a game where ball collides, but I don't want them to collide as if they where solid pool balls, I want them to absorb some of the collision force (as if the balls somehow intersected) and then bounce back.

I'm not interested in simulating the ball deformation, just the kinetics

Think about 2 baloons that collide, in the exact moment they touch each other they don't bounce, they continue colliding into each other a little bit (deforming themselves) and then start going back

How would you approach this?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 11, 2007 11:16 am 
Offline
Regular

Joined: Tue Jun 19, 2007 7:35 am
Posts: 233
Location: Germany
hi,
i think it's like the pool ball physic stuff, but with damping values. when pool balls collide their movement directions are reflected (more or less, normal calculation and so on) in one frame / update. if you use a damping mechanism, the collision response should be much more soften.

_________________
Embero Games | Astroiz | ConK | From Outa Space


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 11, 2007 12:25 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Think you could use the restitution to configure this.

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 10:01 pm 
Offline

Joined: Mon Nov 13, 2006 3:06 pm
Posts: 42
Location: Argentina
AFAIK damping is the "air friction" and restitution is how much energy is transferred to the other body

I solved it by creating a BouncingJoint, it's the exact opposite of a ConstrainingJoint. When the 2 bodies are close enough, a SpringJoint is created between them and the start pushing each other apart... I'm tweaking it right now but it does the trick

kev if you want I can send you the code


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group