BecomeYDummyOf() public method

public BecomeYDummyOf ( Voxel, voxel, float offset ) : void
voxel Voxel,
offset float
return void
コード例 #1
0
ファイル: VoxelGrid.cs プロジェクト: KasparasK/SBRemake
    private void TriangulateGapRow()
    {
        dummyY.BecomeYDummyOf(yNeighbor.voxels[0], gridSize);
        int cells  = resolution - 1;
        int offset = cells * resolution;

        SwapRowCaches();
        CacheFirstCorner(dummyY);
        CacheNextMiddleEdge(voxels[cells * resolution], dummyY);

        for (int x = 0; x < cells; x++)
        {
            Voxel dummySwap = dummyT;
            dummySwap.BecomeYDummyOf(yNeighbor.voxels[x + 1], gridSize);
            dummyT = dummyY;
            dummyY = dummySwap;
            CacheNextEdgeAndCorner(x, dummyT, dummyY);
            CacheNextMiddleEdge(voxels[x + offset + 1], dummyY);
            TriangulateCell(x, voxels[x + offset], voxels[x + offset + 1], dummyT, dummyY);
        }

        if (xNeighbor != null)
        {
            dummyT.BecomeXYDummyOf(xyNeighbor.voxels[0], gridSize);
            CacheNextEdgeAndCorner(cells, dummyY, dummyT);
            CacheNextMiddleEdge(dummyX, dummyT);
            TriangulateCell(cells, voxels[voxels.Length - 1], dummyX, dummyY, dummyT);
        }
    }
コード例 #2
0
    private void TriangulateGapRow()
    {
        dummyY.BecomeYDummyOf(yNeighbor.voxels[0], gridSize);
        int cells  = resolution - 1;
        int offset = cells * resolution;

        for (int x = 0; x < cells; x++)
        {
            Voxel dummySwap = dummyT;
            dummySwap.BecomeYDummyOf(yNeighbor.voxels[x + 1], gridSize);
            dummyT = dummyY;
            dummyY = dummySwap;
            TriangulateCell(voxels[x + offset], voxels[x + offset + 1], dummyT, dummyY);
        }
        if (xNeighbor != null)
        {
            dummyT.BecomeXYDummyOf(xyNeighbor.voxels[0], gridSize);
            TriangulateCell(voxels[voxels.Length - 1], dummyX, dummyY, dummyT);
        }
    }