Свойство | Тип | Описание | |
---|---|---|---|
planetName | string | ||
serializedSamplePointsByPlanet | serializedInformation>.Dictionary |
Метод | Описание | |
---|---|---|
InstantiateBasedOnPlayerLocation ( ) : void |
Depending on player location, it will pull objects from the object pool and set them to appear in the chunks that the player can see. Chunks that are too far away will be deactivated and the objects sent back into the pool.
|
|
LoadPlanet ( ) : void | ||
activateChunk ( long key ) : void |
Activates the chunk by pulling from the object pool and activating those objects within the chunk.
|
|
disableChunk ( long key ) : void |
Disables the chunk and send objects back into object pool.
|
|
generateAll ( ) : IEnumerator |
Generates objects at eaach sample point at once.
|
|
generateInitialObjects ( ) : void |
Generates the initial pool of objects to be used in chunk by chunk generation.
|
|
generateObjectsByName ( ) : void |
Generates the objects in the objectsByName pool. To be used during reloading sample points from save file.
|
|
generatePoisson ( float minDistance, int newPointsCount ) : List |
Generates the poisson sampling points that can be used to determine where to place objects.
|
|
generateRandomPointAround ( int triangleIndex, List |
Generates the random point around an existing point.
|
|
getColorAtTriangle ( ProceduralGenerationPoint, point ) : Color |
Gets the color at a location.
|
|
getColorChance ( Color c ) : Vector2 |
Gets the chance for an object to be created at a certain size based on the color of the point in heatmap.
|
|
getDensity ( Color c ) : float |
Gets the density value for a color. This is determined by how dark the color is, which is determined her by how close the average of the 3 RBG values. Brightest algorithm: brightness = sqrt( .241 R2 + .691 G2 + .068 B2 )
|
|
getInterpolation ( Vector3 triangle ) : Vector3 |
Gets the point on the face of the triangle given a triangle represented by 3 location points.
|
|
getSize ( Vector2 colorChances ) : float |
Gets the size that the object should be based on the heatmap.
|
|
inRange ( Vector2 pos1, Vector2 pos2, float minDist ) : bool |
Is too close to another object. Calculated based upon isophotic distance
|
|
meshPointToUv ( ProceduralGenerationPoint, point ) : Vector2 |
Turns a Vector3 position on the mesh to a Vector2 uv point.
|
|
overlappingPoint ( ProceduralGenerationPoint>.Dictionary |
Checks the neighboring grid locations to see if there's an object that is too close to a certain point.
|
|
reconstructSamplePoints ( string name ) : void |
Reconstructs the sample points after save file load.
|
|
serializeSamplePoints ( ) : void |
Sets up the sample points for serialization.
|
|
toGrid ( Vector2 point, float minSize, long gridOffset ) : long |
Takes in a uv point and returns a grid location. Can be used for grids of different sizes, for example the main point grid which keeps track of where each point generated is on the mesh, or for the chunk grid which divides up the mesh into sections for generation. The value returned is an long representation of a vector2. The x value is in the lower decimal places, and the y value is in the higher decimal places. How far apart the two numbers are is determined by the gridOffset. For example, if the gridOffset is 1000, that is, there can be up to 999 x values, then if x is 30, and y is 89, the value returned will be 89030.
|
|
waitForLoad ( ) : IEnumerator |
Waits for loading of the save file so that on continue, it will wait until the file has been loaded before the procedural generation will be set off.
|
Метод | Описание | |
---|---|---|
Start ( ) : void | ||
Update ( ) : void |
public InstantiateBasedOnPlayerLocation ( ) : void | ||
Результат | void |
public activateChunk ( long key ) : void | ||
key | long | All sample points are hashed into chunks by the key. So this key will give a list of objects within a chunk. |
Результат | void |
public generatePoisson ( float minDistance, int newPointsCount ) : List |
||
minDistance | float | Minimum distance. |
newPointsCount | int | Number of new points that should be generated around an existing point. |
Результат | List |
public generateRandomPointAround ( int triangleIndex, List |
||
triangleIndex | int | Triangle index. |
triangles | List |
Triangles. |
uvsToTriangles | List |
Uvs to triangles. |
minDistance | float | Minimum distance. |
Результат | ProceduralGenerationPoint, |
public getColorAtTriangle ( ProceduralGenerationPoint, point ) : Color | ||
point | ProceduralGenerationPoint, | Point. |
Результат | Color |
public getColorChance ( Color c ) : Vector2 | ||
c | Color | A color from the heatmap, c. |
Результат | Vector2 |
public getInterpolation ( Vector3 triangle ) : Vector3 | ||
triangle | Vector3 | A location. |
Результат | Vector3 |
public getSize ( Vector2 colorChances ) : float | ||
colorChances | Vector2 | There are 2 color chances passed in. If the random number is under the first threshold, then a small object is generated, /// if it's under the second then a medium object is generated. Otherwise, a large object is generated. |
Результат | float |
public inRange ( Vector2 pos1, Vector2 pos2, float minDist ) : bool | ||
pos1 | Vector2 | Pos1. |
pos2 | Vector2 | Pos2. |
minDist | float | |
Результат | bool |
public meshPointToUv ( ProceduralGenerationPoint, point ) : Vector2 | ||
point | ProceduralGenerationPoint, | Point. |
Результат | Vector2 |
public overlappingPoint ( ProceduralGenerationPoint>.Dictionary |
||
grid | ProceduralGenerationPoint>.Dictionary | Grid. |
point | ProceduralGenerationPoint, | Point. |
minDistance | float | Minimum distance. |
cellSize | float | Cell size. |
triangle | int | Triangle. |
Результат | bool |
public reconstructSamplePoints ( string name ) : void | ||
name | string | Name of planet. |
Результат | void |
public toGrid ( Vector2 point, float minSize, long gridOffset ) : long | ||
point | Vector2 | Point. |
minSize | float | Minimum size. |
gridOffset | long | Grid offset. |
Результат | long |