# Collision Response Multiple Planes. (Corners)

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

## Recommended Posts

Every strategy i implement for my CollisionDetection/CollisionResponse Seems to have a bug somewhere, now i have started from scratch. This is what i have. i have direction vector (where the player want to go) If intersection occurs with a plane, i add my direction vector with the planes normal to always push the player from the plane and becuase of this the player is sliding nice against the plane. When approaching a convex corner this works, but not when sliding to a corner this isn´t working. So then i created a method where my input was my direction and then as result it gave me all the planes that had length < 0. when "pushing the player with normal vector" this problem is solved. BUT, when i stand in a corner that has an angle, lets say 100 degrees, this corner isn´t very steep and if i stand exactly in the middle of these two planes and move the player forward it all begins to shake because my method only finds one plane at the time. I really like the strategy of pushing the player back with planes normal because then the planes becomes more entities and are not dependent on any other planes etc. I have also tried ClosestPointOnPlanes and get this vectors also by inputting my direction Vector to get the closestPoint on my planes from where i want to travel and then slide from my current Position to the ClosestPointOnPlane by my direction vector. Problem here comes when i approach a convex corner, then my direction vector can´t get a good slide vector. If i check if angle(this case Dot Product) against plane < 0 then i am not facing and should release player. But this gives me a buggy exit from the plane and i want 100% perfection. Finnaly, my question. How do you solve if you are placed between two planes (this case lineSegment) where the angle is rather big, how do you find the closest plane? do you only use the direction where you want to go or is there anything else? Im getting pretty sick of this collision response always edning up not working on just 10%. Help

##### Share on other sites
Quote:
 Original post by MeshboyEvery strategy i implement for my CollisionDetection/CollisionResponse Seems to have a bug somewhere, now i have started from scratch. This is what i have....Im getting pretty sick of this collision response always edning up not working on just 10%.

Well, that the biggest problem with selfmade physics :) I gave up after 5 years :P Once it starts to look good, it failed sometime later when the object falled through the world once again :/

Instead of being frustrated all the time I started to use a physic lib, that was my rescue. There are a lot of free physics libs available:
- PhysX (commercial engine, but free for non-commercial software ?)
- Newton
- Bullet (used by Blender Game Engine)
- ODE

I have good experiences with Bullet and Newton(using bullet now).

--
Ashaman

##### Share on other sites
you should not add the normal of the plane to the velocity, you should use this formula to slide on a plane / corner.

m_velocity -= (m_velocity.dotProduct(m_normal)) * m_normal;

what you can also try is to compute the normal of the corner betweteen the two planes, and use that for your collision normal.

1. 1
2. 2
3. 3
Rutin
12
4. 4
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633696
• Total Posts
3013387
×