[][src]Enum smallpt::axis::Axis

pub enum Axis {
    X,
    Y,
    Z,
}

An Axis in a three-dimensional coordinate system. Used to access Vector3/Point3 structs via index.

Examples

use bvh::axis::Axis;

let mut position = [1.0, 0.5, 42.0];
position[Axis::Y] *= 4.0;

assert_eq!(position[Axis::Y], 2.0);

nalgebra structures are also indexable using Axis. For reference see [the documentation] (http://nalgebra.org/doc/nalgebra/struct.Vector3.html#method.index).

extern crate bvh;
extern crate nalgebra;

use bvh::axis::Axis;
use nalgebra::Point3;

let mut position: Point3<f32> = Point3::new(1.0, 2.0, 3.0);
position[Axis::X] = 1000.0;

assert_eq!(position[Axis::X], 1000.0);

Variants

X

Index of the X axis.

Y

Index of the Y axis.

Z

Index of the Z axis.

Trait Implementations

impl Clone for Axis[src]

impl Copy for Axis[src]

impl Debug for Axis[src]

impl Display for Axis[src]

Display implementation for Axis.

impl Index<Axis> for [f32][src]

Make slices indexable by Axis.

type Output = f32

The returned type after indexing.

impl Index<Axis> for Point<f32, U3>[src]

Make Point3 indexable by Axis.

type Output = f32

The returned type after indexing.

impl IndexMut<Axis> for [f32][src]

Make slices mutably accessible by Axis.

impl IndexMut<Axis> for Point<f32, U3>[src]

Make Point3 mutably accessible by Axis.

impl PartialEq<Axis> for Axis[src]

impl StructuralPartialEq for Axis[src]

Auto Trait Implementations

impl RefUnwindSafe for Axis

impl Send for Axis

impl Sync for Axis

impl Unpin for Axis

impl UnwindSafe for Axis

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,