Hi everyone, Im new here and JS(Three.js) side and wonder about one issue that I found on some project on github. Blueprint. Its a 3d floor plan project and its not working on mobile web (the touch draggable function).
Item.prototype.clickPressed = function (intersection) {
this.dragOffset.copy(intersection.point).sub(this.position);
};
;
/** */
Item.prototype.clickDragged = function (intersection) {
if (intersection) {
this.moveToPosition(intersection.point.sub(this.dragOffset), intersection);
}
};
;
function clickPressed(vec2) {
vec2 = vec2 || mouse;
var intersection = scope.itemIntersection(mouse, selectedObject);
if (intersection) {
selectedObject.clickPressed(intersection);
}
}
function clickDragged(vec2) {
vec2 = vec2 || mouse;
var intersection = scope.itemIntersection(mouse, selectedObject);
if (intersection) {
if (scope.isRotating()) {
selectedObject.rotate(intersection);
}
else {
selectedObject.clickDragged(intersection);
}
}
}
these functions about press item from point A, to point B, like mousedown > mousemove > mouseup. the functions work perfectly but when change to mobile web, clickDragged function is not working at all.
so wonder how to fix the solution or some help how to change code for items available for dragging. Really need help, guys. thanks
Even if I’d like to help, I see no specific question about the problem.
You just offer the other people to go through the source code of a not so small project that was made with an outdated version of the framework (r69, whereas the current one is r94) and typescript, find the piece of code which doesn’t work (or works incorrectly), fix it(!) and give you the working solution.
So, could you clarify what are you talking about? Is it Edit Floorplan or Design?
I didn’t find any code in touch events that would allow to do the same things as with mouse events, for example in Designmode, you can rotate the scene with the touch, but you can’t move (drag) a selected object.
Thus, you have to add some logics for that stuff into existing touch events or re-work them completely.
Maybe someone more experienced can add some more information about this topic or can say that my suggestion is totally wrong
yeah the floor paln is rotate by touch event, but items cant dragging as you said. that is a big issue for me and cannot find solution on internet too. thats why I asked from you, and if u remember I asked this question on stackoverflow too. ))