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] (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

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. Read more

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

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

Make slices indexable by Axis.

The returned type after indexing.

Performs the indexing (container[index]) operation.

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

Make Point3 indexable by Axis.

The returned type after indexing.

Performs the indexing (container[index]) operation.

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

Make slices mutably accessible by Axis.

Performs the mutable indexing (container[index]) operation.

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

Make Point3 mutably accessible by Axis.

Performs the mutable indexing (container[index]) operation.

Auto Trait Implementations

impl Send for Axis

impl Sync for Axis