content/hifi-public/scripts/entityScripts/virtualBaton/batonSimpleEntitySpawner.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

33 lines
No EOL
797 B
JavaScript

var orientation = Camera.getOrientation();
orientation = Quat.safeEulerAngles(orientation);
orientation.x = 0;
orientation = Quat.fromVec3Degrees(orientation);
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(orientation)));
// Math.random ensures no caching of script
var SCRIPT_URL = Script.resolvePath("batonSimpleEntityScript.js");
var batonBox = Entities.addEntity({
type: "Box",
name: "hifi-baton-entity",
color: {
red: 200,
green: 200,
blue: 200
},
position: center,
dimensions: {
x: 0.1,
y: 0.1,
z: 0.1
},
script: SCRIPT_URL
});
function cleanup() {
Entities.deleteEntity(batonBox);
}
Script.scriptEnding.connect(cleanup);