| 791 | } |
| 792 | |
| 793 | bool MeshPrimitiveEvaluator::intersectionPoint( const Imath::V3f &origin, const Imath::V3f &direction, |
| 794 | PrimitiveEvaluator::Result *result, float maxDistance ) const |
| 795 | { |
| 796 | assert( dynamic_cast<Result *>( result ) ); |
| 797 | |
| 798 | if ( m_triangles.size() == 0) |
| 799 | { |
| 800 | return false; |
| 801 | } |
| 802 | |
| 803 | assert( m_tree ); |
| 804 | |
| 805 | Result *mr = static_cast<Result *>( result ); |
| 806 | |
| 807 | float maxDistSqrd = maxDistance * maxDistance; |
| 808 | |
| 809 | Imath::Line3f ray; |
| 810 | ray.pos = origin; |
| 811 | ray.dir = direction.normalized(); |
| 812 | |
| 813 | bool hit = false; |
| 814 | |
| 815 | intersectionPointWalk( m_tree->rootIndex(), ray, maxDistSqrd, mr, hit ); |
| 816 | return hit; |
| 817 | } |
| 818 | |
| 819 | int MeshPrimitiveEvaluator::intersectionPoints( const Imath::V3f &origin, const Imath::V3f &direction, |
| 820 | std::vector<PrimitiveEvaluator::ResultPtr> &results, float maxDistance ) const |
no test coverage detected