Skip to content

Instantly share code, notes, and snippets.

View flarb's full-sized avatar

Ralph Barbagallo flarb

View GitHub Profile
@tedbrownxr
tedbrownxr / PlaneTracker.js
Last active December 10, 2021 07:39
An easy-to-use implementation of Plane Tracking on Next Generation Spectacles
// -----JS CODE-----
// PLANE TRACKER
// For Lens Studio on Next Generation Spectacles
// - Gets plane tracking data
// - Determines if a tracked plane is valid or not, based on settings
// - If valid, sets position, normal, and calculated rotation
// Ted Brown / November 30, 2021
// @input SceneObject cameraObject
// @input string floor = "head" {"widget":"combobox", "values":[{"label":"Disabled", "value":"disabled"}, {"label":"Default Rotation", "value":"default"}, {"label":"Head Rotation", "value":"head"}]}
@slipster216
slipster216 / Unity API issues and design thoughts.txt
Last active October 14, 2017 18:39
Unity API issues and Editor design thoughts..
List of design/api/usability thoughs generated while working with Unity- will be extended over time. Unity peeps
asked for some priorities, which are labeled (#1-5, 1 being highest) but are somewhat arbitrary (since these range
from massive refactors to simple fixes). Now adding with dates, so it's easy to see what's new..
3/28/2017
Asset publisher gripes:
- No way to enforce "one seat per user" license - companies with multiple employee's using my software only ever pay
once, when it's supposed to be one copy per user.
- Piracy of assets is rampant
- No subscription business model. You're moving to subscription, why can't we?
@flarb
flarb / NaturalOrientation.cs
Created August 4, 2012 00:03
How to detect the "natural" orientation of an Android device in Unity3D. Also can use to detect tablet and phone.
using UnityEngine;
using System.Collections;
public class NaturalOrientation : MonoBehaviour {
public static int ORIENTATION_UNDEFINED = 0x00000000;
public static int ORIENTATION_PORTRAIT = 0x00000001;
public static int ORIENTATION_LANDSCAPE = 0x00000002;
public static int ROTATION_0 = 0x00000000;
@darktable
darktable / .hgignore
Created February 20, 2012 03:40
hg: Starter hgignore file for Unity3D projects
syntax: glob
.DS_Store
*.sln
*.userprefs
*.csproj
*.pidb
*.unitypackage
syntax: regexp
^Build/.*
@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining