computeTriangleRayIntersectionBarycentricEdge
computeTriangleRayIntersectionBarycentricEdge(result, origin_x, origin_y, origin_z, direction_x, direction_y, direction_z, ax, ay, az, edge1_x, edge1_y, edge1_z, edge2_x, edge2_y, edge2_z) ⇒ boolean
Compute barycentric coordinates for triangle intersection Operates on edges, this is optimized for raytracing, as same edges are required to reconstruct various attributes later on NOTE: most of the code is inlined for speed to avoid allocation and function calls
Kind: global function
Source: https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm (Möller and Trumbore, « Fast, Minimum Storage Ray-Triangle Intersection », Journal of Graphics Tools, vol. 2, 1997, p. 21–28)
See: https://github.com/erich666/jgt-code/blob/master/Volume_02/Number_1/Moller1997a/raytri.c
Param | Type |
---|---|
result | Array.<number> |
origin_x | number |
origin_y | number |
origin_z | number |
direction_x | number |
direction_y | number |
direction_z | number |
ax | number |
ay | number |
az | number |
edge1_x | number |
edge1_y | number |
edge1_z | number |
edge2_x | number |
edge2_y | number |
edge2_z | number |