Archived

This topic is now archived and is closed to further replies.

collision detection wall sliding and other qs.

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

how do you slide against a wall if you collide with it at an angle? do i just make the velocity vector perpendicular to the wall vector?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
here is how i do it

say , you are moving a dot around at px,py , angle

you have just colided w/ the wall

void blafunct(void)
{
float, px=something,py=something else,angle=an angle;
float tempx,tempy;


tempx=px;
tempy=py;


tempx+=cos(angle);
tempy+=cos(angle);

if( px,tempy has not collided with wall)py=tempy;

if(tempx,py has not collided with wall)px=tempx;
}

put this in your loop

see if this works

-Infested Furby

infestedfurby.cjb.net





Share this post


Link to post
Share on other sites