1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
7pub struct Point3 {
8 pub x: f64,
10 pub y: f64,
12 pub z: f64,
14}
15
16impl Point3 {
17 pub const fn new(x: f64, y: f64, z: f64) -> Self {
19 Self { x, y, z }
20 }
21
22 pub const fn xy(x: f64, y: f64) -> Self {
24 Self { x, y, z: 0.0 }
25 }
26}
27
28#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
30pub struct Vec3 {
31 pub x: f64,
33 pub y: f64,
35 pub z: f64,
37}
38
39impl Vec3 {
40 pub const Z: Vec3 = Vec3 {
42 x: 0.0,
43 y: 0.0,
44 z: 1.0,
45 };
46
47 pub const fn new(x: f64, y: f64, z: f64) -> Self {
49 Self { x, y, z }
50 }
51}
52
53#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
55pub struct BBox {
56 pub min: Point3,
58 pub max: Point3,
60}