From 2bf89eb273a39e836f48ebe1c265900f9d61bafe Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 7 Aug 2020 20:56:21 +1000 Subject: [PATCH] Fix bug with dice throw not working on windows once a dice had come to rest --- src/components/dice/DiceInteraction.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/dice/DiceInteraction.js b/src/components/dice/DiceInteraction.js index e573352..846b66d 100644 --- a/src/components/dice/DiceInteraction.js +++ b/src/components/dice/DiceInteraction.js @@ -53,7 +53,9 @@ function DiceInteraction({ onSceneMount, onPointerDown, onPointerUp }) { ); const currentPosition = selectedMesh.getAbsolutePosition(); let newPosition = ray.origin.scale(camera.globalPosition.y); - newPosition.y = currentPosition.y; + // Manually set the y value, using currentPosition.y caused a bug with windows + // where the physics wasn't updated + newPosition.y = 1.5; const delta = newPosition.subtract(currentPosition); selectedMesh.setAbsolutePosition(newPosition); const velocity = delta.scale(1000 / scene.deltaTime);