MCPcopy Create free account
hub / github.com/ImageEngine/cortex / intersectionPoints

Method intersectionPoints

src/IECoreScene/MeshPrimitiveEvaluator.cpp:819–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

817}
818
819int MeshPrimitiveEvaluator::intersectionPoints( const Imath::V3f &origin, const Imath::V3f &direction,
820 std::vector<PrimitiveEvaluator::ResultPtr> &results, float maxDistance ) const
821{
822 results.clear();
823
824 if ( m_triangles.size() == 0)
825 {
826 return 0;
827 }
828
829 assert( m_tree );
830
831 float maxDistSqrd = maxDistance * maxDistance;
832
833 Imath::Line3f ray;
834 ray.pos = origin;
835 ray.dir = direction.normalized();
836
837 intersectionPointsWalk( m_tree->rootIndex(), ray, maxDistSqrd, results );
838
839 return results.size();
840}
841
842bool MeshPrimitiveEvaluator::barycentricPosition( unsigned int triangleIndex, const Imath::V3f &barycentricCoordinates, PrimitiveEvaluator::Result *result ) const
843{

Callers 4

testCylinderMeshMethod · 0.95
testSimpleMethod · 0.45
testSphereMeshMethod · 0.45
testRandomTrianglesMethod · 0.45

Calls 2

clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected