voxel-generators

0.0.11 • Public • Published

voxel-generators

Deterministic Random Numbers

  • .Random.seed([seed]) : returns a new deterministic generator based on the provided seed.

Noise Generators

  • .Noise.perlin() : returns a factory that can create new noise by seed according to the perlin noise algorithm.
  • .Noise.simplex() : returns a factory that can create new noise by seed according to the simplex noise algorithm.

Noise Factories

Noise factories take 2D Noise algorithms and tile them across the map in a deterministic way

  • .SeamlessNoiseFactory(seed, NoiseClass, lower, upper, mapFn) : Generates 5 textures per chunk and blends them to create seamless edges(within a single biome) and extrudes that in the provided range
  • .TiledNoiseFactory(seed, NoiseClass, lower, upper, mapFn) : Generates 1 texture per chunk and extrudes that in the provided range

Object Generators

  • voxel-generators/objects/trees : returns an object that allows you to add a tree trees.add({x:<x>, y:<y>, z:<z>, height:<max height>, material:<material index>}), then can be passed into a geometry reducer.
  • voxel-generators/objects/houses : returns an object that allows you to add a house houses.add({x:<x>, y:<y>, z:<z>, size:<cube size>, material:<material index>}), then can be passed into a geometry reducer.

More docs to come

Testing

mocha

Enjoy,

-Abbey Hawk Sparrow

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.11
    2
    • latest

Version History

Package Sidebar

Install

npm i voxel-generators

Weekly Downloads

2

Version

0.0.11

License

MIT

Unpacked Size

97.4 kB

Total Files

19

Last publish

Collaborators

  • khrome