Collision Detection in 2D Motion

In summary, the conversation discusses adding collision detection to a numerical simulation of an object being thrown off a building. The object is assumed to be a ball with elasticity and the ground is a flat surface. The equations needed to compute the new values of time, velocity, and position involve making assumptions about the elasticity and rotational energy transferred to the ground. Different methods are suggested, with the simplest being to simulate with a constant step size and adjusting the values of acceleration, velocity, and position upon impact.
  • #1
kachilous
15
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
  • #2
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.
 
  • #3
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
 
  • #4
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.
 
  • #5
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.
 

1. What is collision detection in 2D motion?

Collision detection in 2D motion is a method used in computer graphics and physics simulations to determine when two objects have come into contact with each other. It is commonly used in video games to detect when a player's character has collided with an obstacle or another character.

2. How does collision detection work in 2D motion?

In 2D motion, collision detection involves checking the positions and sizes of two objects to see if they overlap or intersect. This can be done using mathematical algorithms such as separating axis theorem or bounding box collision detection. If an overlap is detected, it means a collision has occurred.

3. What are the benefits of using collision detection in 2D motion?

Collision detection in 2D motion allows for more realistic and interactive simulations. It can also improve gameplay by providing a more immersive experience for players. Additionally, it can be used for physics-based calculations, such as calculating the trajectory of a bouncing ball.

4. What are some challenges with implementing collision detection in 2D motion?

One of the main challenges with collision detection in 2D motion is accurately detecting collisions between irregularly shaped objects. This requires more complex algorithms and can be computationally expensive. Additionally, detecting collisions between fast-moving objects can also be challenging.

5. Are there any limitations to collision detection in 2D motion?

Yes, there are some limitations to collision detection in 2D motion. For example, it can only detect collisions between objects that are already present in the simulation. If an object is added or removed during the simulation, collision detection may not be able to accurately detect it. Additionally, collision detection may not be suitable for very complex or detailed simulations, as it can be resource-intensive.

Similar threads

  • Mechanics
Replies
9
Views
1K
Replies
14
Views
1K
Replies
9
Views
832
Replies
4
Views
1K
Replies
14
Views
1K
Replies
2
Views
1K
Replies
7
Views
775
  • Classical Physics
Replies
13
Views
2K
Replies
2
Views
1K
Back
Top