Collision Detection in 2D Motion

Click For Summary

Discussion Overview

The discussion revolves around implementing collision detection in a numerical simulation of a 2D motion scenario, specifically focusing on an object being thrown off a building and its interaction with the ground upon impact. The conversation includes considerations of the object's shape, elasticity, and the nature of the collision.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant seeks guidance on the equations needed for collision detection and the subsequent calculations of time, velocity, and position.
  • Another participant questions the shape of the object and the ground, the object's spinning, and whether the interest lies solely in the moment of impact or the aftermath of the collision.
  • A participant clarifies that the object is a ball with elasticity, which is expected to bounce upon impact with a flat, stationary ground.
  • One suggestion involves simulating with a constant step size and applying specific equations for acceleration, velocity, and position updates, including conditions for handling the collision.
  • Another participant proposes a simpler approach for perfectly elastic collisions, suggesting that the velocity vector component normal to the collision surface can be inverted if the object is hitting a massive surface.

Areas of Agreement / Disagreement

Participants express differing views on the complexity of the simulation and the methods for handling collision detection, indicating that multiple competing approaches remain without a consensus on the best method.

Contextual Notes

Participants have not fully defined the assumptions regarding the collision's nature, such as the degree of elasticity and the impact of rotational energy, which may affect the simulation's accuracy.

Who May Find This Useful

This discussion may be useful for individuals interested in numerical simulations, physics of motion, and collision detection algorithms in 2D environments.

kachilous
Messages
15
Reaction score
0
I have created a very simple numerical simulation that models an object being thrown off a building at some angle, and when the object hits the ground, the simulation stops. Now I want to add in collision detection. How would I go about doing this? What would be the equations needed to compute the new values of time, velocity and position?
 
Physics news on Phys.org
What's the shape of the object and the ground? Is the object spinning? Are you interested in just the moment of impact, or you want to know what happens afterward?

If you want to know what happens afterward, you need to make some assumptions about the elasticity, how it deforms, and how much rotational energy is transferred to the ground.
 
It is a ball that has elasticity. I expect the ball to bounce upon impact with the ground. The ground is a flat surface that is stationary
 
It depends on how thorough you want to be. The easiest thing to do is just simulate with a constant step size, and do something like
a_y(t+dt) = a_y(t) - g*dt
v_y(t+dt) = v_y(t) + a_y(t)
y(t+dt) = y(t) + v(t)
if y(t) < 0, then {
y(t+dt) = 0
v_y(t+dt) = -elasticity*v_y(t)
v_x(t+dt) = damping*v_x(t)
}

Of course, you didn't say how detailed your simulation is.
 
No, there's something even easier. If the collision is perfectly elastic (which is very close to true for bouncy balls), and the thing it is hitting is very massive (like the ground or a wall), then you just flip the direction of the velocity vector component that is normal to the surface of collision.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K