protected virtual IMeshingJob createMeshingJob(MeshJobData data)
        {
            var job = new MeshingJob();

            job.data            = data;
            job.cullfaces       = CullFaces;
            job.directionHelper = directionRotator;
            //TODO use allocator temp job if job can be guaranteed to take less than 4 frames
            job.nonCollidableQueue = new NativeList <MeshingJob.DoLater>(Allocator.Persistent);
            return(job);
        }
Ejemplo n.º 2
0
        protected override IMeshingJob createMeshingJob(MeshJobData data)
        {
            var job = new GreedyMeshingJob();

            job.data             = data;
            job.rotatedVoxelsMap = new NativeHashMap <int, VoxelRotation>(job.data.rotatedVoxels.Length, Allocator.Persistent);
            job.directionRotator = directionRotator;
            //TODO use allocator temp job if job can be guaranteed to take less than 4 frames
            job.nonCollidableQueue = new NativeList <GreedyMeshingJob.DoLater>(Allocator.Persistent);
            var size = data.dimensions.x;

            job.maskPositive = new NativeArray <GreedyMeshingJob.FaceDescriptor>((size + 1) * (size + 1), Allocator.Persistent);
            job.maskNegative = new NativeArray <GreedyMeshingJob.FaceDescriptor>((size + 1) * (size + 1), Allocator.Persistent);

            return(job);
        }