123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790 |
-
- namespace NRKernal
- {
- using System;
- using System.Runtime.InteropServices;
- using System.Collections.Generic;
- using System.Linq;
- using UnityEngine;
- using System.Collections;
-
- public class NativeMeshing
- {
-
- private UInt64 m_MeshingHandle = 0;
-
- private UInt64 m_RequestMeshInfoHandle = 0;
-
- private UInt64 m_MeshInfoHandle = 0;
-
- private UInt64 m_RequestMeshDetailHandle = 0;
-
- private UInt64 m_MeshDetailHandle = 0;
-
- public struct BlockInfo
- {
- public ulong timestamp;
- public NRMeshingBlockState blockState;
- public NRMeshingFlags meshingFlag;
- }
-
- private Dictionary<ulong, BlockInfo> m_BlockInfos = new Dictionary<ulong, BlockInfo>();
-
-
-
-
- public bool Create()
- {
- var result = NativeApi.NRMeshingCreate(ref m_MeshingHandle);
- NRDebugger.Info("[NativeMeshing] NRMeshingCreate result: {0} MeshingHandle: {1}.", result, m_MeshingHandle);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool Start()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingStart Zero MeshingHandle.");
- return false;
- }
- var result = NativeApi.NRMeshingStart(m_MeshingHandle);
- NRDebugger.Info("[NativeMeshing] NRMeshingStart result: {0}.", result);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool Pause()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingPause Zero MeshingHandle.");
- return false;
- }
- var result = NativeApi.NRMeshingPause(m_MeshingHandle);
- NRDebugger.Info("[NativeMeshing] NRMeshingPause result: {0}.", result);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool Resume()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingResume Zero MeshingHandle.");
- return false;
- }
- var result = NativeApi.NRMeshingResume(m_MeshingHandle);
- NRDebugger.Info("[NativeMeshing] NRMeshingResume result: {0}.", result);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool Stop()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingStop Zero MeshingHandle.");
- return false;
- }
- NativeResult result = NativeApi.NRMeshingStop(m_MeshingHandle);
- NRDebugger.Info("[NativeMeshing] NRMeshingStop result: {0}.", result);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool Destroy()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingDestroy Zero MeshingHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshingDestroy(m_MeshingHandle);
- NRDebugger.Info("[NativeMeshing] NRMeshingDestroy result: {0}.", result);
- m_MeshingHandle = 0;
- return result == NativeResult.Success;
- }
-
-
-
-
-
- public bool SetMeshingFlags(NRMeshingFlags flags)
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingSetFlags Zero MeshingHandle.");
- return false;
- }
- var result = NativeApi.NRMeshingSetFlags(m_MeshingHandle, flags);
- NRDebugger.Debug("[NativeMeshing] NRMeshingSetFlags result: {0} flag: {1}.", result, flags);
- return result == NativeResult.Success;
- }
-
-
-
-
-
-
- public bool RequestMeshInfo(Vector3 boundingBoxSize, Pose pose)
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingRequestMeshInfo Zero MeshingHandle.");
- return false;
- }
- if (m_MeshInfoHandle != 0)
- {
- DestroyMeshInfo();
- }
- if (m_RequestMeshInfoHandle != 0)
- {
- DestroyMeshInfoRequest();
- }
- NRExtents extents = new NRExtents
- {
- transform = new NRTransform
- {
- position = new NativeVector3f(pose.position),
- rotation = new NativeVector4f(pose.rotation.x, pose.rotation.y, pose.rotation.z, pose.rotation.w)
- },
- extents = new NativeVector3f(boundingBoxSize)
- };
- var result = NativeApi.NRMeshingRequestMeshInfo(m_MeshingHandle, ref extents, ref m_RequestMeshInfoHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshingRequestMeshInfo result: {0} Handle: {1}.", result, m_RequestMeshInfoHandle);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool GetMeshInfoResult()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingGetMeshInfoResult Zero MeshingHandle.");
- return false;
- }
- if (m_RequestMeshInfoHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingGetMeshInfoResult Zero RequestMeshInfoHandle.");
- return false;
- }
- if (m_MeshInfoHandle != 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingGetMeshInfoResult Nonzero MeshInfoHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshingGetMeshInfoResult(m_MeshingHandle, m_RequestMeshInfoHandle, ref m_MeshInfoHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshingGetMeshInfoResult result: {0} Handle: {1}.", result, m_MeshInfoHandle);
- return result == NativeResult.Success;
- }
-
-
-
-
- public ulong GetMeshInfoTimestamp()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshInfoGetTimestamp Zero MeshingHandle.");
- return 0;
- }
- if (m_MeshInfoHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshInfoGetTimestamp Zero MeshInfoHandle.");
- return 0;
- }
- ulong timeStamp = 0;
- NativeResult result = NativeApi.NRMeshInfoGetTimestamp(m_MeshingHandle, m_MeshInfoHandle, ref timeStamp);
- NRDebugger.Debug("[NativeMeshing] NRMeshInfoGetTimestamp result: {0} timestamp: {1}.", result, timeStamp);
- return timeStamp;
- }
-
-
-
-
- public bool GetBlockInfoData()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshInfoGetBlockInfoCount Zero MeshingHandle.");
- return false;
- }
- if (m_MeshInfoHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshInfoGetBlockInfoCount Zero MeshInfoHandle.");
- return false;
- }
- uint blockCount = 0;
- m_BlockInfos.Clear();
- NativeResult retResult = NativeApi.NRMeshInfoGetBlockInfoCount(m_MeshingHandle, m_MeshInfoHandle, ref blockCount);
- NRDebugger.Debug("[NativeMeshing] NRMeshInfoGetBlockInfoCount result: {0} blockCount: {1}.", retResult, blockCount);
- for (uint i = 0; i < blockCount; i++)
- {
- UInt64 blockInfoHandle = 0;
- NativeResult result = NativeApi.NRMeshInfoGetBlockInfoData(m_MeshingHandle, m_MeshInfoHandle, i, ref blockInfoHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshInfoGetBlockInfoData result: {0} Handle: {1}.", result, blockInfoHandle);
- BlockInfo blockInfo = new BlockInfo();
- ulong identifier = 0;
- result = NativeApi.NRBlockInfoGetBlockIdentifier(m_MeshingHandle, blockInfoHandle, ref identifier);
- NRDebugger.Debug("[NativeMeshing] NRBlockInfoGetBlockIdentifier result: {0} identifier: {1}.", result, identifier);
- result = NativeApi.NRBlockInfoGetTimestamp(m_MeshingHandle, blockInfoHandle, ref blockInfo.timestamp);
- NRDebugger.Debug("[NativeMeshing] NRBlockInfoGetTimestamp result: {0} timestamp: {1}.", result, blockInfo.timestamp);
- result = NativeApi.NRBlockInfoGetBlockState(m_MeshingHandle, blockInfoHandle, ref blockInfo.blockState);
- NRDebugger.Debug("[NativeMeshing] NRBlockInfoGetBlockState result: {0} blockState: {1}.", result, blockInfo.blockState);
- result = NativeApi.NRBlockInfoDestroy(m_MeshingHandle, blockInfoHandle);
- NRDebugger.Debug("[NativeMeshing] NRBlockInfoDestroy: {0}.", result);
- m_BlockInfos.Add(identifier, blockInfo);
- }
- return retResult == NativeResult.Success;
- }
-
-
-
-
- public bool DestroyMeshInfo()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshInfoDestroy Zero MeshingHandle.");
- return false;
- }
- if (m_MeshInfoHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshInfoDestroy Zero MeshInfoHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshInfoDestroy(m_MeshingHandle, m_MeshInfoHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshInfoDestroy result: {0}.", result);
- m_MeshInfoHandle = 0;
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool DestroyMeshInfoRequest()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingMeshInfoRequestDestroy Zero MeshingHandle.");
- return false;
- }
- if (m_RequestMeshInfoHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingMeshInfoRequestDestroy Zero RequestMeshInfoHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshingMeshInfoRequestDestroy(m_MeshingHandle, m_RequestMeshInfoHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshingMeshInfoRequestDestroy result: {0}.", result);
- m_RequestMeshInfoHandle = 0;
- return result == NativeResult.Success;
- }
-
-
-
-
-
- public bool RequestMeshDetail(Func<KeyValuePair<ulong, BlockInfo>, bool> predicate = null)
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingRequestMeshDetail Zero MeshingHandle.");
- return false;
- }
- if (m_MeshDetailHandle != 0)
- {
- DestroyMeshDetail();
- }
- if (m_RequestMeshDetailHandle != 0)
- {
- DestroyMeshDetailRequest();
- }
- ulong[] blockIdentifiers = m_BlockInfos.Where(predicate ?? (p => true)).Select(p => p.Key).ToArray();
- if (blockIdentifiers.Length == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingRequestMeshDetail Zero blockIdentifier.");
- return false;
- }
- var result = NativeApi.NRMeshingRequestMeshDetail(m_MeshingHandle, (uint)blockIdentifiers.Length, blockIdentifiers, ref m_RequestMeshDetailHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshingRequestMeshDetail result: {0} Handle: {1}.", result, m_RequestMeshDetailHandle);
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool GetMeshDetailResult()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingGetMeshDetailResult Zero MeshingHandle.");
- return false;
- }
- if (m_RequestMeshDetailHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingGetMeshDetailResult Zero RequestMeshDetailHandle.");
- return false;
- }
- if (m_MeshDetailHandle != 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingGetMeshDetailResult Nonzero MeshDetailHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshingGetMeshDetailResult(m_MeshingHandle, m_RequestMeshDetailHandle, ref m_MeshDetailHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshingGetMeshDetailResult result: {0} Handle: {1}.", result, m_MeshDetailHandle);
- return result == NativeResult.Success;
- }
-
-
-
-
- public ulong GetMeshDetailTimestamp()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshDetailGetTimestamp Zero MeshingHandle.");
- return 0;
- }
- if (m_MeshDetailHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshDetailGetTimestamp Zero MeshDetailHandle.");
- return 0;
- }
- ulong timeStamp = 0;
- NativeResult result = NativeApi.NRMeshDetailGetTimestamp(m_MeshingHandle, m_MeshDetailHandle, ref timeStamp);
- NRDebugger.Debug("[NativeMeshing] NRMeshDetailGetTimestamp: {0} {1}.", result, timeStamp);
- return timeStamp;
- }
-
-
-
-
- public IEnumerator GetMeshDetailData(Action<ulong, NRMeshingBlockState, Mesh> action)
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshDetailGetBlockDetailCount Zero MeshingHandle.");
- yield break;
- }
- if (m_MeshDetailHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshDetailGetBlockDetailCount Zero MeshDetailHandle.");
- yield break;
- }
- ulong blockDetailCount = 0;
- NativeResult retResult = NativeApi.NRMeshDetailGetBlockDetailCount(m_MeshingHandle, m_MeshDetailHandle, ref blockDetailCount);
- NRDebugger.Debug("[NativeMeshing] NRMeshDetailGetBlockDetailCount result: {0} blockDetailCount: {1}.", retResult, blockDetailCount);
- for (uint i = 0; i < blockDetailCount; i++)
- {
- UInt64 blockDetailHandle = 0;
- NativeResult result = NativeApi.NRMeshDetailGetBlockDetailData(m_MeshingHandle, m_MeshDetailHandle, i, ref blockDetailHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshDetailGetBlockDetailData result: {0} Handle: {1}.", result, blockDetailHandle);
- ulong identifier = 0;
- result = NativeApi.NRBlockDetailGetBlockIdentifier(m_MeshingHandle, blockDetailHandle, ref identifier);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetBlockIdentifier result: {0} identifier: {1}.", result, identifier);
- NRMeshingFlags meshingFlag = NRMeshingFlags.NR_MESHING_FLAGS_NULL;
- result = NativeApi.NRBlockDetailGetFlags(m_MeshingHandle, blockDetailHandle, ref meshingFlag);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetFlags result: {0} meshingFlag: {1}.", result, meshingFlag);
- uint vertexCount = 0;
- result = NativeApi.NRBlockDetailGetVertexCount(m_MeshingHandle, blockDetailHandle, ref vertexCount);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetVertexCount result: {0} vertexCount: {1}.", result, vertexCount);
- if (vertexCount != 0)
- {
- NativeVector3f[] outVertices = new NativeVector3f[vertexCount];
- result = NativeApi.NRBlockDetailGetVertices(m_MeshingHandle, blockDetailHandle, outVertices);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetVertices result: {0}.", result);
- NativeVector3f[] outNormals = new NativeVector3f[vertexCount];
- result = NativeApi.NRBlockDetailGetNormals(m_MeshingHandle, blockDetailHandle, outNormals);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetNormals result: {0}.", result);
- uint indexCount = 0;
- result = NativeApi.NRBlockDetailGetIndexCount(m_MeshingHandle, blockDetailHandle, ref indexCount);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetIndexCount result: {0} indexCount: {1}.", result, indexCount);
- ushort[] outIndex = new ushort[indexCount];
- result = NativeApi.NRBlockDetailGetIndeices(m_MeshingHandle, blockDetailHandle, outIndex);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailGetIndeices result: {0}.", result);
- Vector3[] vertices = new Vector3[vertexCount];
- Vector3[] normals = new Vector3[vertexCount];
- for (int j = 0; j < vertexCount; j++)
- {
- vertices[j] = outVertices[j].ToUnityVector3();
- normals[j] = outNormals[j].ToUnityVector3();
- }
- int[] triangles = new int[indexCount];
- for (int j = 0; j < indexCount; j++)
- {
- triangles[j] = outIndex[j];
- }
- Mesh mesh = new Mesh
- {
- vertices = vertices,
- normals = normals,
- triangles = triangles
- };
- mesh.RecalculateBounds();
- action?.Invoke(identifier, m_BlockInfos[identifier].blockState, mesh);
- NRDebugger.Debug("[NativeMeshing] GetMeshDetailData Invoke: {0} {1} {2}.", identifier, m_BlockInfos[identifier].blockState, mesh.vertexCount);
- }
- result = NativeApi.NRBlockDetailDestroy(m_MeshingHandle, blockDetailHandle);
- NRDebugger.Debug("[NativeMeshing] NRBlockDetailDestroy result: {0}.", result);
- yield return null;
- }
- }
-
-
-
-
- public bool DestroyMeshDetail()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshDetailDestroy Zero MeshingHandle.");
- return false;
- }
- if (m_MeshDetailHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshDetailDestroy Zero MeshDetailHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshDetailDestroy(m_MeshingHandle, m_MeshDetailHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshDetailDestroy.");
- m_MeshDetailHandle = 0;
- return result == NativeResult.Success;
- }
-
-
-
-
- public bool DestroyMeshDetailRequest()
- {
- if (m_MeshingHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingMeshDetailRequestDestroy Zero MeshingHandle.");
- return false;
- }
- if (m_RequestMeshDetailHandle == 0)
- {
- NRDebugger.Warning("[NativeMeshing] NRMeshingMeshDetailRequestDestroy Zero RequestMeshDetailHandle.");
- return true;
- }
- NativeResult result = NativeApi.NRMeshingMeshDetailRequestDestroy(m_MeshingHandle, m_RequestMeshDetailHandle);
- NRDebugger.Debug("[NativeMeshing] NRMeshingMeshDetailRequestDestroy.");
- m_RequestMeshDetailHandle = 0;
- return result == NativeResult.Success;
- }
- private partial struct NativeApi
- {
- #region LifeCycle
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingCreate(ref UInt64 out_meshing_handle);
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingStart(UInt64 meshing_handle);
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingPause(UInt64 meshing_handle);
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingResume(UInt64 meshing_handle);
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingStop(UInt64 meshing_handle);
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingDestroy(UInt64 meshing_handle);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingSetFlags(UInt64 meshing_handle, NRMeshingFlags flags);
- #endregion
- #region MeshInfo
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingRequestMeshInfo(UInt64 meshing_handle, ref NRExtents extents, ref UInt64 out_request_mesh_info_handle);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingGetMeshInfoResult(UInt64 meshing_handle, UInt64 request_mesh_info_handle, ref UInt64 out_mesh_info_handle);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshInfoGetTimestamp(UInt64 meshing_handle, UInt64 mesh_info_handle, ref ulong out_hmd_time_nanos);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshInfoGetBlockInfoCount(UInt64 meshing_handle, UInt64 mesh_info_handle, ref uint out_block_info_count);
-
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshInfoGetBlockInfoData(UInt64 meshing_handle, UInt64 mesh_info_handle, uint index, ref UInt64 out_block_info_handle);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockInfoGetBlockIdentifier(UInt64 meshing_handle, UInt64 block_info_handle, ref ulong out_block_identifier);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockInfoGetTimestamp(UInt64 meshing_handle, UInt64 block_info_handle, ref ulong out_hmd_time_nanos);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockInfoGetBlockState(UInt64 meshing_handle, UInt64 block_info_handle, ref NRMeshingBlockState out_block_state);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockInfoDestroy(UInt64 meshing_handle, UInt64 block_info_handle);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshInfoDestroy(UInt64 meshing_handle, UInt64 mesh_info_handle);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingMeshInfoRequestDestroy(UInt64 meshing_handle, UInt64 request_mesh_info_handle);
- #endregion
- #region MeshDetail
-
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingRequestMeshDetail(UInt64 meshing_handle, uint block_identifier_count, ulong[] block_identifiers, ref UInt64 out_request_mesh_detail_handle);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingGetMeshDetailResult(UInt64 meshing_handle, UInt64 request_mesh_detail_handle, ref UInt64 out_mesh_detail_handle);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshDetailGetTimestamp(UInt64 meshing_handle, UInt64 mesh_detail_handle, ref ulong out_hmd_time_nanos);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshDetailGetBlockDetailCount(UInt64 meshing_handle, UInt64 mesh_detail_handle, ref ulong out_block_detail_count);
-
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshDetailGetBlockDetailData(UInt64 meshing_handle, UInt64 mesh_detail_handle, uint index, ref UInt64 out_block_detail_handle);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetBlockIdentifier(UInt64 meshing_handle, UInt64 block_detail_handle, ref ulong out_block_identifier);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetFlags(UInt64 meshing_handle, UInt64 block_detail_handle, ref NRMeshingFlags out_flags);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetVertexCount(UInt64 meshing_handle, UInt64 block_detail_handle, ref uint out_vertex_count);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetVertices(UInt64 meshing_handle, UInt64 block_detail_handle, NativeVector3f[] out_vertices);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetNormals(UInt64 meshing_handle, UInt64 block_detail_handle, NativeVector3f[] out_normals);
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetIndexCount(UInt64 meshing_handle, UInt64 block_detail_handle, ref uint out_face_vertex_index_count);
-
-
-
-
-
-
-
-
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailGetIndeices(UInt64 meshing_handle, UInt64 block_detail_handle, ushort[] out_face_vertices_index);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRBlockDetailDestroy(UInt64 meshing_handle, UInt64 block_detail_handle);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshDetailDestroy(UInt64 meshing_handle, UInt64 mesh_detail_handle);
-
-
-
-
- [DllImport(NativeConstants.NRNativeLibrary)]
- public static extern NativeResult NRMeshingMeshDetailRequestDestroy(UInt64 meshing_handle, UInt64 request_mesh_detail_handle);
- #endregion
- };
- }
- }
|