Skip to content

Instantly share code, notes, and snippets.

@hyperlogic
hyperlogic / batchRecorder.js
Created May 2, 2018 00:46
Pulls avatar and recording urls down from a google spreadsheet. then makes avatar recordings
"use strict";
//
// batchRecord.js
//
// Horrible Hack, please do not judge me.
//
(function () {
// https://www.shadertoy.com/view/Md2GRc
/*
{
"ProceduralEntity": {
"shaderUrl": "file:///C:/msys64/home/ajthy/code/hifi/examples/fractal_lines_of_symmetry.glsl",
"version": 2,
"uniforms": {
}
}
}
@hyperlogic
hyperlogic / hfudt.lua
Last active April 14, 2018 23:36
High Fidelity Wireshark Plugin
-- create the HFUDT protocol
p_hfudt = Proto("hfudt", "HFUDT Protocol")
-- create fields shared between packets in HFUDT
local f_data = ProtoField.string("hfudt.data", "Data")
-- create the fields for data packets in HFUDT
local f_length = ProtoField.uint16("hfudt.length", "Length", base.DEC)
local f_control_bit = ProtoField.uint8("hfudt.control", "Control Bit", base.DEC)
local f_reliable_bit = ProtoField.uint8("hfudt.reliable", "Reliability Bit", base.DEC)
@hyperlogic
hyperlogic / handshake.js
Last active May 24, 2018 23:28
Handshake v2, sends grab message over network.
//
// handshake.ts
//
/* global Xform */
/* eslint max-len: ["error", 1024, 4] */
/* eslint brace-style: "stroustrup" */
(function () {
Script.include("/~/system/libraries/Xform.js");
var ALLOW_LIMB_GRABBING = false;
// globals transmitted to and from web app
@hyperlogic
hyperlogic / controller-exception-test.js
Created March 28, 2018 21:30
Purposefully crash during a control system callback.
var foo;
function leftTriggerClick(value) {
print("got here!");
// crash on purpose
foo.bar = 10;
print("should not get here!");
}
var mapping = Controller.newMapping('foo');
mapping.from(Controller.Standard.LTClick).peek().to(leftTriggerClick);
/* global Xform */
Script.include("/~/system/libraries/Xform.js");
var ANIM_VARS = [
"isTalking",
"isNotMoving",
"isMovingForward",
"isMovingBackward",
"isMovingRight",
"isMovingLeft",
{
"version": "1.0",
"root": {
"id": "blend",
"type": "blendLinear",
"data": {
"alpha": 0.5
},
"children": [
{
//
// handshake.js
//
/* global Xform */
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
/* eslint max-len: ["error", 1024, 4] */
(function() { // BEGIN LOCAL_SCOPE
Script.include("/~/system/libraries/Xform.js");
"use strict";
//
// playRecordingAC.js
//
// Created by David Rowe on 7 Apr 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
// test script to transform controller data from avatar space into sensor space.
var VELOCITY_MULTIPLIER = 5.0;
var TRIGGER_ON = 0.9;
var TRIGGER_OFF = 0.5;
var SMOOTH_VELOCITY = 0.9;
var SMOOTH_ROTATION = 0.9;
var LEFT = 0;
var RIGHT = 1;