mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
load stylus model before it's needed so that it will appear quickly
This commit is contained in:
parent
37233b9fdb
commit
186b86e3d4
1 changed files with 18 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue