Struct noise::PermutationTable [] [src]

pub struct PermutationTable { /* fields omitted */ }
Deprecated since 0.3.0

: will be made private by 1.0; noise generator structs (e.g. Perlin) now store permutation table internally, so if you were storing PermutationTable for performance reasons, store the noise generator object instead

A seed table, required by all noise functions.

Table creation is expensive, so in most circumstances you'll only want to create one of these per generator.

Methods

impl PermutationTable
[src]

Deterministically generates a new permutation table based on a u32 seed value.

Internally this uses a XorShiftRng, but we don't really need to worry about cryptographic security when working with procedural noise.

Example

use noise::PermutationTable;

let perm_table = PermutationTable::new(12);

Trait Implementations

impl Copy for PermutationTable
[src]

impl Rand for PermutationTable
[src]

Generates a PermutationTable using a random seed.

Examples

extern crate noise;
extern crate rand;

use noise::PermutationTable;

let perm_table = rand::random::<PermutationTable>();
extern crate noise;
extern crate rand;

use noise::PermutationTable;
use rand::{SeedableRng, Rng, XorShiftRng};

let mut rng: XorShiftRng = SeedableRng::from_seed([1, 2, 3, 4]);
let perm_table = rng.gen::<PermutationTable>();

impl Clone for PermutationTable
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for PermutationTable
[src]

Formats the value using the given formatter.