Skip to content

Instantly share code, notes, and snippets.

// test script to transform controller data from avatar space into sensor space.
var rightTriggerJustPressed = false;
var rightTriggerJustReleased = false;
var rightTriggerPressed = false;
var rightTriggerWasPressed = false;
var CONTROLLER_MAPPING_NAME = "myControllerMapping";
var controllerMapping = Controller.newMapping(CONTROLLER_MAPPING_NAME);
controllerMapping.from(Controller.Standard.RT).to(function (value) {
// draw a line ruler next to the avatar.
Script.include("/~/system/libraries/Xform.js");
/* global Xform */
var RED = {x: 1, y: 0, z: 0, w: 1};
var GREEN = {x: 0, y: 1, z: 0, w: 1};
var BLUE = {x: 0, y: 0, z: 1, w: 1};
var CYAN = {x: 0, y: 1, z: 1, w: 1};
var ORIGIN = {x: 0, y: 0, z: 0};
var MUSIC_URL = "http://localhost:8000/pinkroom-ambix.wav";
var musicSound = SoundCache.getSound(MUSIC_URL);
var musicInjector;
print("AJT: starting blacklodge ac.js");
function update(dt) {
if (musicSound.downloaded) {
//
// up-gravity-entity-script.js
//
(function() {
var _this = this;
_this.preload = function (entityID) {
_this.entityID = entityID;
Script.update.connect(_this.update);
var EPSILON = 0.0001;
var SPHERE_ORIGIN = { x: 0, y: 0, z: 0 };
function v3len(v) {
return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
}
function v3add(a, b) {
return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z };
}
//
// blendshapetest.js
//
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
(function() { // BEGIN LOCAL_SCOPE
var TABLET_BUTTON_NAME = "BLENDSHAPE";
var HTML_URL = "https://s3.amazonaws.com/hifi-public/tony/html/blendshapetest.html";
{
"version": "1.0",
"root": {
"id": "userAnimStateMachine",
"type": "stateMachine",
"data": {
"currentState": "userAnimNone",
"states": [
{
"id": "userAnimNone",
//
// gravity.js
//
// Created by Alan-Michael Moody on 7/24/17
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
//
// Clipboard.js
//
// Created by Anthony J. Thibault on 8/8/2017
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
var AVATAR_URL = "https://highfidelity.com/api/v1/marketplace/items?category=avatars&sort=likes";
var HTTP_GET_TIMEOUT = 15000; // 15 seconds
// helper function to wrap an HTTP get request.
function XHR(url, successCb, failureCb, TIMEOUT) {
print("XHR: request url = " + url);
var self = this;
this.url = url;
this.successCb = successCb;
this.failureCb = failureCb;