aboutsummaryrefslogtreecommitdiff
path: root/src/core/mod.rs
blob: 07793ec6798af289cca46f048590d7bf468a6146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//! Contains a collection of core modules used by other modules
//!
//! Also creates a shortcut for some common types

mod vector2;
mod vector3;
mod bound2;
mod bound3;
mod spectrum;
mod ray;

pub use vector2::{Vector2i, Vector2f};
pub use vector3::Vector3f;
pub use bound2::{Bound2i, Bound2f};
pub use bound3::Bound3f;
pub use spectrum::Spectrum;
pub use ray::Ray;

use crate::Number;

fn min<T: Number> (a: T, b: T) -> T {
    if b < a {
        return b;
    }
    a
}

fn max<T: Number> (a: T, b: T) -> T {
    if b > a {
        return b;
    }
    a
}