https://github.com/mrdoob/three.js/blob/6e897f9a42d615403dfa812b45663149f2d2db3e/src/math/Plane.js
这步 - ( line.start.dot( this.normal ) + this.constant ) / denominator 没看懂
为啥是 -(线段起点向量 ⋅ 平面法线 + 平面到原点距离) / (平面法线 ⋅ 线段方向向量) ?
intersectLine( line, target ) {
const direction = line.delta( _vector1 );
const denominator = this.normal.dot( direction );
if ( denominator === 0 ) {
// line is coplanar, return origin
if ( this.distanceToPoint( line.start ) === 0 ) {
return target.copy( line.start );
}
// Unsure if this is the correct method to handle this case.
return null;
}
const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
if ( t 1 ) {
return null;
}
return target.copy( direction ).multiplyScalar( t ).add( line.start );
}