From 6e0ddb39189bf588d42ab4e27f1a1cc55b52cac2 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Fri, 26 Feb 2016 11:48:15 -0800 Subject: [PATCH] really fixed rotation --- examples/homeContent/whiteboardV2/markerEntityScript.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/homeContent/whiteboardV2/markerEntityScript.js b/examples/homeContent/whiteboardV2/markerEntityScript.js index fc4cbba1bd..064add57be 100644 --- a/examples/homeContent/whiteboardV2/markerEntityScript.js +++ b/examples/homeContent/whiteboardV2/markerEntityScript.js @@ -24,7 +24,7 @@ _this = this; _this.MARKER_TEXTURE_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/textures/markerStroke.png"; _this.strokeForwardOffset = 0.0001; - _this.STROKE_WIDTH = 0.03 + _this.STROKE_WIDTH = 0.03; _this.MAX_MARKER_TO_BOARD_DISTANCE = 1.4; _this.MIN_DISTANCE_BETWEEN_POINTS = 0.002; _this.MAX_DISTANCE_BETWEEN_POINTS = 0.1; @@ -72,12 +72,14 @@ direction: Quat.getFront(markerProps.rotation) } var intersection = Entities.findRayIntersectionBlocking(pickRay, true, _this.whiteboards); + if (intersection.intersects && Vec3.distance(intersection.intersection, markerProps.position) < _this.MAX_MARKER_TO_BOARD_DISTANCE) { - _this.whiteboardNormal = Quat.getFront(intersection.properties.rotation); + var whiteboardRotation = Entities.getEntityProperties(intersection.entityID, "rotation").rotation; + _this.whiteboardNormal = Quat.getFront(whiteboardRotation); Overlays.editOverlay(_this.laserPointer, { visible: true, position: intersection.intersection, - // rotation: intersection.properties.rotation + rotation: whiteboardRotation }) _this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[_this.hand]); if (_this.triggerValue > _this.PAINTING_TRIGGER_THRESHOLD) {