Added clone
This commit is contained in:
@@ -8,6 +8,7 @@ use std::path::Path;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
// MATERIAL -----------------------------------------------------------------
|
// MATERIAL -----------------------------------------------------------------
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Material {
|
pub struct Material {
|
||||||
pub kd: Vector3<f32>,
|
pub kd: Vector3<f32>,
|
||||||
pub ks: Vector3<f32>,
|
pub ks: Vector3<f32>,
|
||||||
@@ -75,6 +76,7 @@ impl Intersection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// BOUNDING BOX -----------------------------------------------------------------
|
// BOUNDING BOX -----------------------------------------------------------------
|
||||||
|
#[derive(Clone)]
|
||||||
struct BoundingBox {
|
struct BoundingBox {
|
||||||
bln: Point3<f32>,
|
bln: Point3<f32>,
|
||||||
trf: Point3<f32>,
|
trf: Point3<f32>,
|
||||||
@@ -111,6 +113,7 @@ pub trait Primitive: Send + Sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SPHERE -----------------------------------------------------------------
|
// SPHERE -----------------------------------------------------------------
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Sphere {
|
pub struct Sphere {
|
||||||
position: Point3<f32>,
|
position: Point3<f32>,
|
||||||
radius: f32,
|
radius: f32,
|
||||||
@@ -186,6 +189,7 @@ impl Primitive for Sphere {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CIRCLE -----------------------------------------------------------------
|
// CIRCLE -----------------------------------------------------------------
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Circle {
|
pub struct Circle {
|
||||||
position: Point3<f32>,
|
position: Point3<f32>,
|
||||||
radius: f32,
|
radius: f32,
|
||||||
@@ -294,6 +298,7 @@ impl Primitive for Cylinder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CONE -----------------------------------------------------------------
|
// CONE -----------------------------------------------------------------
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Cone {
|
pub struct Cone {
|
||||||
radius: f32,
|
radius: f32,
|
||||||
base: f32,
|
base: f32,
|
||||||
@@ -495,6 +500,7 @@ impl Primitive for Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// BOX -----------------------------------------------------------------
|
// BOX -----------------------------------------------------------------
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Cube {
|
pub struct Cube {
|
||||||
width: f32,
|
width: f32,
|
||||||
height: f32,
|
height: f32,
|
||||||
|
|||||||
Reference in New Issue
Block a user