@coconut-xr/xinteraction
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,2 +0,2 @@ | ||
import { InstancedMesh, Matrix4, Mesh, Vector3, Sphere, Quaternion, Box3, Plane, } from "three"; | ||
import { InstancedMesh, Matrix4, Mesh, Vector3, Sphere, Quaternion, Plane, } from "three"; | ||
import { computeIntersectionWorldPlane, isIntersectionNotClipped, traverseUntilInteractable, } from "./index.js"; | ||
@@ -129,3 +129,2 @@ const oldInputDevicePointOffset = new Vector3(); | ||
const vec0_0001 = new Vector3(0.0001, 0.0001, 0.0001); | ||
const normalHelperBox = new Box3(); | ||
function intersectSphereBox(object, inputDevicePosition, inputDeviceRotation, matrixWorld, invertedMatrixWorld, geometry, instanceId) { | ||
@@ -143,4 +142,3 @@ helperSphere.copy(collisionSphere).applyMatrix4(invertedMatrixWorld); | ||
boxSizeHelper.max(vec0_0001); | ||
normalHelperBox.setFromCenterAndSize(boxCenterHelper, boxSizeHelper); | ||
const normal = normalHelperBox.clampPoint(helperSphere.center, new Vector3()); | ||
const normal = helperSphere.center.clone().sub(boxCenterHelper); | ||
normal.divide(boxSizeHelper); | ||
@@ -147,0 +145,0 @@ maximizeAxisVector(normal); |
{ | ||
"name": "@coconut-xr/xinteraction", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"homepage": "https://coconut-xr.github.io/xinteraction", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE", |
79649
1464