mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 01:03:58 +02:00
only erase stroke map on release and preload
This commit is contained in:
parent
4de951242c
commit
ddae2d4f74
2 changed files with 6 additions and 5 deletions
|
@ -24,6 +24,7 @@
|
||||||
_this.ERASER_TRIGGER_THRESHOLD = 0.2;
|
_this.ERASER_TRIGGER_THRESHOLD = 0.2;
|
||||||
_this.STROKE_NAME = "hifi-marker-stroke";
|
_this.STROKE_NAME = "hifi-marker-stroke";
|
||||||
_this.ERASER_TO_STROKE_SEARCH_RADIUS = 0.7;
|
_this.ERASER_TO_STROKE_SEARCH_RADIUS = 0.7;
|
||||||
|
_this.strokeMap = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
Eraser.prototype = {
|
Eraser.prototype = {
|
||||||
|
@ -35,7 +36,7 @@
|
||||||
var eraserPosition = Entities.getEntityProperties(_this.entityID, "position").position;
|
var eraserPosition = Entities.getEntityProperties(_this.entityID, "position").position;
|
||||||
var strokeIDs = Entities.findEntities(eraserPosition, _this.ERASER_TO_STROKE_SEARCH_RADIUS);
|
var strokeIDs = Entities.findEntities(eraserPosition, _this.ERASER_TO_STROKE_SEARCH_RADIUS);
|
||||||
// Create a map of stroke entities and their positions
|
// Create a map of stroke entities and their positions
|
||||||
_this.strokeMap = [];
|
|
||||||
strokeIDs.forEach(function(strokeID) {
|
strokeIDs.forEach(function(strokeID) {
|
||||||
var strokeProps = Entities.getEntityProperties(strokeID, ["position", "name"]);
|
var strokeProps = Entities.getEntityProperties(strokeID, ["position", "name"]);
|
||||||
if (strokeProps.name === _this.STROKE_NAME) {
|
if (strokeProps.name === _this.STROKE_NAME) {
|
||||||
|
@ -53,7 +54,9 @@
|
||||||
} else {}
|
} else {}
|
||||||
},
|
},
|
||||||
|
|
||||||
releaseEquip: function() {},
|
releaseEquip: function() {
|
||||||
|
_this.strokeMap = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
continueHolding: function() {
|
continueHolding: function() {
|
||||||
|
|
|
@ -149,8 +149,6 @@ function createMarkers() {
|
||||||
blue: 200
|
blue: 200
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
markerPosition = Vec3.sum(markerPosition, Vec3.multiply(-0.2, Quat.getFront(markerRotation)));
|
markerPosition = Vec3.sum(markerPosition, Vec3.multiply(-0.2, Quat.getFront(markerRotation)));
|
||||||
createMarker(modelURLS[1], markerPosition, {
|
createMarker(modelURLS[1], markerPosition, {
|
||||||
red: 200,
|
red: 200,
|
||||||
|
|
Loading…
Reference in a new issue