Struct rgx::math::algebra::Vector3D

source ·
#[repr(C)]
pub struct Vector3D<S = f32, U = ()> { pub x: S, pub y: S, pub z: S, /* private fields */ }
Expand description

3D vector.

Fields§

§x: S§y: S§z: S

Implementations§

source§

impl<S, U> Vector3D<S, U>

source

pub const fn new(x: S, y: S, z: S) -> Self

source

pub fn extend(self, w: S) -> Vector4D<S, U>

Extend vector to four dimensions.

Trait Implementations§

source§

impl<S, U> Add<Vector3D<S, U>> for Vector3D<S, U>where S: Add<Output = S> + Copy,

§

type Output = Vector3D<S, U>

The resulting type after applying the + operator.
source§

fn add(self, other: Vector3D<S, U>) -> Self

Performs the + operation. Read more
source§

impl<S: Clone, U: Clone> Clone for Vector3D<S, U>

source§

fn clone(&self) -> Vector3D<S, U>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug, U: Debug> Debug for Vector3D<S, U>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Copy> From<[T; 3]> for Vector3D<T>

source§

fn from(array: [T; 3]) -> Self

Converts to this type from the input type.
source§

impl<S: Zero, U: Copy> From<Vector2D<S, U>> for Vector3D<S, U>

source§

fn from(other: Vector2D<S, U>) -> Self

Converts to this type from the input type.
source§

impl<S, U: Copy> From<Vector3D<S, U>> for Vector2D<S, U>

source§

fn from(other: Vector3D<S, U>) -> Self

Converts to this type from the input type.
source§

impl From<Vector3D<f32, ()>> for Vector4D<f32>

source§

fn from(other: Vector3D<f32>) -> Self

Converts to this type from the input type.
source§

impl<S: Hash, U: Hash> Hash for Vector3D<S, U>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<Vector3D<f32, ()>> for Transform3D<f32>

Transform a Vector3D with a Transform3D.

use rgx::math::*;
let m = Transform3D::from_translation(Vector3D::new(8., 8., 0.));
let v = Vector3D::new(1., 1., 0.);

assert_eq!(m * v, Vector3D::new(9., 9., 0.));
§

type Output = Vector3D<f32, ()>

The resulting type after applying the * operator.
source§

fn mul(self, vec: Vector3D<f32>) -> Vector3D<f32>

Performs the * operation. Read more
source§

impl<S: PartialEq, U: PartialEq> PartialEq<Vector3D<S, U>> for Vector3D<S, U>

source§

fn eq(&self, other: &Vector3D<S, U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Copy, U: Copy> Copy for Vector3D<S, U>

source§

impl<S: Eq, U: Eq> Eq for Vector3D<S, U>

source§

impl<S, U> StructuralEq for Vector3D<S, U>

source§

impl<S, U> StructuralPartialEq for Vector3D<S, U>

Auto Trait Implementations§

§

impl<S, U> RefUnwindSafe for Vector3D<S, U>where S: RefUnwindSafe, U: RefUnwindSafe,

§

impl<S, U> Send for Vector3D<S, U>where S: Send, U: Send,

§

impl<S, U> Sync for Vector3D<S, U>where S: Sync, U: Sync,

§

impl<S, U> Unpin for Vector3D<S, U>where S: Unpin, U: Unpin,

§

impl<S, U> UnwindSafe for Vector3D<S, U>where S: UnwindSafe, U: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.