| 1 | // pathfinder/geometry/src/basic/point.rs |
| 2 | // |
| 3 | // Copyright © 2019 The Pathfinder Project Developers. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
| 11 | //! A SIMD-optimized point type. |
| 12 | |
| 13 | use pathfinder_simdrust-analyzer cargo pathfinder_simd 0.5.6 crate/::defaultrust-analyzer cargo pathfinder_simd 0.5.6 x86/::{F32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x2#, F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#, I32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/I32x2#}; |
| 14 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::hashrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/::{Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#, Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher#}; |
| 15 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#, AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#, Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#, Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#, MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#, Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#, Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#, SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#}; |
| 16 | |
| 17 | /// 2D points with 32-bit floating point coordinates. |
| 18 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)] |
| 19 | pub struct Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(pub F32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x2#); |
| 20 | |
| 21 | impl Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 22 | #[inline] |
| 23 | pub fn newrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]new().(x: f32, y: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 24 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(F32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x2#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]new().(x, y)) |
| 25 | } |
| 26 | |
| 27 | #[inline] |
| 28 | pub fn splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]splat().(value: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 29 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(F32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x2#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]splat().(value)) |
| 30 | } |
| 31 | |
| 32 | #[inline] |
| 33 | pub fn zerorust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]zero().() -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 34 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::defaultrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][Default]default().() |
| 35 | } |
| 36 | |
| 37 | #[inline] |
| 38 | pub fn to_3drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]to_3d().(self) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 39 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..to_f32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]to_f32x4().().concat_xy_zwrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]concat_xy_zw().(F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]new().(0.0, 0.0, 0.0, 0.0))) |
| 40 | } |
| 41 | |
| 42 | #[inline] |
| 43 | pub fn to_4drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]to_4d().(self) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 44 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..to_f32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]to_f32x4().().concat_xy_zwrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]concat_xy_zw().(F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]new().(0.0, 0.0, 0.0, 1.0))) |
| 45 | } |
| 46 | |
| 47 | #[inline] |
| 48 | pub fn xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]x().(self) -> f32 { |
| 49 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index(). |
| 50 | } |
| 51 | |
| 52 | #[inline] |
| 53 | pub fn yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]y().(self) -> f32 { |
| 54 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index(). |
| 55 | } |
| 56 | |
| 57 | #[inline] |
| 58 | pub fn set_xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]set_x().(&mut self, x: f32) { |
| 59 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`IndexMut<usize>`]index_mut().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`IndexMut<usize>`]index_mut(). = x; |
| 60 | } |
| 61 | |
| 62 | #[inline] |
| 63 | pub fn set_yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]set_y().(&mut self, y: f32) { |
| 64 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`IndexMut<usize>`]index_mut().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`IndexMut<usize>`]index_mut(). = y; |
| 65 | } |
| 66 | |
| 67 | #[inline] |
| 68 | pub fn minrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]min().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 69 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..minrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]min().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.)) |
| 70 | } |
| 71 | |
| 72 | #[inline] |
| 73 | pub fn maxrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]max().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 74 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..maxrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]max().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.)) |
| 75 | } |
| 76 | |
| 77 | #[inline] |
| 78 | pub fn clamprust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]clamp().(self, min_val: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#, max_val: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 79 | self.maxrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]max().(min_val).minrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]min().(max_val) |
| 80 | } |
| 81 | |
| 82 | #[inline] |
| 83 | pub fn detrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]det().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> f32 { |
| 84 | self.xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]x().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().other.yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]y().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().self.yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]y().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().other.xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]x().() |
| 85 | } |
| 86 | |
| 87 | #[inline] |
| 88 | pub fn dotrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]dot().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> f32 { |
| 89 | let xy = self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.; |
| 90 | xy.xrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x2]x().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().xy.yrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x2]y().() |
| 91 | } |
| 92 | |
| 93 | #[inline] |
| 94 | pub fn floorrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]floor().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 95 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..floorrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]floor().()) |
| 96 | } |
| 97 | |
| 98 | #[inline] |
| 99 | pub fn ceilrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]ceil().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 100 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..ceilrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]ceil().()) |
| 101 | } |
| 102 | |
| 103 | /// Rounds both coordinates to the nearest integer. |
| 104 | #[inline] |
| 105 | pub fn roundrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]round().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 106 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..to_i32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]to_i32x2().().to_f32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]to_f32x2().()) |
| 107 | } |
| 108 | |
| 109 | /// Treats this point as a vector and calculates its squared length. |
| 110 | #[inline] |
| 111 | pub fn square_lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]square_length().(self) -> f32 { |
| 112 | let squared = self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul().self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.; |
| 113 | squared[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().squared[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Index<usize>`]index(). |
| 114 | } |
| 115 | |
| 116 | /// Treats this point as a vector and calculates its length. |
| 117 | #[inline] |
| 118 | pub fn lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]length().(self) -> f32 { |
| 119 | f32::sqrtrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sqrt().(self.square_lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]square_length().()) |
| 120 | } |
| 121 | |
| 122 | /// Treats this point as a vector and normalizes it. |
| 123 | #[inline] |
| 124 | pub fn normalizerust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]normalize().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 125 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().*rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().(1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().self.lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]length().()) |
| 126 | } |
| 127 | |
| 128 | /// Swaps y and x. |
| 129 | #[inline] |
| 130 | pub fn yxrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]yx().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 131 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..yxrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]yx().()) |
| 132 | } |
| 133 | |
| 134 | /// Returns the coefficient when the given vector `a` is projected onto this one. |
| 135 | /// |
| 136 | /// That is, if this vector is `v` and this function returns `c`, then `proj_v a = cv`. In |
| 137 | /// other words, this function computes `(a⋅v) / (v⋅v)`. |
| 138 | #[inline] |
| 139 | pub fn projection_coefficientrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]projection_coefficient().(self, a: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> f32 { |
| 140 | a.dotrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]dot().(self) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().self.square_lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]square_length().() |
| 141 | } |
| 142 | |
| 143 | #[inline] |
| 144 | pub fn is_zerorust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]is_zero().(self) -> bool { |
| 145 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`PartialEq<Self>`]eq().==rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`PartialEq<Self>`]eq(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`PartialEq<Self>`]eq().Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::zerorust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]zero().() |
| 146 | } |
| 147 | |
| 148 | #[inline] |
| 149 | pub fn lerprust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]lerp().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#, t: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 150 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().+rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().(other rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().self) rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().*rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().t |
| 151 | } |
| 152 | |
| 153 | #[inline] |
| 154 | pub fn to_i32rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]to_i32().(self) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 155 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..to_i32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]to_i32x2().()) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | /// A convenience alias for `Vector2F::new()`. |
| 160 | #[inline] |
| 161 | pub fn vec2frust-analyzer cargo pathfinder_geometry 0.5.1 vector/vec2f().(x: f32, y: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 162 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::newrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]new().(x, y) |
| 163 | } |
| 164 | |
| 165 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 166 | #[inline] |
| 167 | fn eqrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`PartialEq<Self>`]eq().(&self, other: &Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> bool { |
| 168 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0..packed_eqrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2]packed_eq().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.).all_truerust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[U32x2]all_true().() |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 173 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 174 | #[inline] |
| 175 | fn addrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 176 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Add<Self>`]add().+rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Add<Self>`]add(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Add<Self>`]add().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<f32> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 181 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<f32>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 182 | #[inline] |
| 183 | fn addrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<f32>`]add().(self, other: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 184 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().+rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]splat().(other) |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 189 | #[inline] |
| 190 | fn add_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`AddAssign<Self>`]add_assign().(&mut self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) { |
| 191 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().+rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Add<Self>`]add().other |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 196 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 197 | #[inline] |
| 198 | fn subrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 199 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Sub<Self>`]sub().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.) |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<f32> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 204 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<f32>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 205 | #[inline] |
| 206 | fn subrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<f32>`]sub().(self, other: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 207 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]splat().(other) |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | impl SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 212 | #[inline] |
| 213 | fn sub_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`SubAssign<Self>`]sub_assign().(&mut self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) { |
| 214 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Sub<Self>`]sub().other |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 219 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 220 | #[inline] |
| 221 | fn mulrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 222 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Mul<Self>`]mul().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.) |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f32> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 227 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 228 | #[inline] |
| 229 | fn mulrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().(self, other: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 230 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul().Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]splat().(other) |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 235 | #[inline] |
| 236 | fn mul_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`MulAssign<Self>`]mul_assign().(&mut self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) { |
| 237 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<Self>`]mul().other |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<f32> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 242 | #[inline] |
| 243 | fn mul_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`MulAssign<f32>`]mul_assign().(&mut self, other: f32) { |
| 244 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().*rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Mul<f32>`]mul().other |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | impl Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 249 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<Self>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 250 | #[inline] |
| 251 | fn divrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<Self>`]div().(self, other: Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 252 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Div<Self>`]div()./rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Div<Self>`]div(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x2][`Div<Self>`]div().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.) |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | impl Divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#<f32> for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 257 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<f32>`]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 258 | #[inline] |
| 259 | fn divrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<f32>`]div().(self, other: f32) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 260 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<Self>`]div()./rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<Self>`]div(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][`Div<Self>`]div().Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]splat().(other) |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 265 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][Neg]Output# = Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 266 | #[inline] |
| 267 | fn negrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][Neg]neg().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 268 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(-rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x2][Neg]neg().self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#0.) |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /// Either a scalar or a `Vector2F`. |
| 273 | /// |
| 274 | /// Scalars will be automatically splatted (i.e. `x` becomes `vec2f(x, x)`). |
| 275 | /// |
| 276 | /// Be judicious with the use of this trait. Only use it if it will aid readability without the |
| 277 | /// potential to introduce bugs. |
| 278 | pub trait IntoVector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/IntoVector2F# { |
| 279 | fn into_vector_2frust-analyzer cargo pathfinder_geometry 0.5.1 vector/IntoVector2F#into_vector_2f().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#; |
| 280 | } |
| 281 | |
| 282 | impl IntoVector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/IntoVector2F# for Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 283 | #[inline] |
| 284 | fn into_vector_2frust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F][IntoVector2F]into_vector_2f().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 285 | self |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | impl IntoVector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/IntoVector2F# for f32 { |
| 290 | #[inline] |
| 291 | fn into_vector_2frust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[f32][IntoVector2F]into_vector_2f().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 292 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2F]splat().(self) |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | /// 2D points with 32-bit signed integer coordinates. |
| 297 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)] |
| 298 | pub struct Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(pub I32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/I32x2#); |
| 299 | |
| 300 | impl Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 301 | #[inline] |
| 302 | pub fn newrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]new().(x: i32, y: i32) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 303 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(I32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/I32x2#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]new().(x, y)) |
| 304 | } |
| 305 | |
| 306 | #[inline] |
| 307 | pub fn splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]splat().(value: i32) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 308 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(I32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/I32x2#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]splat().(value)) |
| 309 | } |
| 310 | |
| 311 | #[inline] |
| 312 | pub fn zerorust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]zero().() -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 313 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#::defaultrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][Default]default().() |
| 314 | } |
| 315 | |
| 316 | #[inline] |
| 317 | pub fn xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]x().(self) -> i32 { |
| 318 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Index<usize>`]index().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Index<usize>`]index(). |
| 319 | } |
| 320 | |
| 321 | #[inline] |
| 322 | pub fn yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]y().(self) -> i32 { |
| 323 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Index<usize>`]index().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Index<usize>`]index(). |
| 324 | } |
| 325 | |
| 326 | #[inline] |
| 327 | pub fn set_xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]set_x().(&mut self, x: i32) { |
| 328 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`IndexMut<usize>`]index_mut().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`IndexMut<usize>`]index_mut(). = x; |
| 329 | } |
| 330 | |
| 331 | #[inline] |
| 332 | pub fn set_yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]set_y().(&mut self, y: i32) { |
| 333 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`IndexMut<usize>`]index_mut().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`IndexMut<usize>`]index_mut(). = y; |
| 334 | } |
| 335 | |
| 336 | #[inline] |
| 337 | pub fn minrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]min().(self, other: Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 338 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0..minrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]min().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.)) |
| 339 | } |
| 340 | |
| 341 | #[inline] |
| 342 | pub fn maxrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]max().(self, other: Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 343 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0..maxrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]max().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.)) |
| 344 | } |
| 345 | |
| 346 | #[inline] |
| 347 | pub fn to_f32rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]to_f32().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 348 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0..to_f32x2rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]to_f32x2().()) |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | /// A convenience alias for `Vector2I::new()`. |
| 353 | #[inline] |
| 354 | pub fn vec2irust-analyzer cargo pathfinder_geometry 0.5.1 vector/vec2i().(x: i32, y: i32) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 355 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#::newrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]new().(x, y) |
| 356 | } |
| 357 | |
| 358 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 359 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<Self>`]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 360 | #[inline] |
| 361 | fn addrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<Self>`]add().(self, other: Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 362 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Add<Self>`]add().+rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Add<Self>`]add(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Add<Self>`]add().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.) |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<i32> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 367 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<i32>`]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 368 | #[inline] |
| 369 | fn addrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<i32>`]add().(self, other: i32) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 370 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<Self>`]add().+rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<Self>`]add(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Add<Self>`]add().Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]splat().(other) |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#<Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 375 | #[inline] |
| 376 | fn add_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`AddAssign<Self>`]add_assign().(&mut self, other: Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) { |
| 377 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0. rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[I32x2][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[I32x2][`AddAssign<Self>`]add_assign(). rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[I32x2][`AddAssign<Self>`]add_assign().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0. |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 382 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][Neg]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 383 | #[inline] |
| 384 | fn negrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][Neg]neg().(self) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 385 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(-rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[I32x2][Neg]neg().self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 390 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<Self>`]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 391 | #[inline] |
| 392 | fn subrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<Self>`]sub().(self, other: Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 393 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Sub<Self>`]sub().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.) |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<i32> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 398 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<i32>`]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 399 | #[inline] |
| 400 | fn subrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<i32>`]sub().(self, other: i32) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 401 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Sub<Self>`]sub().Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]splat().(other) |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 406 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<Self>`]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 407 | #[inline] |
| 408 | fn mulrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<Self>`]mul().(self, other: Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 409 | Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2][`Mul<Self>`]mul().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.) |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<i32> for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 414 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<i32>`]Output# = Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#; |
| 415 | #[inline] |
| 416 | fn mulrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<i32>`]mul().(self, other: i32) -> Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 417 | self rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`Mul<Self>`]mul().Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#::splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]splat().(other) |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 422 | #[inline] |
| 423 | fn eqrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][`PartialEq<Self>`]eq().(&self, other: &Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#) -> bool { |
| 424 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0..packed_eqrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[I32x2]packed_eq().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I#0.).all_truerust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[U32x4]all_true().() |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | impl Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq# for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# {} |
| 429 | |
| 430 | impl Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash# for Vector2Irust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2I# { |
| 431 | #[inline] |
| 432 | fn hashrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I][Hash]hash().<H>(&self, state: &mut H) where H: Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher# { |
| 433 | self.xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]x().().hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/impls/impl#[i32][Hash]hash().(state); |
| 434 | self.yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector2I]y().().hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/impls/impl#[i32][Hash]hash().(state); |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | /// 3D points. |
| 439 | /// |
| 440 | /// The w value in the SIMD vector is always 0.0. |
| 441 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 442 | pub struct Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(pub F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#); |
| 443 | |
| 444 | impl Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 445 | #[inline] |
| 446 | pub fn newrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]new().(x: f32, y: f32, z: f32) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 447 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]new().(x, y, z, 0.0)) |
| 448 | } |
| 449 | |
| 450 | #[inline] |
| 451 | pub fn splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]splat().(x: f32) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 452 | let mut vector = F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(x); |
| 453 | vector.set_wrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4]set_w().(0.0); |
| 454 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(vector) |
| 455 | } |
| 456 | |
| 457 | /// Truncates this vector to 2D. |
| 458 | #[inline] |
| 459 | pub fn to_2drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]to_2d().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 460 | Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0..xyrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]xy().()) |
| 461 | } |
| 462 | |
| 463 | /// Converts this vector to an equivalent 3D homogeneous one with a w component of 1.0. |
| 464 | #[inline] |
| 465 | pub fn to_4drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]to_4d().(self) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 466 | let mut vector = self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.; |
| 467 | vector.set_wrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4]set_w().(1.0); |
| 468 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(vector) |
| 469 | } |
| 470 | |
| 471 | #[inline] |
| 472 | pub fn crossrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]cross().(self, other: Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 473 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0..yzxwrust-analyzer cargo pathfinder_simd 0.5.6 x86/swizzle_f32x4/impl#[F32x4]yzxw().() rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0..zxywrust-analyzer cargo pathfinder_simd 0.5.6 x86/swizzle_f32x4/impl#[F32x4]zxyw().() rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0..zxywrust-analyzer cargo pathfinder_simd 0.5.6 x86/swizzle_f32x4/impl#[F32x4]zxyw().() rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0..yzxwrust-analyzer cargo pathfinder_simd 0.5.6 x86/swizzle_f32x4/impl#[F32x4]yzxw().()) |
| 474 | } |
| 475 | |
| 476 | #[inline] |
| 477 | pub fn square_lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]square_length().(self) -> f32 { |
| 478 | let squared = self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.; |
| 479 | squared[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().squared[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().squared[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().2]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 480 | } |
| 481 | |
| 482 | #[inline] |
| 483 | pub fn lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]length().(self) -> f32 { |
| 484 | f32::sqrtrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sqrt().(self.square_lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]square_length().()) |
| 485 | } |
| 486 | |
| 487 | #[inline] |
| 488 | pub fn normalizerust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]normalize().(self) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 489 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().self.lengthrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]length().())) |
| 490 | } |
| 491 | |
| 492 | #[inline] |
| 493 | pub fn xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]x().(self) -> f32 { |
| 494 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 495 | } |
| 496 | |
| 497 | #[inline] |
| 498 | pub fn yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]y().(self) -> f32 { |
| 499 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 500 | } |
| 501 | |
| 502 | #[inline] |
| 503 | pub fn zrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]z().(self) -> f32 { |
| 504 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().2]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 505 | } |
| 506 | |
| 507 | #[inline] |
| 508 | pub fn scalerust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]scale().(self, factor: f32) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 509 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(factor)) |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#> for Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 514 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][`Add<Self>`]Output# = Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#; |
| 515 | #[inline] |
| 516 | fn addrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][`Add<Self>`]add().(self, other: Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 517 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add().+rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.) |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign# for Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 522 | #[inline] |
| 523 | fn add_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][`AddAssign<Self>`]add_assign().(&mut self, other: Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#) { |
| 524 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4][`AddAssign<Self>`]add_assign(). rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4][`AddAssign<Self>`]add_assign().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 529 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][Neg]Output# = Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#; |
| 530 | #[inline] |
| 531 | fn negrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][Neg]neg().(self) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 532 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, 0.0)) |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#> for Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 537 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][`Sub<Self>`]Output# = Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#; |
| 538 | #[inline] |
| 539 | fn subrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F][`Sub<Self>`]sub().(self, other: Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 540 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#0.) |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | /// 3D homogeneous points. |
| 545 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 546 | pub struct Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(pub F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#); |
| 547 | |
| 548 | impl Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 549 | #[inline] |
| 550 | pub fn newrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]new().(x: f32, y: f32, z: f32, w: f32) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 551 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]new().(x, y, z, w)) |
| 552 | } |
| 553 | |
| 554 | #[inline] |
| 555 | pub fn splatrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]splat().(value: f32) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 556 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(value)) |
| 557 | } |
| 558 | |
| 559 | #[inline] |
| 560 | pub fn to_2drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]to_2d().(self) -> Vector2Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector2F# { |
| 561 | self.to_3drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]to_3d().().to_2drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector3F]to_2d().() |
| 562 | } |
| 563 | |
| 564 | /// Performs perspective division to convert this vector to 3D. |
| 565 | #[inline] |
| 566 | pub fn to_3drust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]to_3d().(self) -> Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F# { |
| 567 | let mut vector = self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().self.wrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]w().()); |
| 568 | vector.set_wrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4]set_w().(0.0); |
| 569 | Vector3Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector3F#(vector) |
| 570 | } |
| 571 | |
| 572 | #[inline] |
| 573 | pub fn xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]x().(self) -> f32 { |
| 574 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 575 | } |
| 576 | |
| 577 | #[inline] |
| 578 | pub fn yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]y().(self) -> f32 { |
| 579 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 580 | } |
| 581 | |
| 582 | #[inline] |
| 583 | pub fn zrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]z().(self) -> f32 { |
| 584 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().2]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 585 | } |
| 586 | |
| 587 | #[inline] |
| 588 | pub fn wrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]w().(self) -> f32 { |
| 589 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index().3]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Index<usize>`]index(). |
| 590 | } |
| 591 | |
| 592 | #[inline] |
| 593 | pub fn scalerust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]scale().(self, x: f32) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 594 | let mut factors = F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(x); |
| 595 | factors[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut().3]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut(). = 1.0; |
| 596 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().factors) |
| 597 | } |
| 598 | |
| 599 | #[inline] |
| 600 | pub fn set_xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]set_x().(&mut self, x: f32) { |
| 601 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut().0]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut(). = x |
| 602 | } |
| 603 | |
| 604 | #[inline] |
| 605 | pub fn set_yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]set_y().(&mut self, y: f32) { |
| 606 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut().1]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut(). = y |
| 607 | } |
| 608 | |
| 609 | #[inline] |
| 610 | pub fn set_zrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]set_z().(&mut self, z: f32) { |
| 611 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut().2]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut(). = z |
| 612 | } |
| 613 | |
| 614 | #[inline] |
| 615 | pub fn set_wrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]set_w().(&mut self, w: f32) { |
| 616 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.[rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut().3]rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`IndexMut<usize>`]index_mut(). = w |
| 617 | } |
| 618 | |
| 619 | #[inline] |
| 620 | pub fn approx_eqrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]approx_eq().(self, other: Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#, epsilon: f32) -> bool { |
| 621 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0..approx_eqrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4]approx_eq().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0., epsilon) |
| 622 | } |
| 623 | |
| 624 | /// Checks to see whether this *homogeneous* coordinate equals zero. |
| 625 | /// |
| 626 | /// Note that since this treats the coordinate as a homogeneous coordinate, the `w` is ignored. |
| 627 | // TODO(pcwalton): Optimize with SIMD. |
| 628 | #[inline] |
| 629 | pub fn is_zerorust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]is_zero().(self) -> bool { |
| 630 | self.xrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]x().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq().0.0 && self.yrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]y().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq().0.0 && self.zrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]z().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialEq<Self>`]eq().0.0 |
| 631 | } |
| 632 | |
| 633 | #[inline] |
| 634 | pub fn lerprust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F]lerp().(self, other: Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#, t: f32) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 635 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add().+rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add().(other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.) rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::splatrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]splat().(t)) |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#> for Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 640 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`Add<Self>`]Output# = Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#; |
| 641 | #[inline] |
| 642 | fn addrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`Add<Self>`]add().(self, other: Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 643 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add().+rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Add<Self>`]add().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.) |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign# for Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 648 | #[inline] |
| 649 | fn add_assignrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`AddAssign<Self>`]add_assign().(&mut self, other: Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#) { |
| 650 | self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4][`AddAssign<Self>`]add_assign(). rust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4][`AddAssign<Self>`]add_assign().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#> for Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 655 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`Mul<Self>`]Output# = Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#; |
| 656 | #[inline] |
| 657 | fn mulrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`Mul<Self>`]mul().(self, other: Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 658 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.) |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 663 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][Neg]Output# = Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#; |
| 664 | /// NB: This does not negate w, because that is rarely what you what for homogeneous |
| 665 | /// coordinates. |
| 666 | #[inline] |
| 667 | fn negrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][Neg]neg().(self) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 668 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().*rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Mul<Self>`]mul().F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::newrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, 1.0)) |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#> for Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 673 | type Outputrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`Sub<Self>`]Output# = Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#; |
| 674 | #[inline] |
| 675 | fn subrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][`Sub<Self>`]sub().(self, other: Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#) -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 676 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(self.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0. rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().-rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub(). rust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][`Sub<Self>`]sub().other.0rust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#0.) |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 681 | #[inline] |
| 682 | fn defaultrust-analyzer cargo pathfinder_geometry 0.5.1 vector/impl#[Vector4F][Default]default().() -> Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F# { |
| 683 | let mut point = F32x4rust-analyzer cargo pathfinder_simd 0.5.6 x86/F32x4#::defaultrust-analyzer cargo pathfinder_simd 0.5.6 x86/impl#[F32x4][Default]default().(); |
| 684 | point.set_wrust-analyzer cargo pathfinder_simd 0.5.6 extras/impl#[F32x4]set_w().(1.0); |
| 685 | Vector4Frust-analyzer cargo pathfinder_geometry 0.5.1 vector/Vector4F#(point) |
| 686 | } |
| 687 | } |