public class PoissonDisk
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Coord |
randomUnblockedTile(Coord minPosition,
Coord maxPosition,
char[][] map,
IRNG rng,
java.util.HashSet<java.lang.Character> blocked)
Finds a random Coord where the x and y match up to a [x][y] location on map that has any value not in blocking.
|
static OrderedSet<Coord> |
sampleCircle(Coord center,
float radius,
float minimumDistance,
int maxX,
int maxY)
Get a list of Coords, each randomly positioned around the given center out to the given radius (measured with
Euclidean distance, so a true circle), but with the given minimum distance from any other Coord in the list.
|
static OrderedSet<Coord> |
sampleCircle(Coord center,
float radius,
float minimumDistance,
int maxX,
int maxY,
int pointsPerIteration,
IRNG rng)
Get a list of Coords, each randomly positioned around the given center out to the given radius (measured with
Euclidean distance, so a true circle), but with the given minimum distance from any other Coord in the list.
|
static OrderedSet<Coord> |
sampleMap(char[][] map,
float minimumDistance,
IRNG rng,
java.lang.Character... blocking) |
static OrderedSet<Coord> |
sampleMap(Coord minPosition,
Coord maxPosition,
char[][] map,
float minimumDistance,
IRNG rng,
java.lang.Character... blocking) |
static OrderedSet<Coord> |
sampleRectangle(Coord minPosition,
Coord maxPosition,
float minimumDistance,
int maxX,
int maxY)
Get a list of Coords, each randomly positioned within the rectangle between the given minPosition and
maxPosition, but with the given minimum distance from any other Coord in the list.
|
static OrderedSet<Coord> |
sampleRectangle(Coord minPosition,
Coord maxPosition,
float minimumDistance,
int maxX,
int maxY,
int pointsPerIteration,
IRNG rng)
Get a list of Coords, each randomly positioned within the rectangle between the given minPosition and
maxPosition, but with the given minimum distance from any other Coord in the list.
|
public static OrderedSet<Coord> sampleCircle(Coord center, float radius, float minimumDistance, int maxX, int maxY)
center - the center of the circle to spray Coords intoradius - the radius of the circle to spray Coords intominimumDistance - the minimum distance between Coords, in Euclidean distance as a float.maxX - one more than the highest x that can be assigned; typically an array lengthmaxY - one more than the highest y that can be assigned; typically an array lengthpublic static OrderedSet<Coord> sampleCircle(Coord center, float radius, float minimumDistance, int maxX, int maxY, int pointsPerIteration, IRNG rng)
center - the center of the circle to spray Coords intoradius - the radius of the circle to spray Coords intominimumDistance - the minimum distance between Coords, in Euclidean distance as a float.maxX - one more than the highest x that can be assigned; typically an array lengthmaxY - one more than the highest y that can be assigned; typically an array lengthpointsPerIteration - with small radii, this can be around 5; with larger ones, 30 is reasonablerng - an IRNG to use for all random sampling.public static OrderedSet<Coord> sampleRectangle(Coord minPosition, Coord maxPosition, float minimumDistance, int maxX, int maxY)
minPosition - the Coord with the lowest x and lowest y to be used as a corner for the bounding boxmaxPosition - the Coord with the highest x and highest y to be used as a corner for the bounding boxminimumDistance - the minimum distance between Coords, in Euclidean distance as a float.maxX - one more than the highest x that can be assigned; typically an array lengthmaxY - one more than the highest y that can be assigned; typically an array lengthpublic static OrderedSet<Coord> sampleRectangle(Coord minPosition, Coord maxPosition, float minimumDistance, int maxX, int maxY, int pointsPerIteration, IRNG rng)
minPosition - the Coord with the lowest x and lowest y to be used as a corner for the bounding boxmaxPosition - the Coord with the highest x and highest y to be used as a corner for the bounding boxminimumDistance - the minimum distance between Coords, in Euclidean distance as a float.maxX - one more than the highest x that can be assigned; typically an array lengthmaxY - one more than the highest y that can be assigned; typically an array lengthpointsPerIteration - with small areas, this can be around 5; with larger ones, 30 is reasonablerng - an IRNG to use for all random sampling.public static OrderedSet<Coord> sampleMap(char[][] map, float minimumDistance, IRNG rng, java.lang.Character... blocking)
public static OrderedSet<Coord> sampleMap(Coord minPosition, Coord maxPosition, char[][] map, float minimumDistance, IRNG rng, java.lang.Character... blocking)
public static Coord randomUnblockedTile(Coord minPosition, Coord maxPosition, char[][] map, IRNG rng, java.util.HashSet<java.lang.Character> blocked)
minPosition - the Coord with the lowest x and lowest y to be used as a corner for the bounding boxmaxPosition - the Coord with the highest x and highest y to be used as a corner for the bounding boxmap - a dungeon map or something, x then yrng - a IRNG to generate random choicesblocked - a Set of Characters that block a tile from being chosenCopyright © Eben Howard 2012–2022. All rights reserved.