industrial-harbor-viewer / node_modules /three-mesh-bvh /src /utils /GeometryRayIntersectUtilities.js
KoeYe's picture
Add viewer app, scene data, and three.js runtime
b797337 verified
Raw History Blame Contribute Delete
406 Bytes
// converts the given BVH raycast intersection to align with the three.js raycast
// structure (include object, world space distance and point).
export function convertRaycastIntersect( hit, object, raycaster ) {
if ( hit === null ) {
return null;
}
hit.point.applyMatrix4( object.matrixWorld );
hit.distance = hit.point.distanceTo( raycaster.ray.origin );
hit.object = object;
return hit;
}