Skip to content

Instantly share code, notes, and snippets.

View CameronVetter's full-sized avatar

Cameron Vetter CameronVetter

View GitHub Profile
@CameronVetter
CameronVetter / .gitignore
Last active November 29, 2017 06:32
.gitignore for Unity HoloLens Development
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
@CameronVetter
CameronVetter / SpatialUnderstandingState.cs
Last active January 25, 2017 22:26
SpatialUnderstandingState.cs - Part 1
using UnityEngine;
using HoloToolkit.Unity;
using HoloToolkit.Unity.SpatialMapping;
public class SpatialUnderstandingState : Singleton<SpatialUnderstandingState>
{
public TextMesh DebugDisplay;
public TextMesh DebugSubDisplay;
private bool _triggered;
@CameronVetter
CameronVetter / SpatialUnderstandingState.cs
Last active January 25, 2017 22:26
SpatialUnderstandingState - Part 2
using System;
using UnityEngine;
using HoloToolkit.Unity;
using HoloToolkit.Unity.SpatialMapping;
public class SpatialUnderstandingState : Singleton<SpatialUnderstandingState>
{
public TextMesh DebugDisplay;
public TextMesh DebugSubDisplay;
@CameronVetter
CameronVetter / SpatialUnderstandingState.cs
Last active January 25, 2017 22:26
SpatialUnderstandingState.cs - Part 3
using System;
using UnityEngine;
using HoloToolkit.Unity;
using HoloToolkit.Unity.SpatialMapping;
public class SpatialUnderstandingState : Singleton<SpatialUnderstandingState>
{
public float MinAreaForStats = 5.0f;
public TextMesh DebugDisplay;
@CameronVetter
CameronVetter / SpatialUnderstandingState.cs
Last active January 25, 2017 22:26
SpatialUnderstandingState.cs - Part 4
using System;
using UnityEngine;
using HoloToolkit.Unity;
using HoloToolkit.Unity.SpatialMapping;
public class SpatialUnderstandingState : Singleton<SpatialUnderstandingState>
{
public float MinAreaForStats = 5.0f;
public float MinAreaForComplete = 50.0f;
public float MinHorizAreaForComplete = 25.0f;
@CameronVetter
CameronVetter / SpatialUnderstandingState.cs
Last active April 24, 2017 02:16
SpatialUnderstandingState.cs Part 5 (Complete)
using System;
using UnityEngine;
using HoloToolkit.Unity;
using HoloToolkit.Unity.InputModule;
using HoloToolkit.Unity.SpatialMapping;
public class SpatialUnderstandingState : Singleton<SpatialUnderstandingState>, IInputClickHandler, ISourceStateHandler
{
public float MinAreaForStats = 5.0f;
public float MinAreaForComplete = 50.0f;
@CameronVetter
CameronVetter / BoxDrawer.cs
Created January 25, 2017 22:20
Box drawer used by my HoloLens tutorial
using UnityEngine;
using System.Collections.Generic;
public class BoxDrawer
{
// Consts
public const float DefaultLineWidth = 0.001f;
public const float DefaultBasisLength = 0.2f;
@CameronVetter
CameronVetter / ObjectPlacer.cs
Last active January 25, 2017 22:37
Version 1 for HoloLens Tutorial
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectPlacer : MonoBehaviour
{
public SpatialUnderstandingCustomMesh SpatialUnderstandingMesh;
private bool _timeToHideMesh;
@CameronVetter
CameronVetter / SpatialUnderstandingState.cs
Created January 26, 2017 02:08
Slight change to trigger create scene
public ObjectPlacer Placer;
private void Update()
{
// Updates
Update_DebugDisplay();
if (!_triggered && SpatialUnderstanding.Instance.ScanState == SpatialUnderstanding.ScanStates.Done)
{
_triggered = true;
@CameronVetter
CameronVetter / PlacementQuery.cs
Last active January 26, 2017 03:36
Defines a query to get solved by Spatial Understanding
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public enum ObjectType
{
SquareBuilding,
WideBuilding,
TallBuilding,
Tree,