Jump to content
  • Advertisement

Archived

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

DeadlyPencil

flipping a vector over another

This topic is 5173 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

so what i have is 2 objects. one is stationary other is moving and colliding with that object. i have the normal of the face on the stationary object which the first object collided with, and i have the motion vector of the moving object. what i want to do is reverse my motion vector and flip it over the collision normal, which would cuse it to reflect. right? so how would i go about doing this...

Share this post


Link to post
Share on other sites
Advertisement
If you want to reflect a vector off a surface:

R = V - 2*(V.N) * N;

Where V is the vector, N is the surface normal and ''.'' is the dot product. Hope this helps...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!