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};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MaterialId(pub String);
|
||||
|
||||
pub struct TextureProjection {
|
||||
|
@ -24,6 +25,7 @@ impl Default for TextureProjection {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct BrushPlane {
|
||||
pub plane: Plane,
|
||||
pub material: MaterialId,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use csg::{
|
||||
brush::{Brush, BrushPlane, MaterialId, TextureProjection},
|
||||
glam::{self, Vec3},
|
||||
brush::{Brush, BrushPlane},
|
||||
glam::{self, Mat3, Vec3},
|
||||
plane::Plane,
|
||||
};
|
||||
|
||||
|
@ -20,8 +20,7 @@ fn generate_box_brush(position: Vec3, extent: Vec3) -> Brush {
|
|||
|
||||
brush_planes.push(BrushPlane {
|
||||
plane: Plane::from_point_normal(point, *normal),
|
||||
material: MaterialId("Epic".to_string()),
|
||||
tex_projection: TextureProjection::default(),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
println!("Plane: {:?}", brush_planes.last().unwrap().plane);
|
||||
|
|
Loading…
Reference in New Issue