| 375 | namespace |
| 376 | { |
| 377 | F32 get_lower_extent(const xBound& bound) |
| 378 | { |
| 379 | switch (bound.type) |
| 380 | { |
| 381 | case XBOUND_TYPE_SPHERE: |
| 382 | { |
| 383 | return bound.sph.r; |
| 384 | } |
| 385 | case XBOUND_TYPE_BOX: |
| 386 | { |
| 387 | return bound.box.center.y - bound.box.box.lower.y; |
| 388 | } |
| 389 | case XBOUND_TYPE_OBB: |
| 390 | { |
| 391 | if (0.0f == bound.mat->up.x && 0.0f == bound.mat->up.z) |
| 392 | { |
| 393 | return bound.box.center.y - |
| 394 | (bound.mat->up.y * bound.box.box.lower.y + bound.mat->pos.y); |
| 395 | } |
| 396 | else |
| 397 | { |
| 398 | xBox box; |
| 399 | xBoundGetBox(box, bound); |
| 400 | |
| 401 | return bound.box.center.y - box.lower.y; |
| 402 | } |
| 403 | } |
| 404 | case XBOUND_TYPE_CYL: |
| 405 | default: |
| 406 | { |
| 407 | return 0.0f; |
| 408 | } |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | bool collide_downward(xVec3& loc, xEnt*& hit, xScene& s, xEnt& ent, F32 max_dist) |
| 413 | { |
no test coverage detected