#[repr(transparent)]pub struct Vec2 { /* private fields */ }
Implementations
sourceimpl Vec2
impl Vec2
pub fn add(&self, b: &Vec2) -> Vec2
pub fn divide(&self, b: &Vec2) -> Vec2
pub fn dot(&self, b: &Vec2) -> f32
pub fn x(&self) -> f32
pub fn y(&self) -> f32
pub fn interpolate(&self, v2: &Vec2, factor: f64) -> Vec2
pub fn length(&self) -> f32
pub fn max(&self, b: &Vec2) -> Vec2
pub fn min(&self, b: &Vec2) -> Vec2
pub fn multiply(&self, b: &Vec2) -> Vec2
pub fn near(&self, v2: &Vec2, epsilon: f32) -> bool
pub fn negate(&self) -> Vec2
pub fn normalize(&self) -> Vec2
pub fn scale(&self, factor: f32) -> Vec2
pub fn subtract(&self, b: &Vec2) -> Vec2
pub fn one() -> Vec2
pub fn x_axis() -> Vec2
pub fn y_axis() -> Vec2
pub fn zero() -> Vec2
Trait Implementations
sourceimpl StaticType for Vec2
impl StaticType for Vec2
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Copy for Vec2
impl Eq for Vec2
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
sourcefn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a SendValue
clone of self
.