| 659 | } |
| 660 | |
| 661 | bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, VectorF *normalOut ) |
| 662 | { |
| 663 | const U32 mask = TerrainObjectType | StaticShapeObjectType; |
| 664 | |
| 665 | Point3F start( worldPt.x, worldPt.y, worldPt.z + mSize ); |
| 666 | Point3F end( worldPt.x, worldPt.y, worldPt.z - mSize ); |
| 667 | |
| 668 | if ( mForest ) |
| 669 | mForest->disableCollision(); |
| 670 | |
| 671 | // Do a cast ray at this point from the top to |
| 672 | // the bottom of our brush radius. |
| 673 | |
| 674 | RayInfo rinfo; |
| 675 | bool hit = gServerContainer.castRay( start, end, mask, &rinfo ); |
| 676 | |
| 677 | if ( mForest ) |
| 678 | mForest->enableCollision(); |
| 679 | |
| 680 | if ( !hit ) |
| 681 | return false; |
| 682 | |
| 683 | if (zValueOut) |
| 684 | *zValueOut = rinfo.point.z; |
| 685 | |
| 686 | if (normalOut) |
| 687 | *normalOut = rinfo.normal; |
| 688 | |
| 689 | return true; |
| 690 | } |
| 691 | |
| 692 | DefineEngineMethod( ForestBrushTool, collectElements, void, (), , "" ) |
| 693 | { |
nothing calls this directly
no test coverage detected