hash

fun Box.hash(seed: Int, x: Int): Vector3(source)

Generates a random point inside the boundary of the Box using a hash-based approach.

Return

A Vector3 representing the random point within the Box, based on the provided seed and x.

Parameters

seed

An integer seed used for hashing to produce deterministic random results for a given seed.

x

An integer that acts as an additional input to the hash, allowing variation in the generated points.


fun Circle.hash(seed: Int, x: Int): Vector2(source)

Generates a random point within the bounds of the Circle using a hash-based approach.

Return

A Vector2 representing a random point within the Circle, based on the provided seed and x.

Parameters

seed

An integer seed for the hash function, used to produce deterministic random results for the same seed.

x

An integer input to the hash function, adding further variation to the generated point.


fun Rectangle.hash(seed: Int, x: Int): Vector2(source)

Generates a random point within the bounds of the Rectangle using a hash-based approach.

Return

A Vector2 representing a random point within the Rectangle, based on the provided seed and x.

Parameters

seed

An integer seed for the hash function, used to produce deterministic random results for the same seed.

x

An integer input to the hash function, adding further variation to the generated point.


fun List<Triangle>.hash(count: Int, seed: Int = 0, x: Int = 0): List<Vector2>(source)

Generates a list of random points, distributed across a list of triangles, weighted by their respective areas. The points are generated using a hash-based randomization approach.

Return

A list of Vector2 points that are distributed among the triangles according to their areas.

Parameters

count

The number of random points to generate.

seed

The seed for the hash function, used to produce deterministic randomization.

x

An optional offset value for the hash, defaulting to 0.


fun Triangle.hash(seed: Int, x: Int): Vector2(source)

Generates a random point within the bounds of the Triangle using a hash-based approach.

Return

A Vector2 representing a random point within the Triangle, based on the provided seed and x.

Parameters

seed

An integer seed for the hash function, used to produce deterministic random results for the same seed.

x

An integer input to the hash function, adding further variation to the generated point.