Enum bvh::axis::Axis [] [src]

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.

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

Index of the X axis.

Index of the Y axis.

Index of the Z axis.

Trait Implementations

impl Debug for Axis
[src]

Formats the value using the given formatter.

impl Copy for Axis
[src]

impl Clone for Axis
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Axis
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Display for Axis
[src]

Display implementation for Axis.

Formats the value using the given formatter. Read more