pub fn generate<R: Rng>(mut self, rng: &mut R) -> Tree {
        // Recursively create the tree and put all branches in a buffer.
        self.create_trunk(rng);

        Tree {
            branches: self.branches,
            trunk_color: Vector3f::new(
                range_sample(&self.preset.trunk_color.0, rng),
                range_sample(&self.preset.trunk_color.1, rng),
                range_sample(&self.preset.trunk_color.2, rng),
            ),
            leaf_color: Vector3f::new(
                range_sample(&self.preset.leaf_color.0, rng),
                range_sample(&self.preset.leaf_color.1, rng),
                range_sample(&self.preset.leaf_color.2, rng),
            ),
        }
    }
/// Generates a random tree according to the stored parameters.
///
/// The tree is returned as a list of branches for now.
Generates a random tree according to the stored parameters.
The tree is returned as a list of branches for now.
Generates a random tree according to the stored parameters . The tree is returned as a list of branches for now .
pub fn generate<R: Rng>(mut self, rng: &mut R) -> Tree {
        // Recursively create the tree and put all branches in a buffer.
        self.create_trunk(rng);
        Tree {
            branches: self.branches,
            trunk_color: Vector3f::new(
                range_sample(&self.preset.trunk_color.0, rng),
                range_sample(&self.preset.trunk_color.1, rng),
                range_sample(&self.preset.trunk_color.2, rng),
            ),
            leaf_color: Vector3f::new(
                range_sample(&self.preset.leaf_color.0, rng),
                range_sample(&self.preset.leaf_color.1, rng),
                range_sample(&self.preset.leaf_color.2, rng),
            ),
        }
    }
pub fn generate < R : Rng > ( mut self , rng : & mut R ) -> Tree { // Recursively create the tree and put all branches in a buffer. self . create_trunk ( rng ) ; Tree { branches : self . branches , trunk_color : Vector3f :: new ( range_sample ( & self . preset . trunk_color . 0 , rng ) , range_sample ( & self . preset . trunk_color . 1 , rng ) , range_sample ( & self . preset . trunk_color . 2 , rng ) , ) , leaf_color : Vector3f :: new ( range_sample ( & self . preset . leaf_color . 0 , rng ) , range_sample ( & self . preset . leaf_color . 1 , rng ) , range_sample ( & self . preset . leaf_color . 2 , rng ) , ) , } }
Generates a random tree according to the stored parameters.
Generates a random tree according to the stored parameters .
mut self
rng
&mut R