Jump to content
  • Advertisement

Archived

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

BadFinger66

collision question

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

Hi all, I''ve been having some collsion detection problems. I have a character mesh in 3rd person view. Using a ray I detect cube(mesh) object in my environment to check for collision. I''ve been using the following code if(nodeTree->CheckIntersect(character.position.x,1,character.position.z,character.position.x+xVel,1,character.position.z+zVel,NULL)) { zVel=-zVel; xVel=-xVel; collision=true; } Should I be doing a bounding sphere collision check for for world objects, such as a box,or is the ray fine this. Thanks

Share this post


Link to post
Share on other sites
Advertisement
i dont think the ray is enough. you need to know how how far away the objects are from each other. thats the basis of boundings spheres. if the distance between the two objects is less than either radius then a collision occured. hope that helps

Share this post


Link to post
Share on other sites
quote:
Original post by Syrillix
i dont think the ray is enough. you need to know how how far away the objects are from each other. thats the basis of boundings spheres. if the distance between the two objects is less than either radius then a collision occured. hope that helps




Ok sounds good. Thanks!

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.

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!