Debug problems
This commit is contained in:
parent
0a9748a1b7
commit
479cf89e8d
5 changed files with 18 additions and 7 deletions
|
|
@ -66,6 +66,10 @@ impl AABB {
|
|||
&& pos.z <= self.max.z
|
||||
}
|
||||
|
||||
pub fn contains_aabb(self, aabb: Self) -> bool {
|
||||
self.contains_point(aabb.min) && self.contains_point(aabb.max)
|
||||
}
|
||||
|
||||
pub fn size(self) -> Dir3 {
|
||||
Dir3::new(
|
||||
self.max.x - self.min.x,
|
||||
|
|
@ -92,7 +96,7 @@ impl AABB {
|
|||
Float::min(Float::max(t_min_z, t_max_z), max),
|
||||
);
|
||||
|
||||
if t_min < t_max {
|
||||
if t_min <= t_max {
|
||||
Some(t_min)
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ impl BasicCamera {
|
|||
pos: Pos3::new(tm.get(3, 0), tm.get(3, 1), tm.get(3, 2)),
|
||||
dir: Dir3::new(tm.get(2, 0), tm.get(2, 1), tm.get(2, 2)),
|
||||
h: l * Dir3::new(tm.get(0, 0), tm.get(0, 1), tm.get(0, 2)),
|
||||
v: l * Dir3::new(tm.get(1, 0), tm.get(1, 1), tm.get(1, 2)),
|
||||
v: l * ((height as Float) / (width as Float))
|
||||
* Dir3::new(tm.get(1, 0), tm.get(1, 1), tm.get(1, 2)),
|
||||
}
|
||||
}
|
||||
pub fn from_look_at(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue