mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:38:29 +02:00
more fixes to pointer.js
This commit is contained in:
parent
09f900862b
commit
f535bd2a76
1 changed files with 2 additions and 6 deletions
|
@ -17,6 +17,7 @@ function removeLine() {
|
||||||
Entities.deleteEntity(lineEntityID);
|
Entities.deleteEntity(lineEntityID);
|
||||||
lineEntityID = null;
|
lineEntityID = null;
|
||||||
lineIsRezzed = false;
|
lineIsRezzed = false;
|
||||||
|
Controller.mouseMoveEvent.disconnect(mouseMoveEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +44,7 @@ function createOrUpdateLine(event) {
|
||||||
color: { red: 255, green: 255, blue: 255 },
|
color: { red: 255, green: 255, blue: 255 },
|
||||||
lifetime: 60 // if someone crashes while pointing, don't leave the line there forever.
|
lifetime: 60 // if someone crashes while pointing, don't leave the line there forever.
|
||||||
});
|
});
|
||||||
|
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
removeLine();
|
removeLine();
|
||||||
|
@ -58,9 +60,6 @@ function mousePressEvent(event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
createOrUpdateLine(event);
|
createOrUpdateLine(event);
|
||||||
if (lineIsRezzed) {
|
|
||||||
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,9 +69,6 @@ function mouseMoveEvent(event) {
|
||||||
|
|
||||||
|
|
||||||
function mouseReleaseEvent() {
|
function mouseReleaseEvent() {
|
||||||
if (lineIsRezzed) {
|
|
||||||
Controller.mouseMoveEvent.disconnect(mouseMoveEvent);
|
|
||||||
}
|
|
||||||
removeLine();
|
removeLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue