This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using static System.Math; | |
// Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis. | |
// The implementation here is according to the paper: | |
// "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01. | |
// "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'" | |
// Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define length(arr) (sizeof(arr)/sizeof(arr[0])) | |
#define TOKEN_CONCAT_INNER(x, y) x##y | |
#define TOKEN_CONCAT(x, y) TOKEN_CONCAT_INNER(x, y) | |
#define LABEL(id) TOKEN_CONCAT(LABEL_##id##_, __LINE__) | |
#define foreach(type, name, arr) \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from http://cakoose.com/wiki/c_preprocessor_abuse | |
#define BIN_0000 0 | |
#define BIN_0001 1 | |
#define BIN_0010 2 | |
#define BIN_0011 3 | |
#define BIN_0100 4 | |
#define BIN_0101 5 | |
#define BIN_0110 6 | |
#define BIN_0111 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cameraPos = MathUtils.SetY(mainCamera.transform.position, 0); | |
var endPos = MathUtils.SetY(transform.position, floorLevel, 0); | |
var distance = = Vector3.Distance(startPos, endPos); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ARLocation; | |
// ... | |
var placeAtLocation = GetComponent<PlaceAtLocation>(); | |
var label = placeAtLocation.Location.Label; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using ARLocation; | |
using System; | |
public class PlaceObjectsLine : MonoBehaviour | |
{ | |
[Serializable] | |
public class Entry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ARLocation; | |
public class PlaceMyObjects : MonoBehaviour | |
{ | |
public GameObject Prefab; | |
void Start() | |
{ | |
var locations = new List<Location>(); | |
locations.Add(new Location() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as THREE from "three"; | |
import { | |
BloomEffect, | |
SelectiveBloomEffect, | |
EffectComposer, | |
EffectPass, | |
RenderPass, | |
BlendFunction, | |
KernelSize, | |
VignetteEffect, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Experimental.AssetImporters; | |
using System.IO; | |
using System.Xml; | |
using System.Collections.Generic; | |
[ScriptedImporter(1, "kml")] | |
public class KMLPathImporter : ScriptedImporter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as THREE from "three"; | |
class Particle { | |
constructor(mesh, body, meshIndex = 0, lifeTime = 0) { | |
this.meshIndex = meshIndex; | |
this.lifeTime = lifeTime; | |
this.elapsedTime = 0; | |
this.dead = false; | |
this.mesh = mesh; | |
this.body = body; |