# Collision Sliding Problem

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

## Recommended Posts

[DISREGARD] I was doing something wrong so the question is invalid.

Hi guys, I'm in the process of adding sliding to my collision response and in the articles I've read they don't mention something.

Let's say I'm doing a sphere-wall collision, the sphere (player) moves due north and the wall's normal points due south, when the sphere hits there will be no sliding vector since the velocity and normal are complete opposites, that's fine if the guy stops moving, but if he keeps heading directly into the wall I will keep getting collisions at time zero and nothing else will happen. Even if I detect it it will cause problems if the guy keeps heading almost directly into the wall, the sliding vector will be so small that I'll keep getting collisions at such an early time resulting in the same effect.

I'm basically finding the first collision, moving all the objects, then looping until the time in the frame runs out.

Maybe I have it all wrong ?

Thanks.

##### Share on other sites

There are several different ways of doing all of this. From what I've read it seems to be common to move the objects, detect a collision then solve the intersection by moving it along a vector make the objects not intersect anymore and then apply some force/impulse to make it bounce (if that's what you want, otherwise just move them apart).

The first circle to the left might be where the intersection is detected and the red vector is the direction it has been moving. Then moving it along the normal of the surface (green vector) it would appear sliding along this plane. This might be sufficient for your application.

EDIT: Just realized the image is a bit misleading. The image implies the sphere that is intersecting the plane still is moving along the red vector but my point is that it has moved along its entire vector and should only be moved "up" along the plane's normal. But the red vector is the direction it has already moved (to get to its current position). Sorry, this is perhaps quite confusing. If you have any questions about this, please ask.

Edited by hannesnisula

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 10
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632983
• Total Posts
3009707
• ### Who's Online (See full list)

There are no registered users currently online

×