Skip to content

Instantly share code, notes, and snippets.

View CameronVetter's full-sized avatar

Cameron Vetter CameronVetter

View GitHub Profile
using HoloToolkit.Unity;
using UnityEngine;
public class PlacementResult
{
public PlacementResult(SpatialUnderstandingDllObjectPlacement.ObjectPlacementResult result, Vector3 dimensions, ObjectType objType)
{
_result = result;
Dimensions = dimensions;
ObjType = objType;
@CameronVetter
CameronVetter / ObjectPlacer.cs
Created January 27, 2017 03:23
Version 2, draw one thing as a box
using System;
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectPlacer : MonoBehaviour
{
public bool DrawDebugBoxes = true;
public SpatialUnderstandingCustomMesh SpatialUnderstandingMesh;
@CameronVetter
CameronVetter / ObjectPlacer.cs
Last active January 30, 2017 16:12
Version 3 - draw and scale a hologram
using System;
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectPlacer : MonoBehaviour
{
public bool DrawDebugBoxes = false;
public SpatialUnderstandingCustomMesh SpatialUnderstandingMesh;
@CameronVetter
CameronVetter / ObjectCollectionManager.cs
Last active April 28, 2017 01:46
Version 1 of ObjectCollectionManager, handles group of what type of hologram
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectCollectionManager : Singleton<ObjectCollectionManager>
{
[Tooltip("A collection of Wide building prefabs to generate in the world.")]
public List<GameObject> WideBuildingPrefabs;
@CameronVetter
CameronVetter / ObjectPlacer.cs
Created April 28, 2017 01:47
Version 4 - integrated with ObjectCollectionManager
using System;
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectPlacer : MonoBehaviour
{
public bool DrawDebugBoxes = false;
public bool DrawBuildings = true;
@CameronVetter
CameronVetter / ObjectCollectionManager.cs
Created April 28, 2017 02:16
Version 2 of ObjectCollectionManager - added multiple building types and trees
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectCollectionManager : Singleton<ObjectCollectionManager>
{
[Tooltip("A collection of square building prefabs to generate in the world.")]
public List<GameObject> SquareBuildingPrefabs;
@CameronVetter
CameronVetter / ObjectPlacer.cs
Created April 28, 2017 02:23
Version 5 - Create more buildings and Trees
using System;
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectPlacer : MonoBehaviour
{
public bool DrawDebugBoxes = false;
public bool DrawBuildings = true;
public bool DrawTrees = true;
@CameronVetter
CameronVetter / ObjectCollectionManager.cs
Last active April 30, 2017 22:59
Version 3 - Adds Colliders to Holograms to enable cursor and physics
using System.Collections.Generic;
using HoloToolkit.Unity;
using UnityEngine;
public class ObjectCollectionManager : Singleton<ObjectCollectionManager>
{
[Tooltip("A collection of square building prefabs to generate in the world.")]
public List<GameObject> SquareBuildingPrefabs;
@CameronVetter
CameronVetter / Speech.cs
Created May 4, 2017 01:09
Version 1 - enable and disable the spatial mesh visualization
using HoloToolkit.Unity;
using UnityEngine;
public class Speech : MonoBehaviour
{
public SpatialUnderstandingCustomMesh SpatialUnderstandingMesh;
public void ToggleMesh()
{
@CameronVetter
CameronVetter / ObjectPlacer.cs
Last active September 10, 2017 21:54
Enable Occlusion snippet
public Material OccludedMaterial;
private void HideGridEnableOcclulsion()
{
SpatialUnderstandingMesh.MeshMaterial = OccludedMaterial;
}