//COPY PASTE OF ABOVE FUNC.! private List <PTwo> coordsXZOnInsideEdgeInDirection(Quad area, Direction dir) { PTwo nudge = DirectionUtil.NudgeCoordForDirectionPTwo(dir); Axis axis = DirectionUtil.AxisForDirection(dir); PTwo startPoint = area.origin; if (DirectionUtil.IsPosDirection(dir)) { if (axis == Axis.X) { startPoint.t += area.dimensions.t; } else { startPoint.s += area.dimensions.s; } } PTwo iterNudge = PTwo.Abs(nudge).flipSAndT(); int length = axis == Axis.X ? area.dimensions.t : area.dimensions.s; PTwo cursorPoint = startPoint; List <PTwo> result = new List <PTwo>(); for (int i = 0; i < length; ++i) { result.Add(cursorPoint + nudge); cursorPoint += iterNudge; } return(result); }
public List <DiscreteDomainRangeList <LightColumn> > columnsOnBorderOfQuadInDirection(Quad areaXZ, Direction dir, bool wantWithin) { SimpleRange xRange = areaXZ.sSimpleRange(); SimpleRange zRange = areaXZ.tSimpleRange(); SimpleRange longRange; SimpleRange shortRange; int shortRangeStart; Axis axis = DirectionUtil.AxisForDirection(dir); if (axis == Axis.X) { longRange = zRange; shortRange = xRange; } else { longRange = xRange; shortRange = zRange; } if (DirectionUtil.IsPosDirection(dir)) { shortRangeStart = wantWithin ? shortRange.extentMinusOne() : shortRange.extent(); } else { shortRangeStart = wantWithin ? shortRange.start : shortRange.start - 1; } shortRange = new SimpleRange(shortRangeStart, 1); Quad area = (axis == Axis.X) ? new Quad(new PTwo(shortRange.start, longRange.start), new PTwo(shortRange.range, longRange.range)) : new Quad(new PTwo(longRange.start, shortRange.start), new PTwo(longRange.range, shortRange.range)); return(columnsWithin(area)); }
//COPY PASTE OF ABOVE FUNC.! private void updateSurfaceHeightsInDirection(Quad area, Direction dir) { // return; PTwo nudge = DirectionUtil.NudgeCoordForDirectionPTwo(dir); Axis axis = DirectionUtil.AxisForDirection(dir); PTwo startPoint = area.origin; if (DirectionUtil.IsPosDirection(dir)) { if (axis == Axis.X) { startPoint.t += area.dimensions.t; } else { startPoint.s += area.dimensions.s; } } PTwo iterNudge = PTwo.Abs(nudge).flipSAndT(); int length = axis == Axis.X ? area.dimensions.t : area.dimensions.s; PTwo cursorPoint = startPoint; List <LightColumn> needUpdateColumns = new List <LightColumn>(); for (int i = 0; i < length; ++i) { // DiscreteDomainRangeList<LightColumn> licols = m_lightColumnMap[cursorPoint + nudge]; // if (licols == null) // continue; DiscreteDomainRangeList <LightColumn> insideCols = m_lightColumnMap[cursorPoint]; if (insideCols == null) { continue; } int surfaceHeightJustBeyondBorder = this.m_noisePatch.highestPointAtPatchRelativeCoord(cursorPoint + nudge); for (int j = 0; j < insideCols.Count; ++j) { LightColumn insideCol = insideCols[j]; if (insideCol.heightIsBelowExtent(surfaceHeightJustBeyondBorder)) { addToSurfaceExposedColumnIfNotContains(insideCol); needUpdateColumns.Add(insideCol); } } cursorPoint += iterNudge; } foreach (LightColumn col in needUpdateColumns) { updateColumnAt(col, col.coord, null, PatchQuad); } }
/* * Assumes vec starts in 'standard' y pos is 'up' space */ private static Vector3 ConvertFromYPosToDirection(Vector3 vec, Direction dir) { Axis axis = DirectionUtil.AxisForDirection(dir); vec = convertFromYAxisToAxis(vec, axis); if (!DirectionUtil.IsPosDirection(dir)) { vec.y *= -1.0f; } return(vec); }
private List <Vector3> pointsOnHemishpereInDirection(Direction dir) { return(null); List <Vector3> points = new List <Vector3>(); // hemisphere picking Axis axis = DirectionUtil.AxisForDirection(dir); }
private List <Window>[] windowsTouchingEdgeOfNoisePatchNeighborInDirection(Direction dir) { Axis axis = DirectionUtil.AxisForDirection(dir); if (axis == Axis.X) { return(windowsWithEdgeFlushToXEdge(DirectionUtil.IsPosDirection(dir))); } return(windowsWithEdgeFlushToZEdge(DirectionUtil.IsPosDirection(dir))); }
public void updateWindowsFlushWithEdgeInNeighborDirection(byte[] surfaceHeightsAtEdge, NeighborDirection ndir) { // ndir is neighb's relation to us // so want the windows on the opposite edge Direction dir = NeighborDirectionUtils.DirecionFourForNeighborDirection(NeighborDirectionUtils.oppositeNeighborDirection(ndir)); Axis axis = DirectionUtil.AxisForDirection(dir); if (axis == Axis.X) { updateWindowsAlongXEdge(surfaceHeightsAtEdge, DirectionUtil.IsPosDirection(dir)); return; } updateWindowsAlongZEdge(surfaceHeightsAtEdge, DirectionUtil.IsPosDirection(dir)); }
// public List<Window> windowsAdjacentToWindowEitherSide(Window window) // { // List<Window> xNegWindows = windowsXNegAdjacentToWindow(window); // List<Window> xPosWindows = windowsXPosAdjacentToWindow(window); // xNegWindows.AddRange(xPosWindows); // return xNegWindows; // } // // public List<Window> windowsXPosAdjacentToWindow(Window window) // { // return windowsAdjacentToWindow(window, true); // } // // public List<Window> windowsXNegAdjacentToWindow(Window window) // { // return windowsAdjacentToWindow(window, false); // } // // private List<Window> windowsAdjacentToWindow(Window window, bool wantXPos) // { // return null; // } // public List<Window> windowsAdjacentToStartOfWindow(Window window) // { // return windowsAdjacentToEndWindow(window, false); // } // // public List<Window> windowsAdjacentToExtentOfWindow(Window window) // { // return windowsAdjacentToEndWindow(window, true); // } // // private List<Window> windowsAdjacentToEndWindow(Window window, bool wantExtent) // { // return null; // } #endregion #region talk to other windows /* * 'introduce' (share data with) windows from neighbor noise patches * */ public void introduceFlushWindowsWithWindowInNeighborDirection(WindowMap other, NeighborDirection ndir) { return; Direction dir = NeighborDirectionUtils.DirecionFourForNeighborDirection(ndir); Axis axis = DirectionUtil.AxisForDirection(dir); if (axis == Axis.X) { introduceFlushWithWindowMapInNeighborDirectionX(other, ndir); return; } introduceFlushWithWindowMapInNeighborDirectionZ(other, ndir); }
private void updateQuadBorderInDirection(Quad area, Direction dir) { PTwo nudge = DirectionUtil.NudgeCoordForDirectionPTwo(dir); Axis axis = DirectionUtil.AxisForDirection(dir); PTwo startPoint = area.origin; if (DirectionUtil.IsPosDirection(dir)) { if (axis == Axis.X) { startPoint.t += area.dimensions.t; } else { startPoint.s += area.dimensions.s; } } PTwo iterNudge = PTwo.Abs(nudge).flipSAndT(); int length = axis == Axis.X ? area.dimensions.t : area.dimensions.s; PTwo cursorPoint = startPoint; for (int i = 0; i < length; ++i) { DiscreteDomainRangeList <LightColumn> licols = m_lightColumnMap[cursorPoint + nudge]; if (licols == null) { continue; } DiscreteDomainRangeList <LightColumn> insideCols = m_lightColumnMap[cursorPoint]; if (insideCols == null) { continue; } for (int j = 0; j < licols.Count; ++j) { LightColumn outsideCol = licols[j]; for (int k = 0; k < insideCols.Count; ++k) { LightColumn insideCol = insideCols[k]; updateColumnAt(insideCol, insideCol.coord, outsideCol, area); } } cursorPoint += iterNudge; } }