37 lines
875 B
Rust
37 lines
875 B
Rust
use shared::core::{
|
|
light::Light,
|
|
material::Material,
|
|
medium::MediumInterface,
|
|
primitive::{GeometricPrimitive, SimplePrimitive},
|
|
shape::Shape,
|
|
};
|
|
|
|
use shared::utils::Ptr;
|
|
|
|
pub trait CreateSimplePrimitive {
|
|
fn new(shape: Ptr<Shape>, material: Ptr<Material>) -> SimplePrimitive {
|
|
SimplePrimitive { shape, material }
|
|
}
|
|
}
|
|
|
|
impl CreateSimplePrimitive for SimplePrimitive {}
|
|
|
|
pub trait CreateGeometricPrimitive {
|
|
fn new(
|
|
shape: Ptr<Shape>,
|
|
material: Ptr<Material>,
|
|
area_light: Ptr<Light>,
|
|
medium_interface: MediumInterface,
|
|
alpha: Ptr<GPUFloatTexture>,
|
|
) -> GeometricPrimitive {
|
|
GeometricPrimitive {
|
|
shape,
|
|
material,
|
|
area_light,
|
|
medium_interface,
|
|
alpha,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl CreateGeometricPrimitive for GeometricPrimitive {}
|