Skip to main content
gamedev.net
🔒 Locked

collision response

Started by ichor Mar 3, 2004 at 5:59 PM 0 replies 350+ views
Original Post
ichor
ichor
Hey all, I''m wondering if there''s a generic formula for a collision response to glide/strafe along a wall that it has collided with...or something similiar. I checked in my 3D Math book for collisions, and it says how to detect, but not what to do afterwards. Basically, when I hit a wall, I want the user to keep moving -- be it gliding down the wall in the closest alternate direction they were facing, or rotating the camera to the closest other direction they were facing... I think my main question is...how do you tell which direction to rotate/move? My Camera/Player has a Position and View vectors, but in my trial-and-error (do something and see what happens) pulling coords from those Vectors haven''t been helpful at all. What am I missing here? Right now, on a collision, I rotate to the left -- simply because I''m not sure how to detect if it should rotate to the right instead. Thanks!
fhqwhgads
fhqwhgads
IIRC, if you take the sine of the angle between the position vector and the normal of the polygon that should give you the new position vector. Something like that.

Also IIRC, If the angle between the normal and the position vector is positive then they''re facing to the right, with negative eing to the left.

If this doesn''t make sense, then it''s because I haven''t done this kind of stuff in nearing 8 years. x.X

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.