mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 09:33:49 +02:00
added portkey to posters
This commit is contained in:
parent
fa5376bc86
commit
cbb6c5fe98
2 changed files with 71 additions and 0 deletions
|
@ -60,6 +60,35 @@
|
|||
"shapeType": "compound",
|
||||
"type": "Model",
|
||||
"userData": "{\"hifiHomeKey\":{\"reset\":true}}"
|
||||
},
|
||||
{
|
||||
"color": {
|
||||
"blue": 255,
|
||||
"green": 0,
|
||||
"red": 255
|
||||
},
|
||||
"name": "home_sphere_cellsciencePortkey",
|
||||
"href": "hifi://cellscience",
|
||||
"script": "atp:/switches/portkey.js",
|
||||
"visible": false,
|
||||
"dimensions": {
|
||||
"x": 0.111,
|
||||
"y": 0.111,
|
||||
"z": 0.111
|
||||
},
|
||||
"position": {
|
||||
"x": 0.0,
|
||||
"y": -0.2,
|
||||
"z": 0.0
|
||||
},
|
||||
"queryAACube": {
|
||||
"scale": 0.25831151008605957,
|
||||
"x": -0.12915575504302979,
|
||||
"y": -0.12915575504302979,
|
||||
"z": -0.10074388980865479
|
||||
},
|
||||
"type": "Sphere",
|
||||
"userData": "{\"hifiHomeKey\":{\"reset\":true}, \"grabbableKey\": {\"wantsTrigger\": true}}"
|
||||
}],
|
||||
"Version": 57
|
||||
}
|
42
unpublishedScripts/DomainContent/Home/switches/portkey.js
Normal file
42
unpublishedScripts/DomainContent/Home/switches/portkey.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
// portkey.js
|
||||
//
|
||||
//
|
||||
// Created by Eric Levin on 3/28/2016
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// This entity script is designed to teleport a user to an in-world location specified in object's userdata
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
Script.include("atp:/utils.js");
|
||||
var _this = this;
|
||||
|
||||
|
||||
this.startFarTrigger = function() {
|
||||
_this.teleport();
|
||||
}
|
||||
|
||||
this.startNearTrigger = function() {
|
||||
_this.teleport();
|
||||
}
|
||||
|
||||
this.startNearGrab = function() {
|
||||
_this.teleport();
|
||||
}
|
||||
|
||||
this.teleport = function() {
|
||||
Window.location = _this.portkeyLink;
|
||||
}
|
||||
|
||||
this.preload = function(entityID) {
|
||||
_this.entityID = entityID;
|
||||
_this.portkeyLink = Entities.getEntityProperties(_this.entityID, "href").href;
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in a new issue