From 186b86e3d49994ccee9a441c1135bbee050ebc09 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 26 Apr 2017 10:23:20 -0700 Subject: [PATCH] load stylus model before it's needed so that it will appear quickly --- scripts/system/tablet-ui/tabletUI.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index dbfd3e632e..cacd9663ab 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -13,7 +13,7 @@ // /* global Script, HMD, WebTablet, UIWebTablet, UserActivityLogger, Settings, Entities, Messages, Tablet, Overlays, - MyAvatar, Menu */ + MyAvatar, Menu, Vec3 */ (function() { // BEGIN LOCAL_SCOPE var tabletRezzed = false; @@ -214,6 +214,23 @@ closeTabletUI(); rezTablet(); tabletShown = false; + + // also cause the stylus model to be loaded + var tmpStylusID = Overlays.addOverlay("model", { + name: "stylus", + url: Script.resourcesPath() + "meshes/tablet-stylus-fat.fbx", + position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 0.1, z: -2})), + dimensions: { x: 0.01, y: 0.01, z: 0.2 }, + solid: true, + visible: true, + ignoreRayIntersection: true, + drawInFront: false, + lifetime: 3 + }); + Script.setTimeout(function() { + Overlays.deleteOverlay(tmpStylusID); + }, 300); + } else if (!tabletShown) { hideTabletUI(); }