mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
only show overlay if within painting range
This commit is contained in:
parent
d1d4a9d6b1
commit
0b569a0fab
1 changed files with 7 additions and 3 deletions
|
@ -58,13 +58,14 @@
|
||||||
direction: Quat.getFront(markerProps.rotation)
|
direction: Quat.getFront(markerProps.rotation)
|
||||||
}
|
}
|
||||||
var intersection = Entities.findRayIntersection(pickRay, true, [_this.whiteboard]);
|
var intersection = Entities.findRayIntersection(pickRay, true, [_this.whiteboard]);
|
||||||
if (intersection.intersects) {
|
|
||||||
|
if (intersection.intersects && Vec3.distance(intersection.intersection, markerProps.position) < _this.MAX_MARKER_TO_BOARD_DISTANCE) {
|
||||||
Overlays.editOverlay(_this.laserPointer, {
|
Overlays.editOverlay(_this.laserPointer, {
|
||||||
visible: true,
|
visible: true,
|
||||||
position: intersection.intersection
|
position: intersection.intersection
|
||||||
})
|
})
|
||||||
_this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[_this.hand]);
|
_this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[_this.hand]);
|
||||||
if (_this.triggerValue > _this.PAINTING_TRIGGER_THRESHOLD && Vec3.distance(intersection.intersection, markerProps.position) < _this.MAX_MARKER_TO_BOARD_DISTANCE) {
|
if (_this.triggerValue > _this.PAINTING_TRIGGER_THRESHOLD) {
|
||||||
_this.paint(intersection.intersection)
|
_this.paint(intersection.intersection)
|
||||||
} else {
|
} else {
|
||||||
_this.resetStroke();
|
_this.resetStroke();
|
||||||
|
@ -91,7 +92,7 @@
|
||||||
position: position,
|
position: position,
|
||||||
textures: _this.MARKER_TEXTURE_URL,
|
textures: _this.MARKER_TEXTURE_URL,
|
||||||
color: _this.markerColor,
|
color: _this.markerColor,
|
||||||
lifetime: 1000
|
lifetime: 200
|
||||||
});
|
});
|
||||||
|
|
||||||
_this.linePoints = [];
|
_this.linePoints = [];
|
||||||
|
@ -149,6 +150,9 @@
|
||||||
|
|
||||||
unload: function() {
|
unload: function() {
|
||||||
Overlays.deleteOverlay(_this.laserPointer);
|
Overlays.deleteOverlay(_this.laserPointer);
|
||||||
|
_this.strokes.forEach( function(stroke) {
|
||||||
|
Entities.deleteEntity(stroke);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setProperties: function(myId, data) {
|
setProperties: function(myId, data) {
|
||||||
|
|
Loading…
Reference in a new issue