[−][src]Struct rask_engine::math::vec2::Vec2
A 2-dimensional euclidean vector with f32
elements.
Implementations
impl Vec2
[src]
pub const fn new(x: f32, y: f32) -> Self
[src]
Creates a new Vec2
from x and y coordinates.
pub const fn zero() -> Self
[src]
Returns the zero vector.
pub const fn x(self) -> f32
[src]
Returns the x coordinate.
pub const fn y(self) -> f32
[src]
Returns the y coordinate.
pub fn dot(self, other: Self) -> f32
[src]
Returns the dot product.
pub fn norm2(self) -> f32
[src]
Returns the square of the euclidean norm of the vector.
pub fn norm(self) -> f32
[src]
Returns the euclidean norm of the vector.
pub fn normalized(self) -> Self
[src]
Returns a normalized version of the vector, that is, a vector that points in the same direction, but has norm 1.
Trait Implementations
impl Add<Vec2> for AABox
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Vec2) -> Self
[src]
impl Add<Vec2> for RBox
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Vec2) -> Self
[src]
impl Add<Vec2> for Vec2
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl AddAssign<Vec2> for AABox
[src]
fn add_assign(&mut self, other: Vec2)
[src]
impl AddAssign<Vec2> for RBox
[src]
fn add_assign(&mut self, other: Vec2)
[src]
impl AddAssign<Vec2> for Vec2
[src]
fn add_assign(&mut self, other: Self)
[src]
impl Clone for Vec2
[src]
impl Collidable for Vec2
[src]
impl Collide<AABox> for Vec2
[src]
impl Collide<RBox> for Vec2
[src]
impl Collide<SRT> for Vec2
[src]
impl Collide<Vec2> for Vec2
[src]
impl Collide<Vec2> for AABox
[src]
impl Collide<Vec2> for RBox
[src]
impl Collide<Vec2> for SRT
[src]
impl Copy for Vec2
[src]
impl Debug for Vec2
[src]
impl Default for Vec2
[src]
impl Div<Vec2> for Vec2
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
impl Div<f32> for Vec2
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, scale: f32) -> Self::Output
[src]
impl DivAssign<Vec2> for Vec2
[src]
fn div_assign(&mut self, other: Self)
[src]
impl DivAssign<f32> for Vec2
[src]
fn div_assign(&mut self, scale: f32)
[src]
impl Eq for Vec2
[src]
impl From<[f32; 2]> for Vec2
[src]
impl From<(f32, f32)> for Vec2
[src]
impl From<Vec2> for (f32, f32)
[src]
impl From<Vec2> for [f32; 2]
[src]
impl IntoIterator for Vec2
[src]
type Item = f32
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Mul<Vec2> for Mat2
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, other: Vec2) -> Self::Output
[src]
impl Mul<Vec2> for f32
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec2) -> Self::Output
[src]
impl Mul<Vec2> for Vec2
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl Mul<f32> for Vec2
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, scale: f32) -> Self::Output
[src]
impl MulAssign<Vec2> for Vec2
[src]
fn mul_assign(&mut self, other: Self)
[src]
impl MulAssign<f32> for Vec2
[src]
fn mul_assign(&mut self, scale: f32)
[src]
impl Neg for Vec2
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl PartialEq<Vec2> for Vec2
[src]
impl Sub<Vec2> for AABox
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Vec2) -> Self
[src]
impl Sub<Vec2> for RBox
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Vec2) -> Self
[src]
impl Sub<Vec2> for Vec2
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl SubAssign<Vec2> for AABox
[src]
fn sub_assign(&mut self, other: Vec2)
[src]
impl SubAssign<Vec2> for RBox
[src]
fn sub_assign(&mut self, other: Vec2)
[src]
impl SubAssign<Vec2> for Vec2
[src]
fn sub_assign(&mut self, other: Self)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vec2
impl Send for Vec2
impl Sync for Vec2
impl Unpin for Vec2
impl UnwindSafe for Vec2
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Collide<[T]> for S where
T: Collide<S>,
[src]
T: Collide<S>,
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> Pointable for T
const ALIGN: usize
type Init = T
The type for initializers.
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> TryDefault for T where
T: Default,
T: Default,
fn try_default() -> Result<T, String>
fn unwrap_default() -> Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,