Jump to content
  • Advertisement
Sign in to follow this  
fguihen

after collision( how to calculate my next move)

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

im having a terrible time dealing with what to do after collisions. heres the current suituation. i have a bounding sphere around my charachter. i have an AABB around each wall. i am using this line to move my charachter along the x axis :
device.Transform.World = Matrix.Translation(transV);
transV is a vector, the x value of which is simple incremented each frame.this line is in thte Draw() method of my charachter class.i have a strong feeling that translating the world matrix by a vector is very wrong but im not sure what else to do. now, i can detect when a collision has occoured, but how to do anything after this is causing great problems. to begin with i would like to make the charachter simply turn until it is not colliding with the wall, and then go ahead in a straight line until it hits another wall, and do the same. when i hit the wall, i have the center of my bounding sphere, the maxPoints and minPoints of the bounding box.how do i work with theese to allow my charachter to turn when colided with and continue moving when no longer coliding? what im really asking, is how do i create a vector or a matrix that changes the direction after a collision? i know i have posted on this a few hours ago, but i dont think the question was very well put and i think its phrased better here.

Share this post


Link to post
Share on other sites
Advertisement
This isn't a full solution but it's best not to turn until not colliding, but to back up (ie trace backwards down the direction of motion) until not colliding. After that, decide how to move again.

Mark
Sound Effects For Game Developers
http://www.indiesfx.co.uk

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!