| 290 | } |
| 291 | |
| 292 | void xRayHitsBound(const xRay3* r, const xBound* b, xCollis* c) |
| 293 | { |
| 294 | xIsect isect; |
| 295 | |
| 296 | if (b->type == XBOUND_TYPE_SPHERE) |
| 297 | { |
| 298 | iSphereIsectRay(&b->sph, r, &isect); |
| 299 | } |
| 300 | else if (b->type == XBOUND_TYPE_OBB) |
| 301 | { |
| 302 | xBoundOBBIsectRay(&b->box.box, b->mat, r, &isect); |
| 303 | } |
| 304 | else if (b->type == XBOUND_TYPE_BOX) |
| 305 | { |
| 306 | iBoxIsectRay(&b->box.box, r, &isect); |
| 307 | } |
| 308 | |
| 309 | if (isect.penned <= 0.0f) |
| 310 | { |
| 311 | c->flags |= 0x1; |
| 312 | c->dist = isect.dist; |
| 313 | } |
| 314 | else |
| 315 | { |
| 316 | c->flags &= ~0x1; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | void xSphereHitsBound(const xSphere* o, const xBound* b, xCollis* c) |
| 321 | { |
no test coverage detected