Struct flattiverse_connector::Vector
source · pub struct Vector { /* private fields */ }
Implementations
sourceimpl Vector
impl Vector
pub fn new(x: f32, y: f32) -> Vector
pub fn from_reader(reader: &mut dyn BinaryReader) -> Result<Vector, Error>
pub fn from_reader_with_connector(
reader: &mut dyn BinaryReader,
connector: &Arc<Connector>
) -> Result<Vector, Error>
pub fn from_angle_length(angle: f32, length: f32) -> Vector
pub fn write(&self, writer: &mut dyn BinaryWriter) -> Result<(), Error>
pub fn x(&self) -> f32
pub fn set_x(&mut self, x: f32) -> &mut Self
pub fn y(&self) -> f32
pub fn set_y(&mut self, y: f32) -> &mut Self
pub fn set(&mut self, x: f32, y: f32) -> &mut Self
pub fn angle(&self) -> f32
pub fn set_angle(&mut self, angle: f32) -> &mut Self
pub fn length(&self) -> f32
pub fn length2(&self) -> f32
pub fn set_length(&mut self, length: f32) -> &mut Self
pub fn rotate_by(&self, angle: f32) -> Vector
pub fn get_angle_from(&self, other: &Vector) -> f32
pub fn add(&self, other: &Vector) -> Vector
pub fn sub(&self, other: &Vector) -> Vector
pub fn mul(&self, factor: f32) -> Vector
pub fn div(&self, divisor: f32) -> Vector
pub fn bigger_than(&self, other: &Vector) -> bool
pub fn bigger_than_length(&self, length: f32) -> bool
pub fn smaller_than(&self, other: &Vector) -> bool
pub fn smaller_than_length(&self, length: f32) -> bool
sourcepub fn equals(vec: &Vector, r: f32) -> bool
pub fn equals(vec: &Vector, r: f32) -> bool
Checks if the length of the given Vector matches the given value with a certain tolerance
pub fn negate(&self) -> Vector
pub fn damaged(&self) -> bool
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl !UnwindSafe for Vector
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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