Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- nearest2D(int, double, double, int, int, ResultBuffer.ResultBuffer2d, PointEvaluator)
- nearest3D(int, double, double, double, int, int, int, ResultBuffer.ResultBuffer3d, PointEvaluator)
- transition2D(int, double, double, int, int, ResultBuffer.ResultBuffer2d, PointEvaluator)
- transition3D(int, double, double, double, int, int, int, ResultBuffer.ResultBuffer3d, PointEvaluator)
- evalPoint(int, double, double, int, int, ResultBuffer.ResultBuffer2d, PointEvaluator)
- evalPoint(int, double, double, double, int, int, int, ResultBuffer.ResultBuffer3d, PointEvaluator)
- evalPoint2(int, double, double, int, int, ResultBuffer.ResultBuffer2d, PointEvaluator)
- evalPoint2(int, double, double, double, int, int, int, ResultBuffer.ResultBuffer3d, PointEvaluator)
- collect(int, int, int, int, int, int, ResultBuffer.Bounds2d, T, PointConsumer, PointEvaluator)
Class DirectGrid
java.lang.Object
com.hypixel.hytale.server.worldgen.climate.DirectGrid
- All Implemented Interfaces:
CellDistanceFunction
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidcollect(int originalSeed, int seed, int minX, int minY, int maxX, int maxY, ResultBuffer.Bounds2d bounds, T ctx, PointConsumer<T> collector, PointEvaluator pointEvaluator) Iterate the cell-grid between the two provided corner coordinates and collect the cell centre-points of each cell visited.voidevalPoint(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Evaluate distance to the given cell centre-point recording only the closest result.voidevalPoint(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Evaluate distance to the given cell centre-point recording only the closest result.voidevalPoint2(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Evaluate distance to the given cell centre-point recording the closest and second-closest result.voidevalPoint2(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Evaluate distance to the given cell centre-point recording the closest and second-closest result.voidnearest2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Calculate the distance to the nearest cell centre-point of a 2D cell neighborhood.voidnearest3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Calculate the distance to the nearest cell centre-point of a 3D cell neighborhood.voidtransition2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.voidtransition3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DirectGrid
public DirectGrid()
-
-
Method Details
-
nearest2D
public void nearest2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionCalculate the distance to the nearest cell centre-point of a 2D cell neighborhood.- Specified by:
nearest2Din interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.cellX- The x-index of cell to evaluate around.cellY- The y-index of cell to evaluate around.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
nearest3D
public void nearest3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionCalculate the distance to the nearest cell centre-point of a 3D cell neighborhood.- Specified by:
nearest3Din interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.z- The y-coordinate being sampled.cellX- The x-index of cell to evaluate around.cellY- The y-index of cell to evaluate around.cellZ- The z-index of cell to evaluate around.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
transition2D
public void transition2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionCalculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.- Specified by:
transition2Din interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.cellX- The x-index of cell to evaluate around.cellY- The y-index of cell to evaluate around.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
transition3D
public void transition3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionCalculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.- Specified by:
transition3Din interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.z- The y-coordinate being sampled.cellX- The x-index of cell to evaluate around.cellY- The y-index of cell to evaluate around.cellZ- The z-index of cell to evaluate around.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
evalPoint
public void evalPoint(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionEvaluate distance to the given cell centre-point recording only the closest result.- Specified by:
evalPointin interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.cellX- The x-index of cell being evaluated.cellY- The y-index of cell being evaluated.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
evalPoint
public void evalPoint(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionEvaluate distance to the given cell centre-point recording only the closest result.- Specified by:
evalPointin interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.z- The y-coordinate being sampled.cellX- The x-index of cell being evaluated.cellY- The y-index of cell being evaluated.cellZ- The z-index of cell being evaluated.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
evalPoint2
public void evalPoint2(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionEvaluate distance to the given cell centre-point recording the closest and second-closest result.- Specified by:
evalPoint2in interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.cellX- The x-index of cell being evaluated.cellY- The y-index of cell being evaluated.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
evalPoint2
public void evalPoint2(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionEvaluate distance to the given cell centre-point recording the closest and second-closest result.- Specified by:
evalPoint2in interfaceCellDistanceFunction- Parameters:
seed- The seed being sampled.x- The x-coordinate being sampled.y- The y-coordinate being sampled.z- The y-coordinate being sampled.cellX- The x-index of cell being evaluated.cellY- The y-index of cell being evaluated.cellZ- The z-index of cell being evaluated.buffer- The buffer into which the result of the evaluation is recorded.pointEvaluator- A function that evaluates each cell centre-point.
-
collect
public <T> void collect(int originalSeed, int seed, int minX, int minY, int maxX, int maxY, ResultBuffer.Bounds2d bounds, T ctx, PointConsumer<T> collector, PointEvaluator pointEvaluator) Description copied from interface:CellDistanceFunctionIterate the cell-grid between the two provided corner coordinates and collect the cell centre-points of each cell visited.- Specified by:
collectin interfaceCellDistanceFunction- Type Parameters:
T- The type of the contextual information being passed to the collector.- Parameters:
originalSeed- A seed from which child-seeds may be offset.seed- The seed used to determine cell centre-points.minX- The x-index of the inclusive lower corner of the cell region.minY- The y-index of the inclusive lower corner of the cell region.maxX- The x-index of the inclusive upper corner of the cell region.maxY- The y-index of the inclusive upper corner of the cell region.bounds- The bounds that generated points must be limited to.ctx- An arbitrary piece of contextual information to pass to the collector for each point visited.collector- A consumer for each visited cell centre-point.pointEvaluator- A function that evaluates each cell centre-point.
-