Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

# Thread: Simple dynamic-static circle collision response

1. ## Simple dynamic-static circle collision response

Hellooooo! I have spent an endless amount of time this weekend trying to figure out simple physics for a pong-ish game I'm work on in which the paddles are circles rather than lines. I am having a hard time finding a well explained way to bounce the ball of of the circular paddles realistically. Most tutorials are for dynamic-dynamic collisions and I find them hard to understand and thus manipulate it to how I need it to work. I understand conservation of energy and stuff, the problem is the angles and figuring out the x+y velocities after. If someone could give me some guidance and perhaps a code snippet / an equation I could use it would be greatly appreciated!

Just need a way to get the final x+y velocities after the collision with the paddle ^^ thnx ahead of time

2. ## Re: Simple dynamic-static circle collision response

Pseudo-code:
Assuming the paddle isn't moving (or at least its movement doesn't affect the solution)

1. Compute the normal at the point of contact (simple, for a circle it's the line from the center of the circle to the collision point)
2. Reflect the balls velocity around that line. See: Coordinate rotations and reflections - Wikipedia, the free encyclopedia for a 2D transform matrix that will do this for you.

3. ## Re: Simple dynamic-static circle collision response

Ok well I didn't understand any of that :\$ aha I did find out however that R = 2W - P for reflecting off of an angled wall which is essentially what I'm doing. I'm however not mathematically smart enough to manipulate that to give me a vector after... HELPS

4. ## Re: Simple dynamic-static circle collision response

Why don't you just get the delta X and delta Y from the center of the circle and use those?