fx: util file created

This commit is contained in:
djaidjai committed 2026-09-11 13:00:23 +02:00
1 parent 83e3f2e41b
commit 2800d911c3
3 files changed
+8 -7

No files matched your search

+1 -7
View File
@@ -1,6 +1,5 @@
use std::f32::consts::PI;
use crate::{ray::Ray, vec3::Vec3}; use crate::{ray::Ray, util::deg_to_rad, vec3::Vec3};
#[derive(Debug)] #[derive(Debug)]
pub struct Camera { pub struct Camera {
@@ -27,11 +26,6 @@ pub struct Camera {
defocus_disk_v: Vec3, defocus_disk_v: Vec3,
} }
// FIXME (low priority): kinda out of place in this file.
fn deg_to_rad(deg: f32) -> f32 {
deg * PI / 180.
}
impl Camera { impl Camera {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
+1
View File
@@ -1,5 +1,6 @@
#![feature(core_float_math)] #![feature(core_float_math)]
mod util;
mod camera; mod camera;
mod objects; mod objects;
mod ray; mod ray;
+6
View File
@@ -0,0 +1,6 @@
use std::f32::consts::PI;
pub(crate) fn deg_to_rad(deg: f32) -> f32 {
deg * PI / 180.
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.