| 355 | } |
| 356 | |
| 357 | Vec3 OBB::getEdgeDirection(int index) const |
| 358 | { |
| 359 | Vec3 corners[8]; |
| 360 | getCorners(corners); |
| 361 | |
| 362 | Vec3 tmpLine; |
| 363 | switch (index) |
| 364 | { |
| 365 | case 0: // edge with x axis |
| 366 | tmpLine = corners[5] - corners[6]; |
| 367 | tmpLine.normalize(); |
| 368 | break; |
| 369 | case 1: // edge with y axis |
| 370 | tmpLine = corners[7] - corners[6]; |
| 371 | tmpLine.normalize(); |
| 372 | break; |
| 373 | case 2: // edge with z axis |
| 374 | tmpLine = corners[1] - corners[6]; |
| 375 | tmpLine.normalize(); |
| 376 | break; |
| 377 | default: |
| 378 | AXASSERT(0, "Invalid index!"); |
| 379 | break; |
| 380 | } |
| 381 | return tmpLine; |
| 382 | } |
| 383 | |
| 384 | Vec3 OBB::getFaceDirection(int index) const |
| 385 | { |