markers resetting

This commit is contained in:
ericrius1 2016-02-26 14:29:43 -08:00
parent e83c1f71a6
commit 48f03ba476
2 changed files with 24 additions and 4 deletions

View file

@ -24,7 +24,10 @@
_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_RANGE = {min: 0.002, max: 0.01};
_this.STROKE_WIDTH_RANGE = {
min: 0.002,
max: 0.01
};
_this.MAX_MARKER_TO_BOARD_DISTANCE = 1.4;
_this.MIN_DISTANCE_BETWEEN_POINTS = 0.002;
_this.MAX_DISTANCE_BETWEEN_POINTS = 0.1;
@ -32,6 +35,7 @@
_this.PAINTING_TRIGGER_THRESHOLD = 0.2;
_this.STROKE_NAME = "hifi-marker-stroke";
_this.WHITEBOARD_SURFACE_NAME = "hifi-whiteboardDrawingSurface";
_this.MARKER_RESET_WAIT_TIME = 3000;
};
MarkerTip.prototype = {
@ -60,6 +64,20 @@
Overlays.editOverlay(_this.laserPointer, {
visible: false
});
// Once user releases marker, wait a bit then put marker back to its original position and rotation
Script.setTimeout(function() {
var userData = getEntityUserData(_this.entityID);
Entities.editEntity(_this.entityID, {
position: userData.originalPosition,
rotation: userData.originalRotation,
velocity: {
x: 0,
y: -0.01,
z: 0
}
});
}, _this.MARKER_RESET_WAIT_TIME);
},

View file

@ -202,6 +202,8 @@ function createMarker(modelURL, markerPosition, markerColor) {
name: "marker",
script: MARKER_SCRIPT_URL,
userData: JSON.stringify({
originalPosition: markerPosition,
originalRotation: markerRotation,
markerColor: markerColor,
wearable: {
joints: {