Struct Point3

Source
pub struct Point3 {
    pub x: i32,
    pub y: i32,
    pub z: i32,
}
Expand description

Helper struct defining a 2D point in space.

Fields§

§x: i32

The 3D point’s X location

§y: i32

The 3D point’s Y location

§z: i32

The 3D point’s Z location

Implementations§

Source§

impl Point3

Source

pub fn new<T>(x: T, y: T, z: T) -> Point3
where T: TryInto<i32>,

Create a new point from an x/y/z coordinate.

Source

pub fn from_tuple(t: (i32, i32, i32)) -> Point3

Create a point from an x/y/z tuple

Source

pub fn to_vec3(&self) -> Vec3

Converts into an UltraViolet Vec3

Trait Implementations§

Source§

impl Add<i32> for Point3

Support adding an int to a point

Source§

type Output = Point3

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> Point3

Performs the + operation. Read more
Source§

impl Add for Point3

Overloads: We support basic point math Support adding a point to a point

Source§

type Output = Point3

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Point3) -> Point3

Performs the + operation. Read more
Source§

impl AddAssign for Point3

Source§

fn add_assign(&mut self, other: Point3)

Performs the += operation. Read more
Source§

impl Clone for Point3

Source§

fn clone(&self) -> Point3

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 Debug for Point3

Source§

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

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

impl Div<f32> for Point3

Support dividing a point by an f32

Source§

type Output = Point3

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Point3

Performs the / operation. Read more
Source§

impl Div<i32> for Point3

Support dividing a point by an int

Source§

type Output = Point3

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i32) -> Point3

Performs the / operation. Read more
Source§

impl Div for Point3

Support dividing a point by a point

Source§

type Output = Point3

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Point3) -> Point3

Performs the / operation. Read more
Source§

impl DivAssign for Point3

Source§

fn div_assign(&mut self, other: Point3)

Performs the /= operation. Read more
Source§

impl From<Vec3> for Point3

Source§

fn from(item: Vec3) -> Point3

Converts to this type from the input type.
Source§

impl Mul<f32> for Point3

Support multiplying a point by an f32

Source§

type Output = Point3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Point3

Performs the * operation. Read more
Source§

impl Mul<i32> for Point3

Support multiplying a point by an int

Source§

type Output = Point3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Point3

Performs the * operation. Read more
Source§

impl Mul for Point3

Support multiplying a point by a point

Source§

type Output = Point3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Point3) -> Point3

Performs the * operation. Read more
Source§

impl MulAssign for Point3

Source§

fn mul_assign(&mut self, other: Point3)

Performs the *= operation. Read more
Source§

impl PartialEq for Point3

Source§

fn eq(&self, other: &Point3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sub<i32> for Point3

Support subtracting an int from a point

Source§

type Output = Point3

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> Point3

Performs the - operation. Read more
Source§

impl Sub for Point3

Support subtracting a point from a point

Source§

type Output = Point3

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Point3) -> Point3

Performs the - operation. Read more
Source§

impl SubAssign for Point3

Source§

fn sub_assign(&mut self, other: Point3)

Performs the -= operation. Read more
Source§

impl Copy for Point3

Source§

impl Eq for Point3

Source§

impl StructuralPartialEq for Point3

Auto Trait Implementations§

§

impl Freeze for Point3

§

impl RefUnwindSafe for Point3

§

impl Send for Point3

§

impl Sync for Point3

§

impl Unpin for Point3

§

impl UnwindSafe for Point3

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.