public static int Tango3DR_extractPreallocatedFullMesh(IntPtr context, ref APIMesh mesh) { mesh.numVertices = 0; mesh.numFaces = 0; mesh.numTextures = 0; return((int)Status.SUCCESS); }
public static int Tango3DR_extractPreallocatedMeshSegment( IntPtr context, ref GridIndex gridIndex, ref APIMesh mesh) { mesh.numVertices = 0; mesh.numFaces = 0; mesh.numTextures = 0; return((int)Status.SUCCESS); }
/// <summary> /// Extract a mesh for the entire 3D Reconstruction, into a suitable format for Unity Mesh. /// </summary> /// <returns> /// Returns Status.SUCCESS if the mesh is fully extracted and stored in the arrays. In this case, numVertices /// and numTriangles will say how many vertices and triangles are used, the rest of the array is untouched. /// /// Returns Status.INSUFFICIENT_SPACE if the mesh is partially extracted and stored in the arrays. numVertices /// and numTriangles have the same meaning as if Status.SUCCESS is returned, but in this case the array should /// grow. /// /// Returns Status.ERROR or Status.INVALID if some other error occurs. /// </returns> /// <param name="vertices">On successful extraction this will get filled out with the vertex positions.</param> /// <param name="normals">On successful extraction this will get filled out whith vertex normals.</param> /// <param name="colors">On successful extraction this will get filled out with vertex colors.</param> /// <param name="triangles">On succesful extraction this will get filled out with vertex indexes.</param> /// <param name="numVertices">Number of vertexes filled out.</param> /// <param name="numTriangles">Number of triangles filled out.</param> internal Status ExtractWholeMesh( Vector3[] vertices, Vector3[] normals, Color32[] colors, int[] triangles, out int numVertices, out int numTriangles) { APIMeshGCHandles pinnedHandles = APIMeshGCHandles.Alloc(vertices, normals, colors, triangles); APIMesh mesh = APIMesh.FromArrays(vertices, normals, colors, triangles); int result = API.Tango3DR_extractPreallocatedFullMesh(m_context, ref mesh); numVertices = (int)mesh.numVertices; numTriangles = (int)mesh.numFaces; pinnedHandles.Free(); return((Status)result); }
public static extern int Tango3DR_extractPreallocatedFullMesh(IntPtr context, ref APIMesh mesh);
public static extern int Tango3DR_extractPreallocatedMeshSegment( IntPtr context, ref GridIndex gridIndex, ref APIMesh mesh);
public static int Tango3DR_extractPreallocatedFullMesh(IntPtr context, ref APIMesh mesh) { mesh.numVertices = 0; mesh.numFaces = 0; mesh.numTextures = 0; return (int)Status.SUCCESS; }
public static int Tango3DR_extractPreallocatedMeshSegment( IntPtr context, ref GridIndex gridIndex, ref APIMesh mesh) { mesh.numVertices = 0; mesh.numFaces = 0; mesh.numTextures = 0; return (int)Status.SUCCESS; }