mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 00:34:22 +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.STROKE_NAME = "hifi-marker-stroke";
|
||||
_this.ERASER_TO_STROKE_SEARCH_RADIUS = 0.7;
|
||||
_this.strokeMap = [];
|
||||
};
|
||||
|
||||
Eraser.prototype = {
|
||||
|
@ -35,10 +36,10 @@
|
|||
var eraserPosition = Entities.getEntityProperties(_this.entityID, "position").position;
|
||||
var strokeIDs = Entities.findEntities(eraserPosition, _this.ERASER_TO_STROKE_SEARCH_RADIUS);
|
||||
// Create a map of stroke entities and their positions
|
||||
_this.strokeMap = [];
|
||||
|
||||
strokeIDs.forEach(function(strokeID) {
|
||||
var strokeProps = Entities.getEntityProperties(strokeID, ["position", "name"]);
|
||||
if (strokeProps.name === _this.STROKE_NAME) {
|
||||
if (strokeProps.name === _this.STROKE_NAME) {
|
||||
_this.strokeMap.push({
|
||||
strokeID: strokeID,
|
||||
strokePosition: strokeProps.position
|
||||
|
@ -53,7 +54,9 @@
|
|||
} else {}
|
||||
},
|
||||
|
||||
releaseEquip: function() {},
|
||||
releaseEquip: function() {
|
||||
_this.strokeMap = [];
|
||||
},
|
||||
|
||||
|
||||
continueHolding: function() {
|
||||
|
|
|
@ -149,8 +149,6 @@ function createMarkers() {
|
|||
blue: 200
|
||||
});
|
||||
|
||||
|
||||
|
||||
markerPosition = Vec3.sum(markerPosition, Vec3.multiply(-0.2, Quat.getFront(markerRotation)));
|
||||
createMarker(modelURLS[1], markerPosition, {
|
||||
red: 200,
|
||||
|
|
Loading…
Reference in a new issue