Type alias for the ray index type.
Makes things easier to play with.
This commit is contained in:
parent
630a79aca5
commit
eef29c2b2f
|
@ -206,7 +206,7 @@ impl<'a> BVH4<'a> {
|
||||||
([0, 1, 2, 3, 4, 5, 6, 7], 0)
|
([0, 1, 2, 3, 4, 5, 6, 7], 0)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
trav_time += timer.tick() as f64;
|
trav_time += timer.tick() as f64;
|
||||||
|
|
||||||
if hit_count > 0 {
|
if hit_count > 0 {
|
||||||
|
|
|
@ -4,6 +4,7 @@ use float4::Float4;
|
||||||
|
|
||||||
use crate::math::{Matrix4x4, Point, Vector};
|
use crate::math::{Matrix4x4, Point, Vector};
|
||||||
|
|
||||||
|
type RayIndexType = u16;
|
||||||
type FlagType = u8;
|
type FlagType = u8;
|
||||||
const OCCLUSION_FLAG: FlagType = 1;
|
const OCCLUSION_FLAG: FlagType = 1;
|
||||||
const DONE_FLAG: FlagType = 1 << 1;
|
const DONE_FLAG: FlagType = 1 << 1;
|
||||||
|
@ -229,7 +230,7 @@ impl RayStack {
|
||||||
/// Pushes the given ray index onto the end of the specified lane.
|
/// Pushes the given ray index onto the end of the specified lane.
|
||||||
pub fn push_ray_index(&mut self, ray_idx: usize, lane: usize) {
|
pub fn push_ray_index(&mut self, ray_idx: usize, lane: usize) {
|
||||||
assert!(self.lanes.len() > lane);
|
assert!(self.lanes.len() > lane);
|
||||||
self.lanes[lane].idxs.push(ray_idx as u16);
|
self.lanes[lane].idxs.push(ray_idx as RayIndexType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Takes the given list of lane indices, and pushes any excess indices on
|
/// Takes the given list of lane indices, and pushes any excess indices on
|
||||||
|
@ -282,7 +283,7 @@ impl RayStack {
|
||||||
/// A lane within a RayStack.
|
/// A lane within a RayStack.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Lane {
|
struct Lane {
|
||||||
idxs: Vec<u16>,
|
idxs: Vec<RayIndexType>,
|
||||||
end_len: usize,
|
end_len: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user