fx: util file created

This commit is contained in:
2026-09-11 13:00:23 +02:00
parent 83e3f2e41b
commit 2800d911c3
3 changed files with 8 additions and 7 deletions

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)]
pub struct Camera {
@@ -27,11 +26,6 @@ pub struct Camera {
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 {
pub fn new() -> Self {
Self {

View File

@@ -1,5 +1,6 @@
#![feature(core_float_math)]
mod util;
mod camera;
mod objects;
mod ray;

6
src/util.rs Normal file
View File

@@ -0,0 +1,6 @@
use std::f32::consts::PI;
pub(crate) fn deg_to_rad(deg: f32) -> f32 {
deg * PI / 180.
}