rtiow: add blox with gloxy edges.

Fixed bug in kdtree that this uncovered.
Marked Hit and it's dependencies as needing to implement the Debug
trait.
This commit is contained in:
2022-09-17 16:45:29 -07:00
parent b432e9a6dd
commit 4066bf4b85
25 changed files with 338 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ use rand;
use crate::{noise::NoiseSource, vec3::Vec3};
const NOISE_SIZE: usize = 128;
#[derive(Debug)]
pub struct Lode {
// Using fixed array causes stack overflow.
noise: Vec<Vec<Vec<f32>>>, //[[[f32; NOISE_SIZE]; NOISE_SIZE]; NOISE_SIZE],

View File

@@ -1,13 +1,13 @@
pub mod lode;
pub mod perlin;
use std::f32::consts::PI;
use std::{f32::consts::PI, fmt::Debug};
use serde_derive::Deserialize;
use crate::vec3::Vec3;
pub trait NoiseSource: Send + Sync {
pub trait NoiseSource: Send + Sync + Debug {
/// value returns noise on the interval [0., 1.).
fn value(&self, p: Vec3) -> f32;

View File

@@ -8,6 +8,7 @@ use crate::{
vec3::{dot, Vec3},
};
#[derive(Debug)]
pub struct Perlin {
ran_vec: Vec<Vec3>,
perm_x: Vec<usize>,