Trait rust_3d::traits::Is3D
[−]
[src]
pub trait Is3D: IsND { fn x(&self) -> f64; fn y(&self) -> f64; fn z(&self) -> f64; fn pos(&self) -> (f64, f64, f64) { ... } fn dot(&self, other: &Is3D) -> f64 { ... } fn abs(&self) -> NonNegative { ... } fn rad_to(&self, other: &Is3D) -> Rad { ... } fn to_str(&self) -> String { ... } }
Is3D is a trait used for types which are positioned within the 3D space
Required Methods
fn x(&self) -> f64
Should return the x-coordinate
fn y(&self) -> f64
Should return the y-coordinate
fn z(&self) -> f64
Should return the z-coordinate
Provided Methods
fn pos(&self) -> (f64, f64, f64)
Returns the Position as x,y,z tuple
fn dot(&self, other: &Is3D) -> f64
Calculates the dot product with another Is3D
fn abs(&self) -> NonNegative
The absolute / length of this position
fn rad_to(&self, other: &Is3D) -> Rad
Calculates the angle to the other Is3D in radians
fn to_str(&self) -> String
Transforms the position in a "x y z" string. E.g. "3.72 5.99 1.01"
Trait Implementations
impl<P> HasDistanceTo<P> for Is3D where
P: Is3D,
[src]
P: Is3D,
fn sqr_distance(&self, other: &P) -> NonNegative
Should return the sqr distance to other
fn distance(&self, other: &T) -> NonNegative
The distance to other
impl HasDistanceTo<BoundingBox3D> for Is3D
[src]
fn sqr_distance(&self, other: &BoundingBox3D) -> NonNegative
Should return the sqr distance to other
fn distance(&self, other: &T) -> NonNegative
The distance to other
Implementors
impl<P> Is3D for Box<P> where
P: IsND + Is3D,impl Is3D for FilterBox3D
impl Is3D for FilterSphere
impl Is3D for Point3D
impl Is3D for Norm3D
impl Is3D for Sphere
impl Is3D for Box3D