MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / distanceFromIntersection

Function distanceFromIntersection

Three.js/js/ThreeDebug.js:1259–1269  ·  view source on GitHub ↗
( origin, direction, position )

Source from the content-addressed store, hash-verified

1257 var dot, intersect, distance;
1258
1259 function distanceFromIntersection( origin, direction, position ) {
1260
1261 v0.sub( position, origin );
1262 dot = v0.dot( direction );
1263
1264 intersect = v1.add( origin, v2.copy( direction ).multiplyScalar( dot ) );
1265 distance = position.distanceTo( intersect );
1266
1267 return distance;
1268
1269 }
1270
1271 // http://www.blackpawn.com/texts/pointinpoly/default.html
1272

Callers 1

ThreeDebug.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected