Skip to content

Commit

Permalink
Merge pull request #182 from Walther/2023-08-31-chores
Browse files Browse the repository at this point in the history
2023-08-31 chores
  • Loading branch information
Walther authored Aug 31, 2023
2 parents eff70e7 + f37294d commit 48ca4b0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 31 deletions.
12 changes: 6 additions & 6 deletions clovers-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ path = "src/main.rs"
clovers = { path = "../clovers", features = ["serde-derive", "stl", "traces", "gl_tf"], default-features = false }

# External
clap = { version = "4.2.1", features = ["std", "derive"] }
clap = { version = "4.4.1", features = ["std", "derive"] }
human_format = "1.0.3"
humantime = "2.1.0"
image = { version = "0.24.6", features = ["png"], default-features = false }
image = { version = "0.24.7", features = ["png"], default-features = false }
img-parts = "0.3.0"
indicatif = { version = "0.17.3", features = ["rayon"], default-features = false }
indicatif = { version = "0.17.6", features = ["rayon"], default-features = false }
rand = { version = "0.8.5", features = ["small_rng", "getrandom"], default-features = false }
rayon = "1.7.0"
serde = { version = "1.0.159", features = ["derive"], default-features = false }
serde = { version = "1.0.188", features = ["derive"], default-features = false }
serde_json = { version = "1.0", features = ["alloc"], default-features = false }
time = { version = "0.3.20", default-features = false }
time = { version = "0.3.28", default-features = false }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.16", features = ["time"] }
tracing-subscriber = { version = "0.3.17", features = ["time"] }
8 changes: 4 additions & 4 deletions clovers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ std = []
traces = ["tracing"]

[dependencies]
enum_dispatch = "0.3.11"
gltf = { version = "1.1.0", optional = true }
nalgebra = { version = "0.32.2", features = ["libm"], default-features = false }
enum_dispatch = "0.3.12"
gltf = { version = "1.3.0", optional = true }
nalgebra = { version = "0.32.3", features = ["libm"], default-features = false }
rand = { version = "0.8.5", features = ["small_rng"], default-features = false }
rand_distr = "0.4.3"
serde = { version = "1.0.159", features = ["derive"], default-features = false, optional = true }
serde = { version = "1.0.188", features = ["derive"], default-features = false, optional = true }
stl_io = { version = "0.7.0", optional = true }
tracing = { version = "0.1.37", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions clovers/src/bvhnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ fn vec_bounding_box(vec: &Vec<Hitable>, t0: Float, t1: Float) -> Option<AABB> {
let mut output_box: Option<AABB> = None;

// Go through all the objects, and expand the AABB
for object in vec.iter() {
for object in vec {
// Check if the object has a box
let Some(bounding) = object.bounding_box(t0, t1) else {
// No box found for the object, early return.
// Having even one unbounded object in a list makes the entire list unbounded!
return None
return None;
};

// Do we have an output_box already saved?
Expand Down
2 changes: 1 addition & 1 deletion clovers/src/colorize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub fn colorize(ray: &Ray, scene: &Scene, depth: u32, max_depth: u32, rng: &mut
.scattering_pdf(&hit_record, &scatter_ray, rng)
else {
// No scatter, only emit
return emitted
return emitted;
};

// Recurse for the scattering ray
Expand Down
2 changes: 1 addition & 1 deletion clovers/src/objects/boxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<'scene> HitableTrait for Boxy<'scene> {
// start with an empty hit_record, hit all sides, return closest
let mut hit_record: Option<HitRecord> = None;
let mut closest = distance_max;
for hitable in self.sides.iter() {
for hitable in &*self.sides {
if let Some(record) = hitable.hit(ray, distance_min, closest, rng) {
closest = record.distance;
hit_record = Some(record);
Expand Down
19 changes: 9 additions & 10 deletions clovers/src/objects/constant_medium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,19 @@ impl<'scene> HitableTrait for ConstantMedium<'scene> {
// TODO: explain how the fog works.

let Some(mut rec1) = self
.boundary
.hit(ray, Float::NEG_INFINITY, Float::INFINITY, rng)
.boundary
.hit(ray, Float::NEG_INFINITY, Float::INFINITY, rng)
else {
return None
return None;
};

let Some(mut rec2) = self.boundary.hit(
ray,
rec1.distance + EPSILON_CONSTANT_MEDIUM,
Float::INFINITY,
rng,
)
else {
return None
ray,
rec1.distance + EPSILON_CONSTANT_MEDIUM,
Float::INFINITY,
rng,
) else {
return None;
};

if rec1.distance < distance_min {
Expand Down
14 changes: 7 additions & 7 deletions clovers/src/objects/rotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ impl<'scene> RotateY<'scene> {

// Does our object have a bounding box?
let Some(bbox) = bounding_box else {
return RotateY {
object,
sin_theta,
cos_theta,
aabb: None,
}
return RotateY {
object,
sin_theta,
cos_theta,
aabb: None,
};
};

// Start with infinite bounds
let mut min: Vec3 = Vec3::new(Float::INFINITY, Float::INFINITY, Float::INFINITY);
Expand Down Expand Up @@ -117,7 +117,7 @@ impl<'scene> HitableTrait for RotateY<'scene> {

let Some(hit_record) = self.object.hit(&rotated_r, distance_min, distance_max, rng) else {
// Did not hit rotated object, early return None
return None
return None;
};

// Determine where the intersection is
Expand Down

0 comments on commit 48ca4b0

Please sign in to comment.