Implement Default for MaterialID and BrushPlane
This commit is contained in:
parent
8488a75bd0
commit
0cfb77804d
|
@ -2,6 +2,7 @@ use glam::Vec3;
|
||||||
|
|
||||||
use crate::plane::{Plane, PlaneIntersection};
|
use crate::plane::{Plane, PlaneIntersection};
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct MaterialId(pub String);
|
pub struct MaterialId(pub String);
|
||||||
|
|
||||||
pub struct TextureProjection {
|
pub struct TextureProjection {
|
||||||
|
@ -24,6 +25,7 @@ impl Default for TextureProjection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct BrushPlane {
|
pub struct BrushPlane {
|
||||||
pub plane: Plane,
|
pub plane: Plane,
|
||||||
pub material: MaterialId,
|
pub material: MaterialId,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use csg::{
|
use csg::{
|
||||||
brush::{Brush, BrushPlane, MaterialId, TextureProjection},
|
brush::{Brush, BrushPlane},
|
||||||
glam::{self, Vec3},
|
glam::{self, Mat3, Vec3},
|
||||||
plane::Plane,
|
plane::Plane,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,8 +20,7 @@ fn generate_box_brush(position: Vec3, extent: Vec3) -> Brush {
|
||||||
|
|
||||||
brush_planes.push(BrushPlane {
|
brush_planes.push(BrushPlane {
|
||||||
plane: Plane::from_point_normal(point, *normal),
|
plane: Plane::from_point_normal(point, *normal),
|
||||||
material: MaterialId("Epic".to_string()),
|
..Default::default()
|
||||||
tex_projection: TextureProjection::default(),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
println!("Plane: {:?}", brush_planes.last().unwrap().plane);
|
println!("Plane: {:?}", brush_planes.last().unwrap().plane);
|
||||||
|
|
Loading…
Reference in New Issue