mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
laser pointer now showing up all the time
This commit is contained in:
parent
1a9c1110c0
commit
d072a2efd3
1 changed files with 3 additions and 5 deletions
|
@ -69,6 +69,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.intersection = Entities.findRayIntersection(pickRay, true, this.whitelist);
|
this.intersection = Entities.findRayIntersection(pickRay, true, this.whitelist);
|
||||||
|
//Comment out above line and uncomment below line to see difference in performance between using a whitelist, and not using one
|
||||||
|
|
||||||
if (this.intersection.intersects) {
|
if (this.intersection.intersects) {
|
||||||
var distance = Vec3.distance(handPosition, this.intersection.intersection);
|
var distance = Vec3.distance(handPosition, this.intersection.intersection);
|
||||||
|
@ -76,7 +77,7 @@
|
||||||
this.triggerValue = Controller.getActionValue(this.triggerAction);
|
this.triggerValue = Controller.getActionValue(this.triggerAction);
|
||||||
this.currentStrokeWidth = map(this.triggerValue, 0, 1, MIN_STROKE_WIDTH, MAX_STROKE_WIDTH);
|
this.currentStrokeWidth = map(this.triggerValue, 0, 1, MIN_STROKE_WIDTH, MAX_STROKE_WIDTH);
|
||||||
var displayPoint = this.intersection.intersection;
|
var displayPoint = this.intersection.intersection;
|
||||||
displayPoint = Vec3.sum(displayPoint, Vec3.multiply(this.intersection.surfaceNormal, -0.01));
|
displayPoint = Vec3.sum(displayPoint, Vec3.multiply(this.normal, 0.01));
|
||||||
Overlays.editOverlay(this.laserPointer, {
|
Overlays.editOverlay(this.laserPointer, {
|
||||||
position: displayPoint,
|
position: displayPoint,
|
||||||
size: {
|
size: {
|
||||||
|
@ -92,8 +93,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(this.intersection.properties.type !== "Unknown") {
|
} else if(this.intersection.properties.type !== "Unknown") {
|
||||||
//If type is unknown, ignore
|
//Sometimes ray will pick against an invisible object with type unkown... so if type is unknown, ignore
|
||||||
print("entity name " + this.intersection.properties.type);
|
|
||||||
this.stopPainting();
|
this.stopPainting();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -104,7 +104,6 @@
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
this.oldPosition = null;
|
this.oldPosition = null;
|
||||||
print("STOP PAINTING");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
paint: function(position, normal) {
|
paint: function(position, normal) {
|
||||||
|
@ -180,7 +179,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
releaseGrab: function() {
|
releaseGrab: function() {
|
||||||
print("RELEASE");
|
|
||||||
this.stopPainting();
|
this.stopPainting();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue