   Bounding box, colission functions in D3D
  hello! duno if this is the right forum to ask this whit but i gona give it a try.it aint world politics.first of all im trying to build my own Bounding box function.the whole code of it is beeing this at the moment :if(obj1.x > obj2.x && obj1.x < obj2.x + obj2.w){//Colission.}if(obj1.y > obj2.y && obj1.y < obj2.y + obj2.h){//Collission.}the thing is thes code dose not work ( only tryd it in flash but the math if shuldstill be the same and the princip.)another question. is there som built in function for colission?i think its calld a Ray or somthing, but as i said am asking buckus i dont know!so if any one konw if there is such a function pleas inklude a link of a tutorial or a tutorial source kode. or just the funtion whit komments.cheers!   
Quote:Original post by snoddas14hello! duno if this is the right forum to ask this whit but i gona give it a try.it aint world politics.Provided any implementation doesn't stray into the Axis of Evil Aligned Bounding Box then we can leave world politics at the door. Seriously though, this does suit 'Maths & Physics' more than DirectX. There are a few D3DX methods for intersection tests and related vector/plane operations, but they're not really designed for collision detection.I've moved this thread for you.Jack   ;  The code you shows seems like the conditions are ORed together, but for a collision to take place all 3 (or 2, in 2D) conditions must be met.Something like this:if(obj1.x > obj2.x && obj1.x < obj2.x + obj2.w&& obj1.y > obj2.y && obj1.y < obj2.y + obj2.h){  //Collision.}