public static void Weld_X(FloatEdges edges, float[,,] splats3D, int ch) { for (int z = 0; z < edges.rect.size.z; z++) { float edgeVal = edges.array[edges.rect.size.x * 2 + z]; splats3D[z, edges.rect.size.x - 1, ch] = edgeVal; } }
public static void Weld_Z(FloatEdges edges, float[,,] splats3D, int ch) { for (int x = 0; x < edges.rect.size.x; x++) { float edgeVal = edges.array[x]; splats3D[edges.rect.size.z - 1, x, ch] = edgeVal; } }
public static void Weld_X(FloatEdges edges, float[,] heights2D) { for (int z = 0; z < edges.rect.size.z; z++) { float edgeVal = edges.array[edges.rect.size.x * 2 + z]; heights2D[z, edges.rect.size.x - 1] = edgeVal; } }
public static void Weld_Z(FloatEdges edges, float[,] heights2D) { for (int x = 0; x < edges.rect.size.x; x++) { float edgeVal = edges.array[x]; heights2D[edges.rect.size.z - 1, x] = edgeVal; } }
public static void Weld_X(FloatEdges edges, FloatEdges deltas, float[,] heights2D, int margins = 10) { for (int z = 0; z < edges.rect.size.z; z++) { float edgeVal = edges.array[edges.rect.size.x * 2 + z]; float deltaVal = deltas.array[edges.rect.size.x * 2 + z]; heights2D[z, edges.rect.size.x - 1] = edgeVal; float innerDelta = (edgeVal + deltaVal) - heights2D[z, edges.rect.size.x - 2]; heights2D[z, edges.rect.size.x - 2] = edgeVal + deltaVal; //if (z>margins && z<edges.rect.size.z-margins-1) for (int i = 0; i < margins; i++) { heights2D[z, edges.rect.size.x - 3 - i] += innerDelta * (1 - 1f * i / margins); } } }
public static void Weld_Z(FloatEdges edges, FloatEdges deltas, float[,] heights2D, int margins = 10) { for (int x = 0; x < edges.rect.size.x; x++) { float edgeVal = edges.array[x]; float deltaVal = deltas.array[x]; heights2D[edges.rect.size.z - 1, x] = edgeVal; float innerDelta = (edgeVal + deltaVal) - heights2D[edges.rect.size.z - 2, x]; heights2D[edges.rect.size.z - 2, x] = edgeVal + deltaVal; //if (x>margins && x<edges.rect.size.x-margins-1) for (int i = 0; i < margins; i++) { heights2D[edges.rect.size.z - 3 - i, x] += innerDelta * (1 - 1f * i / margins); } } }
public static void Weld(FloatEdges edges, FloatEdges deltas, Coord direction, float[,] heights2D, int margins = 10) { if (direction.x == 1) { Weld_X(edges, deltas, heights2D, margins); } else if (direction.x == -1) { Weld_x(edges, deltas, heights2D, margins); } else if (direction.z == 1) { Weld_Z(edges, deltas, heights2D, margins); } else if (direction.z == -1) { Weld_z(edges, deltas, heights2D, margins); } }
public static void Weld(FloatEdges edges, Coord direction, float[,,] splats3D, int ch) { if (direction.x == 1) { Weld_X(edges, splats3D, ch); } else if (direction.x == -1) { Weld_x(edges, splats3D, ch); } else if (direction.z == 1) { Weld_Z(edges, splats3D, ch); } else if (direction.z == -1) { Weld_z(edges, splats3D, ch); } }
public static void Weld(FloatEdges edges, Coord direction, float[,] heights2D) { if (direction.x == 1) { Weld_X(edges, heights2D); } else if (direction.x == -1) { Weld_x(edges, heights2D); } else if (direction.z == 1) { Weld_Z(edges, heights2D); } else if (direction.z == -1) { Weld_z(edges, heights2D); } }