Struct gamemath::vec2::Vec2 [−][src]
Fields
x: f32
y: f32
Methods
impl Vec2
[src]
impl Vec2
pub fn new(x: f32, y: f32) -> Vec2
[src]
pub fn new(x: f32, y: f32) -> Vec2
pub fn dot(&self, right: Vec2) -> f32
[src]
pub fn dot(&self, right: Vec2) -> f32
pub fn fill(&mut self, value: f32)
[src]
pub fn fill(&mut self, value: f32)
pub fn length_squared(&self) -> f32
[src]
pub fn length_squared(&self) -> f32
pub fn length(&self) -> f32
[src]
pub fn length(&self) -> f32
pub fn normalized(&self) -> Vec2
[src]
pub fn normalized(&self) -> Vec2
pub fn normalize(&mut self)
[src]
pub fn normalize(&mut self)
Trait Implementations
impl Clone for Vec2
[src]
impl Clone for Vec2
fn clone(&self) -> Vec2
[src]
fn clone(&self) -> Vec2
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Vec2
[src]
impl Copy for Vec2
impl Debug for Vec2
[src]
impl Debug for Vec2
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Vec2
[src]
impl PartialEq for Vec2
fn eq(&self, other: &Vec2) -> bool
[src]
fn eq(&self, other: &Vec2) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vec2) -> bool
[src]
fn ne(&self, other: &Vec2) -> bool
This method tests for !=
.
impl Default for Vec2
[src]
impl Default for Vec2
impl From<(f32, f32)> for Vec2
[src]
impl From<(f32, f32)> for Vec2
impl From<[f32; 2]> for Vec2
[src]
impl From<[f32; 2]> for Vec2
impl From<Vec3> for Vec2
[src]
impl From<Vec3> for Vec2
impl From<Vec4> for Vec2
[src]
impl From<Vec4> for Vec2
impl From<f32> for Vec2
[src]
impl From<f32> for Vec2
impl Index<usize> for Vec2
[src]
impl Index<usize> for Vec2
type Output = f32
The returned type after indexing.
fn index(&self, index: usize) -> &f32
[src]
fn index(&self, index: usize) -> &f32
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Vec2
[src]
impl IndexMut<usize> for Vec2
fn index_mut(&mut self, index: usize) -> &mut f32
[src]
fn index_mut(&mut self, index: usize) -> &mut f32
Performs the mutable indexing (container[index]
) operation.
impl Add for Vec2
[src]
impl Add for Vec2
type Output = Vec2
The resulting type after applying the +
operator.
fn add(self, right: Vec2) -> Vec2
[src]
fn add(self, right: Vec2) -> Vec2
Performs the +
operation.
impl AddAssign for Vec2
[src]
impl AddAssign for Vec2
fn add_assign(&mut self, right: Vec2)
[src]
fn add_assign(&mut self, right: Vec2)
Performs the +=
operation.
impl Sub for Vec2
[src]
impl Sub for Vec2
type Output = Vec2
The resulting type after applying the -
operator.
fn sub(self, right: Vec2) -> Vec2
[src]
fn sub(self, right: Vec2) -> Vec2
Performs the -
operation.
impl SubAssign for Vec2
[src]
impl SubAssign for Vec2
fn sub_assign(&mut self, right: Vec2)
[src]
fn sub_assign(&mut self, right: Vec2)
Performs the -=
operation.
impl Mul<f32> for Vec2
[src]
impl Mul<f32> for Vec2
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, right: f32) -> Vec2
[src]
fn mul(self, right: f32) -> Vec2
Performs the *
operation.
impl MulAssign<f32> for Vec2
[src]
impl MulAssign<f32> for Vec2
fn mul_assign(&mut self, right: f32)
[src]
fn mul_assign(&mut self, right: f32)
Performs the *=
operation.
impl Neg for Vec2
[src]
impl Neg for Vec2
type Output = Vec2
The resulting type after applying the -
operator.
fn neg(self) -> Vec2
[src]
fn neg(self) -> Vec2
Performs the unary -
operation.
impl From<Vec2> for Vec3
[src]
impl From<Vec2> for Vec3
impl From<Vec2> for Vec4
[src]
impl From<Vec2> for Vec4