Game Development Reference
In-Depth Information
//Find component with greatest magnitude
tmp.x = a.x*a.x;
tmp.y = a.y*a.y;
tmp.z = a.z*a.z;
if (tmp.x > tmp.y){
if (tmp.x>tmp.z){
if (a.x>0){
//Hit on right of bounding box
...
}else{
//Hit on left of bounding box
...
}
}else{
if (a.z>0){
//Hit on front of bounding box
...
}else{
//Hit on rear of bounding box
...
}
}
}else{
if (tmp.y>tmp.z){
if (a.y>0){
//Hit on top of bounding box
...
}else{
//Hit on base of bounding box
...
}
}else{
if (a.z>0){
//Hit on front of bounding box
...
}else{
//Hit on rear of bounding box
...
}
}
}
Search Nedrilad ::




Custom Search