Archived

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

BadFinger66

collision question

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
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