Trait implicit3d::Object
source · pub trait Object<S: Real + Float + From<f32>>: ObjectClone<S> + Debug + Sync + Send {
fn bbox(&self) -> &BoundingBox<S>;
fn set_bbox(&mut self, _: &BoundingBox<S>) { ... }
fn set_parameters(&mut self, _: &PrimitiveParameters<S>) { ... }
fn approx_value(&self, _: &Point3<S>, _: S) -> S { ... }
fn normal(&self, _: &Point3<S>) -> Vector3<S> { ... }
fn translate(&self, v: &Vector3<S>) -> Box<dyn Object<S>> { ... }
fn rotate(&self, r: &Vector3<S>) -> Box<dyn Object<S>> { ... }
fn scale(&self, s: &Vector3<S>) -> Box<dyn Object<S>> { ... }
}
Expand description
Object is the basic trait for any 3d implicit function.
Required Methods§
sourcefn bbox(&self) -> &BoundingBox<S>
fn bbox(&self) -> &BoundingBox<S>
Get the Bounding Box of this Object.
Provided Methods§
sourcefn set_bbox(&mut self, _: &BoundingBox<S>)
fn set_bbox(&mut self, _: &BoundingBox<S>)
Explicitly set the Bounding Box.
sourcefn set_parameters(&mut self, _: &PrimitiveParameters<S>)
fn set_parameters(&mut self, _: &PrimitiveParameters<S>)
Allows to set parameters.
sourcefn approx_value(&self, _: &Point3<S>, _: S) -> S
fn approx_value(&self, _: &Point3<S>, _: S) -> S
Value is 0 on object surfaces, negative inside and positive outside of objects. If positive, value is guarateed to be the minimum distance to the object surface. return some approximation (which is always larger then the proper value). Only do a proper calculation, for values smaller then slack.
Trait Implementations§
source§impl<S> PartialEq<Box<dyn Object<S> + 'static, Global>> for Box<dyn Object<S>>
impl<S> PartialEq<Box<dyn Object<S> + 'static, Global>> for Box<dyn Object<S>>
source§impl<S> PartialOrd<Box<dyn Object<S> + 'static, Global>> for Box<dyn Object<S>>
impl<S> PartialOrd<Box<dyn Object<S> + 'static, Global>> for Box<dyn Object<S>>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more