Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating remote mapping for IL2CPP builds in master #965

Merged
merged 2 commits into from
Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 41 additions & 17 deletions Assets/HoloToolkit-Tests/SpatialMapping/Scenes/RemoteMapping.unity
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
SceneSettings:
OcclusionCullingSettings:
m_ObjectHideFlags: 0
m_PVSData:
m_PVSObjectsArray: []
m_PVSPortalsArray: []
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
Expand All @@ -25,6 +25,7 @@ RenderSettings:
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
Expand All @@ -37,11 +38,11 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44692492, g: 0.4967869, b: 0.57508546, a: 1}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
Expand All @@ -53,7 +54,7 @@ LightmapSettings:
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 4
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
Expand All @@ -66,29 +67,50 @@ LightmapSettings:
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_DirectLightInLightProbes: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
cellSize: 0.16666667
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &920116912
Prefab:
Expand Down Expand Up @@ -221,10 +243,10 @@ GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
serializedVersion: 5
m_Component:
- 4: {fileID: 1615710845}
- 108: {fileID: 1615710844}
- component: {fileID: 1615710845}
- component: {fileID: 1615710844}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
Expand All @@ -239,7 +261,7 @@ Light:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1615710843}
m_Enabled: 1
serializedVersion: 7
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
Expand All @@ -264,6 +286,8 @@ Light:
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1615710845
Expand All @@ -275,7 +299,7 @@ Transform:
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
16 changes: 10 additions & 6 deletions Assets/HoloToolkit/SpatialMapping/Prefabs/RemoteMapping.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
serializedVersion: 5
m_Component:
- 4: {fileID: 4000013382681936}
- 114: {fileID: 114000013950815180}
- 114: {fileID: 114000010791004466}
- 114: {fileID: 114000012256053342}
- 114: {fileID: 114000013862356290}
- component: {fileID: 4000013382681936}
- component: {fileID: 114000013950815180}
- component: {fileID: 114000010791004466}
- component: {fileID: 114000012256053342}
- component: {fileID: 114000013862356290}
m_Layer: 0
m_Name: RemoteMapping
m_TagString: Untagged
Expand Down Expand Up @@ -67,6 +67,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e0e40e7a40c41984bbec8aaa64292522, type: 3}
m_Name:
m_EditorClassIdentifier:
RemoteMappingKey: 110
SendMeshesKeyword: send meshes
--- !u!114 &114000013862356290
MonoBehaviour:
m_ObjectHideFlags: 1
Expand All @@ -79,6 +81,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MeshFileName: roombackup
LoadFileKey: 108
SaveFileKey: 107
--- !u!114 &114000013950815180
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#if !UNITY_EDITOR && UNITY_WSA
using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.Streams;
#endif

namespace HoloToolkit.Unity.SpatialMapping
Expand Down Expand Up @@ -159,7 +160,8 @@ private static Stream OpenFileForRead(string folderName, string fileName)
{
StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(folderName);
StorageFile file = await folder.GetFileAsync(fileName);
stream = await file.OpenStreamForReadAsync();
IRandomAccessStreamWithContentType randomAccessStream = await file.OpenReadAsync();
stream = randomAccessStream.AsStreamForRead();
});
task.Wait();
task.Result.Wait();
Expand All @@ -186,7 +188,8 @@ private static Stream OpenFileForWrite(string folderName, string fileName)
{
StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(folderName);
StorageFile file = await folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);
stream = await file.OpenStreamForWriteAsync();
IRandomAccessStream randomAccessStream = await file.OpenAsync(FileAccessMode.ReadWrite);
stream = randomAccessStream.AsStreamForWrite();
});
task.Wait();
task.Result.Wait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ private void Update()
// Pass the data to the mesh serializer.
List<Mesh> meshes = new List<Mesh>(SimpleMeshSerializer.Deserialize(dataBuffer));

if (meshes.Count > 0)
{
// Use the network-based mapping source to receive meshes in the Unity editor.
SpatialMappingManager.Instance.SetSpatialMappingSource(this);
}

// For each mesh, create a GameObject to render it.
for (int index = 0; index < meshes.Count; index++)
{
Expand Down