Skip to content

Instantly share code, notes, and snippets.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class DebugInputs : MonoBehaviour {
private List<InputDevice> devicesWithTrigger;
// This class lives on the avatar root
public class Blarpatar : MonoBehaviour{
private RealtimeView _realtimeView;
public Human human;
public PullTowardsHand blarpL;
public PullTowardsHand blarpR;
public GameObject blarpPrefab;
void Start() {
_realtimeView = GetComponent<RealtimeView>();
Glacier.prototype.Get3DPosition = function(x,y){
// if(!offset){ offset = 0}
// offset = 0;
var x2 = Math.floor(x * this.imageData.width);
var y2 = Math.floor(y * this.imageData.height);
var color = getPixel( this.imageData, x2,y2);
var h = color.r;
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Unlit/PrettyCrystalTris"
{
Properties {
_BaseColor ("BaseColor", Color) = (1,1,1,1)
// Setting bounds because your packed flaot will go from 0->1
const float BOUNDS = 1000.0;
float unnormalizeCoordinate(float x) {
return (x * 2.0 - 1.0) * BOUNDS;
}
float normalizeCoordinate(float x) {
return (x / BOUNDS) * 0.5 + 0.5;
}