| 539 | } |
| 540 | |
| 541 | bool WaterBlock::isUnderwater( const Point3F &pnt ) const |
| 542 | { |
| 543 | // Transform point into object space so we can test if it is within |
| 544 | // the WaterBlock's object box, include rotation/scale. |
| 545 | |
| 546 | Point3F objPnt = pnt; |
| 547 | mWorldToObj.mulP( pnt, &objPnt ); |
| 548 | |
| 549 | objPnt.z -= 0.1f; |
| 550 | |
| 551 | Box3F testBox = mObjBox; |
| 552 | testBox.scale( mObjScale ); |
| 553 | |
| 554 | // We already tested if below the surface plane, |
| 555 | // so clamping the z height of the box is not really necessary. |
| 556 | testBox.maxExtents.z = testBox.getCenter().z; |
| 557 | |
| 558 | if ( testBox.isContained( objPnt ) ) |
| 559 | return true; |
| 560 | |
| 561 | return false; |
| 562 | } |
| 563 | |
| 564 | void WaterBlock::clearVertBuffers() |
| 565 | { |
nothing calls this directly
no test coverage detected