Fix bug with dice throw not working on windows once a dice had come to rest
This commit is contained in:
parent
9e6476c338
commit
2bf89eb273
@ -53,7 +53,9 @@ function DiceInteraction({ onSceneMount, onPointerDown, onPointerUp }) {
|
|||||||
);
|
);
|
||||||
const currentPosition = selectedMesh.getAbsolutePosition();
|
const currentPosition = selectedMesh.getAbsolutePosition();
|
||||||
let newPosition = ray.origin.scale(camera.globalPosition.y);
|
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);
|
const delta = newPosition.subtract(currentPosition);
|
||||||
selectedMesh.setAbsolutePosition(newPosition);
|
selectedMesh.setAbsolutePosition(newPosition);
|
||||||
const velocity = delta.scale(1000 / scene.deltaTime);
|
const velocity = delta.scale(1000 / scene.deltaTime);
|
||||||
|
Loading…
Reference in New Issue
Block a user