Skip to main content
gamedev.net
🔒 Locked

collision question

Started by BadFinger66 May 7, 2003 at 1:15 AM 1 replies 350+ views
Original Post
BadFinger66
BadFinger66
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
Syrillix
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
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
BadFinger75
BadFinger75
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!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.