public InputVertex v2 ;
}
public unsafe static NativeMeshSOA Parse ( string path , Allocator outputA llocator = Allocator . Persistent , VertexAttribs vertexAttribs = VertexAttribs . Position , VertexOrder vertexOrder = VertexOrder . ByDefinition )
public unsafe static NativeMeshSOA Parse ( string path , Allocator a llocator = Allocator . Persistent , VertexAttribs vertexAttribs = VertexAttribs . Position , VertexOrder vertexOrder = VertexOrder . ByDefinition )
{
#if VERBOSE
Debug . LogFormat ( "trying {0}" , path ) ;
#endif
// allocate buffers
var inputPositions = new NativeArray < Vector3 > ( numPositions , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var inputTexCoords = new NativeArray < Vector2 > ( numTexCoords , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var inputNormals = new NativeArray < Vector3 > ( numNormals , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var inputFaces = new NativeArray < InputFace > ( numFaces , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var inputPositions = new NativeArray < Vector3 > ( numPositions , allocator , NativeArrayOptions . UninitializedMemory ) ;
var inputTexCoords = new NativeArray < Vector2 > ( numTexCoords , allocator , NativeArrayOptions . UninitializedMemory ) ;
var inputNormals = new NativeArray < Vector3 > ( numNormals , allocator , NativeArrayOptions . UninitializedMemory ) ;
var inputFaces = new NativeArray < InputFace > ( numFaces , allocator , NativeArrayOptions . UninitializedMemory ) ;
var outputIndicesLUT = new NativeHashMap < Hash128 , int > ( outputIndicesMax , Allocator . Temp ) ;
var outputPositions = new NativeArray < Vector3 > ( outputIndicesMax , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var outputTexCoords = new NativeArray < Vector2 > ( outputIndicesMax , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var outputNormals = new NativeArray < Vector3 > ( outputIndicesMax , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var outputIndices = new NativeArray < int > ( outputIndicesMax , Allocator . Temp , NativeArrayOptions . UninitializedMemory ) ;
var outputIndicesLUT = new NativeHashMap < Hash128 , int > ( outputIndicesMax , allocator ) ;
var outputPositions = new NativeArray < Vector3 > ( outputIndicesMax , allocator , NativeArrayOptions . UninitializedMemory ) ;
var outputTexCoords = new NativeArray < Vector2 > ( outputIndicesMax , allocator , NativeArrayOptions . UninitializedMemory ) ;
var outputNormals = new NativeArray < Vector3 > ( outputIndicesMax , allocator , NativeArrayOptions . UninitializedMemory ) ;
var outputIndices = new NativeArray < int > ( outputIndicesMax , allocator , NativeArrayOptions . UninitializedMemory ) ;
// read the data
numPositions = 0 ;
// copy to container
NativeMeshSOA mesh = new NativeMeshSOA ( )
{
vertexPositions = new NativeArray < Vector3 > ( numOutputVertices , outputA llocator, NativeArrayOptions . UninitializedMemory ) ,
vertexTexCoords = new NativeArray < Vector2 > ( numOutputVertices , outputA llocator, NativeArrayOptions . UninitializedMemory ) ,
vertexNormals = new NativeArray < Vector3 > ( numOutputVertices , outputA llocator, NativeArrayOptions . UninitializedMemory ) ,
vertexPositions = new NativeArray < Vector3 > ( numOutputVertices , a llocator, NativeArrayOptions . UninitializedMemory ) ,
vertexTexCoords = new NativeArray < Vector2 > ( numOutputVertices , a llocator, NativeArrayOptions . UninitializedMemory ) ,
vertexNormals = new NativeArray < Vector3 > ( numOutputVertices , a llocator, NativeArrayOptions . UninitializedMemory ) ,
faceIndices = new NativeArray < int > ( numOutputIndices , outputA llocator, NativeArrayOptions . UninitializedMemory ) ,
faceIndices = new NativeArray < int > ( numOutputIndices , a llocator, NativeArrayOptions . UninitializedMemory ) ,
faceIndicesCount = numOutputIndices ,
} ;