Skip to content

Commit

Permalink
Fix #39
Browse files Browse the repository at this point in the history
  • Loading branch information
asny committed Nov 13, 2024
1 parent 8a86e46 commit 7473c05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ impl Camera {
if let ProjectionType::Perspective { .. } = self.projection_type {
v[3] = vec4(0.0, 0.0, 0.0, 1.0);
}
self.screen2ray = (self.projection * v).invert().unwrap();
self.screen2ray = (self.projection * v)
.invert()
.unwrap_or_else(|| Mat4::identity());
}

fn update_frustrum(&mut self) {
Expand Down

0 comments on commit 7473c05

Please sign in to comment.