This commit is contained in:
2026-04-10 20:22:09 +03:00
parent eadd0bbf20
commit b155012e6c
5 changed files with 44 additions and 10 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ class Draggable{
let dragging = null;
this.add = function(object, dragZone, fn, distance){
objects.push(object);
object._draggable = {fn, dragZone, distance: distance || defaultDistance}
object._draggable = {fn, dragZone, distance: (distance || defaultDistance) * engine.scale}
}
this.remove = function(object){
@@ -38,7 +38,7 @@ class Draggable{
return true;
}).forEach(o=>{
o.getWorldPosition(v);
if (cv.distanceTo(v) <= o._draggable.distance / engine.scale){
if (cv.distanceTo(v) <= o._draggable.distance){
const intersects = raycaster.intersectObject(o);
if (intersects[0]) forExecute.push({o, i:intersects[0]})
}