rust_sc2::geometry

Struct Point3

Source
pub struct Point3 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}
Expand description

Point in 3D game world.

Fields§

§x: f32§y: f32§z: f32

Implementations§

Source§

impl Point3

Source

pub fn new(x: f32, y: f32, z: f32) -> Self

Constructs new 3D Point with given coordinates.

Source

pub fn offset(self, x: f32, y: f32, z: f32) -> Self

Returns new point with given offset.

Source

pub fn round(self) -> Self

Returns rounded point.

Source

pub fn as_tuple(self) -> (f32, f32, f32)

Returns tuple with point’s coordinates.

Source

pub fn to2(self) -> Point2

Converts 3D Point to 2D Point.

Trait Implementations§

Source§

impl Add<f32> for Point3

Source§

type Output = Point3

The resulting type after applying the + operator.
Source§

fn add(self, other: f32) -> Self

Performs the + operation. Read more
Source§

impl Add for Point3

Source§

type Output = Point3

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl Clone for Point3

Source§

fn clone(&self) -> Point3

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Point3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Point3

Source§

fn default() -> Point3

Returns the “default value” for a type. Read more
Source§

impl Div<f32> for Point3

Source§

type Output = Point3

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> Self

Performs the / operation. Read more
Source§

impl Div for Point3

Source§

type Output = Point3

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
Source§

impl From<(f32, f32, f32)> for Point3

Source§

fn from((x, y, z): (f32, f32, f32)) -> Self

Converts to this type from the input type.
Source§

impl From<Point3> for (f32, f32, f32)

Source§

fn from(p3: Point3) -> Self

Converts to this type from the input type.
Source§

impl From<Point3> for Point2

Source§

fn from(p3: Point3) -> Self

Converts to this type from the input type.
Source§

impl Mul<f32> for Point3

Source§

type Output = Point3

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> Self

Performs the * operation. Read more
Source§

impl Mul for Point3

Source§

type Output = Point3

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
Source§

impl Radius for &Point3

Source§

fn radius(&self) -> f32

Radius for struct
Source§

impl Radius for Point3

Source§

fn radius(&self) -> f32

Radius for struct
Source§

impl Sub<f32> for Point3

Source§

type Output = Point3

The resulting type after applying the - operator.
Source§

fn sub(self, other: f32) -> Self

Performs the - operation. Read more
Source§

impl Sub for Point3

Source§

type Output = Point3

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl Sum for Point3

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Copy for Point3

Auto Trait Implementations§

§

impl Freeze for Point3

§

impl RefUnwindSafe for Point3

§

impl Send for Point3

§

impl Sync for Point3

§

impl Unpin for Point3

§

impl UnwindSafe for Point3

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> Distance for T
where T: Into<Point2>,

Source§

fn distance_squared<P: Into<Point2>>(self, other: P) -> f32

Calculates squared euclidean distance from self to other.
Source§

fn distance<P: Into<Point2>>(self, other: P) -> f32

Calculates euclidean distance from self to other.
Source§

fn is_closer<P: Into<Point2>>(self, distance: f32, other: P) -> bool

Checks if distance between self and other is less than given distance.
Source§

fn is_further<P: Into<Point2>>(self, distance: f32, other: P) -> bool

Checks if distance between self and other is greater than given distance.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V