#[repr(C)]pub struct Point3<S> {
pub x: S,
pub y: S,
pub z: S,
}
Expand description
A point in 3-dimensional space.
This type is marked as #[repr(C)]
.
Fields§
§x: S
§y: S
§z: S
Implementations§
source§impl<S> Point3<S>where
S: BaseNum,
impl<S> Point3<S>where
S: BaseNum,
pub fn from_homogeneous(v: Vector4<S>) -> Point3<S>
pub fn to_homogeneous(self) -> Vector4<S>
source§impl<S> Point3<S>
impl<S> Point3<S>
Trait Implementations§
source§impl<S> AbsDiffEq for Point3<S>where
S: BaseFloat,
impl<S> AbsDiffEq for Point3<S>where
S: BaseFloat,
source§fn default_epsilon() -> <S as AbsDiffEq>::Epsilon
fn default_epsilon() -> <S as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn abs_diff_eq(
&self,
other: &Point3<S>,
epsilon: <S as AbsDiffEq>::Epsilon
) -> bool
fn abs_diff_eq( &self, other: &Point3<S>, epsilon: <S as AbsDiffEq>::Epsilon ) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of [
AbsDiffEq::abs_diff_eq
].source§impl<S> AddAssign<Vector3<S>> for Point3<S>
impl<S> AddAssign<Vector3<S>> for Point3<S>
source§fn add_assign(&mut self, vector: Vector3<S>)
fn add_assign(&mut self, vector: Vector3<S>)
Performs the
+=
operation. Read moresource§impl<S> Array for Point3<S>where
S: BaseNum,
impl<S> Array for Point3<S>where
S: BaseNum,
type Element = S
source§fn from_value(scalar: S) -> Point3<S>
fn from_value(scalar: S) -> Point3<S>
Construct a vector from a single value, replicating it. Read more
source§fn as_mut_ptr(&mut self) -> *mut Self::Element
fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
source§fn swap_elements(&mut self, i: usize, j: usize)
fn swap_elements(&mut self, i: usize, j: usize)
Swap the elements at indices
i
and j
in-place.source§impl<S> DivAssign<S> for Point3<S>
impl<S> DivAssign<S> for Point3<S>
source§fn div_assign(&mut self, scalar: S)
fn div_assign(&mut self, scalar: S)
Performs the
/=
operation. Read moresource§impl<S> ElementWise<S> for Point3<S>where
S: BaseNum,
impl<S> ElementWise<S> for Point3<S>where
S: BaseNum,
fn add_element_wise(self, rhs: S) -> Point3<S>
fn sub_element_wise(self, rhs: S) -> Point3<S>
fn mul_element_wise(self, rhs: S) -> Point3<S>
fn div_element_wise(self, rhs: S) -> Point3<S>
fn rem_element_wise(self, rhs: S) -> Point3<S>
fn add_assign_element_wise(&mut self, rhs: S)
fn sub_assign_element_wise(&mut self, rhs: S)
fn mul_assign_element_wise(&mut self, rhs: S)
fn div_assign_element_wise(&mut self, rhs: S)
fn rem_assign_element_wise(&mut self, rhs: S)
source§impl<S> ElementWise for Point3<S>where
S: BaseNum,
impl<S> ElementWise for Point3<S>where
S: BaseNum,
fn add_element_wise(self, rhs: Point3<S>) -> Point3<S>
fn sub_element_wise(self, rhs: Point3<S>) -> Point3<S>
fn mul_element_wise(self, rhs: Point3<S>) -> Point3<S>
fn div_element_wise(self, rhs: Point3<S>) -> Point3<S>
fn rem_element_wise(self, rhs: Point3<S>) -> Point3<S>
fn add_assign_element_wise(&mut self, rhs: Point3<S>)
fn sub_assign_element_wise(&mut self, rhs: Point3<S>)
fn mul_assign_element_wise(&mut self, rhs: Point3<S>)
fn div_assign_element_wise(&mut self, rhs: Point3<S>)
fn rem_assign_element_wise(&mut self, rhs: Point3<S>)
source§impl<S> EuclideanSpace for Point3<S>where
S: BaseNum,
impl<S> EuclideanSpace for Point3<S>where
S: BaseNum,
source§impl<S> MetricSpace for Point3<S>where
S: BaseFloat,
impl<S> MetricSpace for Point3<S>where
S: BaseFloat,
source§impl<S> MulAssign<S> for Point3<S>
impl<S> MulAssign<S> for Point3<S>
source§fn mul_assign(&mut self, scalar: S)
fn mul_assign(&mut self, scalar: S)
Performs the
*=
operation. Read moresource§impl<S> PartialEq for Point3<S>where
S: PartialEq,
impl<S> PartialEq for Point3<S>where
S: PartialEq,
source§impl<S> RelativeEq for Point3<S>where
S: BaseFloat,
impl<S> RelativeEq for Point3<S>where
S: BaseFloat,
source§fn default_max_relative() -> <S as AbsDiffEq>::Epsilon
fn default_max_relative() -> <S as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &Point3<S>,
epsilon: <S as AbsDiffEq>::Epsilon,
max_relative: <S as AbsDiffEq>::Epsilon
) -> bool
fn relative_eq( &self, other: &Point3<S>, epsilon: <S as AbsDiffEq>::Epsilon, max_relative: <S as AbsDiffEq>::Epsilon ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
The inverse of [
RelativeEq::relative_eq
].source§impl<S> RemAssign<S> for Point3<S>
impl<S> RemAssign<S> for Point3<S>
source§fn rem_assign(&mut self, scalar: S)
fn rem_assign(&mut self, scalar: S)
Performs the
%=
operation. Read moresource§impl<S> SubAssign<Vector3<S>> for Point3<S>
impl<S> SubAssign<Vector3<S>> for Point3<S>
source§fn sub_assign(&mut self, vector: Vector3<S>)
fn sub_assign(&mut self, vector: Vector3<S>)
Performs the
-=
operation. Read moresource§impl<S> Transform<Point3<S>> for Matrix3<S>where
S: BaseFloat,
impl<S> Transform<Point3<S>> for Matrix3<S>where
S: BaseFloat,
source§fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
👎Deprecated: Use look_at_rh or look_at_lh
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn look_at_lh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
fn look_at_lh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn look_at_rh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
fn look_at_rh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix3<S>
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn transform_vector(&self, vec: Vector3<S>) -> Vector3<S>
fn transform_vector(&self, vec: Vector3<S>) -> Vector3<S>
Transform a vector using this transform.
source§fn transform_point(&self, point: Point3<S>) -> Point3<S>
fn transform_point(&self, point: Point3<S>) -> Point3<S>
Transform a point using this transform.
source§fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
Combine this transform with another, yielding a new transformation
which has the effects of both.
source§fn inverse_transform(&self) -> Option<Matrix3<S>>
fn inverse_transform(&self) -> Option<Matrix3<S>>
Create a transform that “un-does” this one.
source§fn inverse_transform_vector(
&self,
vec: <P as EuclideanSpace>::Diff
) -> Option<<P as EuclideanSpace>::Diff>
fn inverse_transform_vector( &self, vec: <P as EuclideanSpace>::Diff ) -> Option<<P as EuclideanSpace>::Diff>
Inverse transform a vector using this transform
source§fn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Combine this transform with another, in-place.
source§impl<S> Transform<Point3<S>> for Matrix4<S>where
S: BaseFloat,
impl<S> Transform<Point3<S>> for Matrix4<S>where
S: BaseFloat,
source§fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>
fn look_at(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>
👎Deprecated: Use look_at_rh or look_at_lh
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn look_at_lh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>
fn look_at_lh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn look_at_rh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>
fn look_at_rh(eye: Point3<S>, center: Point3<S>, up: Vector3<S>) -> Matrix4<S>
Create a transformation that rotates a vector to look at
center
from
eye
, using up
for orientation.source§fn transform_vector(&self, vec: Vector3<S>) -> Vector3<S>
fn transform_vector(&self, vec: Vector3<S>) -> Vector3<S>
Transform a vector using this transform.
source§fn transform_point(&self, point: Point3<S>) -> Point3<S>
fn transform_point(&self, point: Point3<S>) -> Point3<S>
Transform a point using this transform.
source§fn concat(&self, other: &Matrix4<S>) -> Matrix4<S>
fn concat(&self, other: &Matrix4<S>) -> Matrix4<S>
Combine this transform with another, yielding a new transformation
which has the effects of both.
source§fn inverse_transform(&self) -> Option<Matrix4<S>>
fn inverse_transform(&self) -> Option<Matrix4<S>>
Create a transform that “un-does” this one.
source§fn inverse_transform_vector(
&self,
vec: <P as EuclideanSpace>::Diff
) -> Option<<P as EuclideanSpace>::Diff>
fn inverse_transform_vector( &self, vec: <P as EuclideanSpace>::Diff ) -> Option<<P as EuclideanSpace>::Diff>
Inverse transform a vector using this transform
source§fn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Combine this transform with another, in-place.
source§impl<S> UlpsEq for Point3<S>where
S: BaseFloat,
impl<S> UlpsEq for Point3<S>where
S: BaseFloat,
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
impl<S> Copy for Point3<S>where
S: Copy,
impl<S> Eq for Point3<S>where
S: Eq,
impl<S> StructuralPartialEq for Point3<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Point3<S>where
S: RefUnwindSafe,
impl<S> Send for Point3<S>where
S: Send,
impl<S> Sync for Point3<S>where
S: Sync,
impl<S> Unpin for Point3<S>where
S: Unpin,
impl<S> UnwindSafe for Point3<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more