closestPointToPoint method
Implementation
Vector3 closestPointToPoint(Vector3 point, Vector3 target) {
target.subVectors(point, origin);
var directionDistance = target.dot(direction);
if (directionDistance < 0) {
return target.copy(origin);
}
return target.copy(direction).multiplyScalar(directionDistance).add(origin);
}