three-mesh-bvh
Advanced tools
Comparing version 0.8.0 to 0.8.1
{ | ||
"name": "three-mesh-bvh", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "A BVH implementation to speed up raycasting against three.js meshes.", | ||
@@ -55,3 +55,3 @@ "module": "src/index.js", | ||
"peerDependencies": { | ||
"three": ">= 0.158.0" | ||
"three": ">= 0.159.0" | ||
}, | ||
@@ -58,0 +58,0 @@ "devDependencies": { |
@@ -1,3 +0,5 @@ | ||
import { Vector3, Vector2, Triangle, DoubleSide, BackSide } from 'three'; | ||
import { Vector3, Vector2, Triangle, DoubleSide, BackSide, REVISION } from 'three'; | ||
const IS_GT_REVISION_169 = parseInt( REVISION ) >= 169; | ||
// Ripped and modified From THREE.js Mesh raycast | ||
@@ -56,2 +58,5 @@ // https://github.com/mrdoob/three.js/blob/0aa87c999fe61e216c1133fba7a95772b503eddf/src/objects/Mesh.js#L115 | ||
const barycoord = new Vector3(); | ||
Triangle.getBarycoord( _intersectionPoint, _vA, _vB, _vC, barycoord ); | ||
if ( uv ) { | ||
@@ -105,2 +110,8 @@ | ||
if ( IS_GT_REVISION_169 ) { | ||
intersection.barycoord = barycoord; | ||
} | ||
} | ||
@@ -107,0 +118,0 @@ |
@@ -74,2 +74,6 @@ | ||
// extract barycoord | ||
const barycoord = target && target.barycoord ? target.barycoord : new Vector3(); | ||
Triangle.getBarycoord( point, tempV1, tempV2, tempV3, barycoord ); | ||
// extract uvs | ||
@@ -102,2 +106,3 @@ let uv = null; | ||
if ( uv ) target.uv = uv; | ||
target.barycoord = barycoord; | ||
@@ -116,3 +121,4 @@ return target; | ||
}, | ||
uv: uv | ||
uv: uv, | ||
barycoord: barycoord, | ||
}; | ||
@@ -119,0 +125,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1614335
18583