content/hifi-content/brosche/dev/portalSpheres/portal_sphere_server.js
2022-02-13 21:50:01 +01:00

49 lines
1.1 KiB
JavaScript

//
// glass primitive catchServer.js
//
// Author: Liv Erickson
// Copyright High Fidelity 2018
//
// Licensed under the Apache 2.0 License
// See accompanying license file or http://apache.org/
//
/* globals Entities */
(function() {
var _entityID;
var LIFETIME = 30;
var PortalSphere = function() {
};
PortalSphere.prototype = {
remotelyCallable: ['returnPortal', 'setUpPortal'],
preload: function(entityID) {
_entityID = entityID;
},
returnPortal: function() {
Entities.editEntity(_entityID, {
localPosition: {
"x": 0,
"y": 0,
"z": 0
}
});
},
setUpPortal: function() {
var age = Entities.getEntityProperties(_entityID, "age").age;
Entities.editEntity( _entityID, {
lifetime: age + LIFETIME,
visible: true,
dynamic: true,
collisionless: false
});
}
};
return new PortalSphere();
});