glam/usize/
usizevec3.rs

1// Generated from vec.rs.tera template. Edit the template, not the generated file.
2
3use crate::{
4    BVec3, BVec3A, I16Vec3, I64Vec3, I8Vec3, IVec3, U16Vec3, U64Vec3, U8Vec3, USizeVec2, USizeVec4,
5    UVec3,
6};
7
8use core::fmt;
9use core::iter::{Product, Sum};
10use core::{f32, ops::*};
11
12/// Creates a 3-dimensional vector.
13#[inline(always)]
14#[must_use]
15pub const fn usizevec3(x: usize, y: usize, z: usize) -> USizeVec3 {
16    USizeVec3::new(x, y, z)
17}
18
19/// A 3-dimensional vector.
20#[derive(Clone, Copy, PartialEq, Eq, Hash)]
21#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
22#[repr(C)]
23#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
24pub struct USizeVec3 {
25    pub x: usize,
26    pub y: usize,
27    pub z: usize,
28}
29
30impl USizeVec3 {
31    /// All zeroes.
32    pub const ZERO: Self = Self::splat(0);
33
34    /// All ones.
35    pub const ONE: Self = Self::splat(1);
36
37    /// All `usize::MIN`.
38    pub const MIN: Self = Self::splat(usize::MIN);
39
40    /// All `usize::MAX`.
41    pub const MAX: Self = Self::splat(usize::MAX);
42
43    /// A unit vector pointing along the positive X axis.
44    pub const X: Self = Self::new(1, 0, 0);
45
46    /// A unit vector pointing along the positive Y axis.
47    pub const Y: Self = Self::new(0, 1, 0);
48
49    /// A unit vector pointing along the positive Z axis.
50    pub const Z: Self = Self::new(0, 0, 1);
51
52    /// The unit axes.
53    pub const AXES: [Self; 3] = [Self::X, Self::Y, Self::Z];
54
55    /// Creates a new vector.
56    #[inline(always)]
57    #[must_use]
58    pub const fn new(x: usize, y: usize, z: usize) -> Self {
59        Self { x, y, z }
60    }
61
62    /// Creates a vector with all elements set to `v`.
63    #[inline]
64    #[must_use]
65    pub const fn splat(v: usize) -> Self {
66        Self { x: v, y: v, z: v }
67    }
68
69    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
70    #[inline]
71    #[must_use]
72    pub fn map<F>(self, f: F) -> Self
73    where
74        F: Fn(usize) -> usize,
75    {
76        Self::new(f(self.x), f(self.y), f(self.z))
77    }
78
79    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
80    /// for each element of `self`.
81    ///
82    /// A true element in the mask uses the corresponding element from `if_true`, and false
83    /// uses the element from `if_false`.
84    #[inline]
85    #[must_use]
86    pub fn select(mask: BVec3, if_true: Self, if_false: Self) -> Self {
87        Self {
88            x: if mask.test(0) { if_true.x } else { if_false.x },
89            y: if mask.test(1) { if_true.y } else { if_false.y },
90            z: if mask.test(2) { if_true.z } else { if_false.z },
91        }
92    }
93
94    /// Creates a new vector from an array.
95    #[inline]
96    #[must_use]
97    pub const fn from_array(a: [usize; 3]) -> Self {
98        Self::new(a[0], a[1], a[2])
99    }
100
101    /// Converts `self` to `[x, y, z]`
102    #[inline]
103    #[must_use]
104    pub const fn to_array(&self) -> [usize; 3] {
105        [self.x, self.y, self.z]
106    }
107
108    /// Creates a vector from the first 3 values in `slice`.
109    ///
110    /// # Panics
111    ///
112    /// Panics if `slice` is less than 3 elements long.
113    #[inline]
114    #[must_use]
115    pub const fn from_slice(slice: &[usize]) -> Self {
116        assert!(slice.len() >= 3);
117        Self::new(slice[0], slice[1], slice[2])
118    }
119
120    /// Writes the elements of `self` to the first 3 elements in `slice`.
121    ///
122    /// # Panics
123    ///
124    /// Panics if `slice` is less than 3 elements long.
125    #[inline]
126    pub fn write_to_slice(self, slice: &mut [usize]) {
127        slice[..3].copy_from_slice(&self.to_array());
128    }
129
130    /// Internal method for creating a 3D vector from a 4D vector, discarding `w`.
131    #[allow(dead_code)]
132    #[inline]
133    #[must_use]
134    pub(crate) fn from_vec4(v: USizeVec4) -> Self {
135        Self {
136            x: v.x,
137            y: v.y,
138            z: v.z,
139        }
140    }
141
142    /// Creates a 4D vector from `self` and the given `w` value.
143    #[inline]
144    #[must_use]
145    pub fn extend(self, w: usize) -> USizeVec4 {
146        USizeVec4::new(self.x, self.y, self.z, w)
147    }
148
149    /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`.
150    ///
151    /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()].
152    #[inline]
153    #[must_use]
154    pub fn truncate(self) -> USizeVec2 {
155        use crate::swizzles::Vec3Swizzles;
156        self.xy()
157    }
158
159    /// Creates a 3D vector from `self` with the given value of `x`.
160    #[inline]
161    #[must_use]
162    pub fn with_x(mut self, x: usize) -> Self {
163        self.x = x;
164        self
165    }
166
167    /// Creates a 3D vector from `self` with the given value of `y`.
168    #[inline]
169    #[must_use]
170    pub fn with_y(mut self, y: usize) -> Self {
171        self.y = y;
172        self
173    }
174
175    /// Creates a 3D vector from `self` with the given value of `z`.
176    #[inline]
177    #[must_use]
178    pub fn with_z(mut self, z: usize) -> Self {
179        self.z = z;
180        self
181    }
182
183    /// Computes the dot product of `self` and `rhs`.
184    #[inline]
185    #[must_use]
186    pub fn dot(self, rhs: Self) -> usize {
187        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z)
188    }
189
190    /// Returns a vector where every component is the dot product of `self` and `rhs`.
191    #[inline]
192    #[must_use]
193    pub fn dot_into_vec(self, rhs: Self) -> Self {
194        Self::splat(self.dot(rhs))
195    }
196
197    /// Computes the cross product of `self` and `rhs`.
198    #[inline]
199    #[must_use]
200    pub fn cross(self, rhs: Self) -> Self {
201        Self {
202            x: self.y * rhs.z - rhs.y * self.z,
203            y: self.z * rhs.x - rhs.z * self.x,
204            z: self.x * rhs.y - rhs.x * self.y,
205        }
206    }
207
208    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
209    ///
210    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
211    #[inline]
212    #[must_use]
213    pub fn min(self, rhs: Self) -> Self {
214        Self {
215            x: if self.x < rhs.x { self.x } else { rhs.x },
216            y: if self.y < rhs.y { self.y } else { rhs.y },
217            z: if self.z < rhs.z { self.z } else { rhs.z },
218        }
219    }
220
221    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
222    ///
223    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
224    #[inline]
225    #[must_use]
226    pub fn max(self, rhs: Self) -> Self {
227        Self {
228            x: if self.x > rhs.x { self.x } else { rhs.x },
229            y: if self.y > rhs.y { self.y } else { rhs.y },
230            z: if self.z > rhs.z { self.z } else { rhs.z },
231        }
232    }
233
234    /// Component-wise clamping of values, similar to [`usize::clamp`].
235    ///
236    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
237    ///
238    /// # Panics
239    ///
240    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
241    #[inline]
242    #[must_use]
243    pub fn clamp(self, min: Self, max: Self) -> Self {
244        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
245        self.max(min).min(max)
246    }
247
248    /// Returns the horizontal minimum of `self`.
249    ///
250    /// In other words this computes `min(x, y, ..)`.
251    #[inline]
252    #[must_use]
253    pub fn min_element(self) -> usize {
254        let min = |a, b| if a < b { a } else { b };
255        min(self.x, min(self.y, self.z))
256    }
257
258    /// Returns the horizontal maximum of `self`.
259    ///
260    /// In other words this computes `max(x, y, ..)`.
261    #[inline]
262    #[must_use]
263    pub fn max_element(self) -> usize {
264        let max = |a, b| if a > b { a } else { b };
265        max(self.x, max(self.y, self.z))
266    }
267
268    /// Returns the index of the first minimum element of `self`.
269    #[doc(alias = "argmin")]
270    #[inline]
271    #[must_use]
272    pub fn min_position(self) -> usize {
273        let mut min = self.x;
274        let mut index = 0;
275        if self.y < min {
276            min = self.y;
277            index = 1;
278        }
279        if self.z < min {
280            index = 2;
281        }
282        index
283    }
284
285    /// Returns the index of the first maximum element of `self`.
286    #[doc(alias = "argmax")]
287    #[inline]
288    #[must_use]
289    pub fn max_position(self) -> usize {
290        let mut max = self.x;
291        let mut index = 0;
292        if self.y > max {
293            max = self.y;
294            index = 1;
295        }
296        if self.z > max {
297            index = 2;
298        }
299        index
300    }
301
302    /// Returns the sum of all elements of `self`.
303    ///
304    /// In other words, this computes `self.x + self.y + ..`.
305    #[inline]
306    #[must_use]
307    pub fn element_sum(self) -> usize {
308        self.x + self.y + self.z
309    }
310
311    /// Returns the product of all elements of `self`.
312    ///
313    /// In other words, this computes `self.x * self.y * ..`.
314    #[inline]
315    #[must_use]
316    pub fn element_product(self) -> usize {
317        self.x * self.y * self.z
318    }
319
320    /// Returns a vector mask containing the result of a `==` comparison for each element of
321    /// `self` and `rhs`.
322    ///
323    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
324    /// elements.
325    #[inline]
326    #[must_use]
327    pub fn cmpeq(self, rhs: Self) -> BVec3 {
328        BVec3::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y), self.z.eq(&rhs.z))
329    }
330
331    /// Returns a vector mask containing the result of a `!=` comparison for each element of
332    /// `self` and `rhs`.
333    ///
334    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
335    /// elements.
336    #[inline]
337    #[must_use]
338    pub fn cmpne(self, rhs: Self) -> BVec3 {
339        BVec3::new(self.x.ne(&rhs.x), self.y.ne(&rhs.y), self.z.ne(&rhs.z))
340    }
341
342    /// Returns a vector mask containing the result of a `>=` comparison for each element of
343    /// `self` and `rhs`.
344    ///
345    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
346    /// elements.
347    #[inline]
348    #[must_use]
349    pub fn cmpge(self, rhs: Self) -> BVec3 {
350        BVec3::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y), self.z.ge(&rhs.z))
351    }
352
353    /// Returns a vector mask containing the result of a `>` comparison for each element of
354    /// `self` and `rhs`.
355    ///
356    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
357    /// elements.
358    #[inline]
359    #[must_use]
360    pub fn cmpgt(self, rhs: Self) -> BVec3 {
361        BVec3::new(self.x.gt(&rhs.x), self.y.gt(&rhs.y), self.z.gt(&rhs.z))
362    }
363
364    /// Returns a vector mask containing the result of a `<=` comparison for each element of
365    /// `self` and `rhs`.
366    ///
367    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
368    /// elements.
369    #[inline]
370    #[must_use]
371    pub fn cmple(self, rhs: Self) -> BVec3 {
372        BVec3::new(self.x.le(&rhs.x), self.y.le(&rhs.y), self.z.le(&rhs.z))
373    }
374
375    /// Returns a vector mask containing the result of a `<` comparison for each element of
376    /// `self` and `rhs`.
377    ///
378    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
379    /// elements.
380    #[inline]
381    #[must_use]
382    pub fn cmplt(self, rhs: Self) -> BVec3 {
383        BVec3::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y), self.z.lt(&rhs.z))
384    }
385
386    /// Computes the squared length of `self`.
387    #[doc(alias = "magnitude2")]
388    #[inline]
389    #[must_use]
390    pub fn length_squared(self) -> usize {
391        self.dot(self)
392    }
393
394    /// Computes the [manhattan distance] between two points.
395    ///
396    /// # Overflow
397    /// This method may overflow if the result is greater than [`usize::MAX`].
398    ///
399    /// See also [`checked_manhattan_distance`][USizeVec3::checked_manhattan_distance].
400    ///
401    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
402    #[inline]
403    #[must_use]
404    pub fn manhattan_distance(self, rhs: Self) -> usize {
405        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y) + self.z.abs_diff(rhs.z)
406    }
407
408    /// Computes the [manhattan distance] between two points.
409    ///
410    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
411    ///
412    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
413    #[inline]
414    #[must_use]
415    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
416        let d = self.x.abs_diff(rhs.x);
417        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
418        d.checked_add(self.z.abs_diff(rhs.z))
419    }
420
421    /// Computes the [chebyshev distance] between two points.
422    ///
423    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
424    #[inline]
425    #[must_use]
426    pub fn chebyshev_distance(self, rhs: Self) -> usize {
427        // Note: the compiler will eventually optimize out the loop
428        [
429            self.x.abs_diff(rhs.x),
430            self.y.abs_diff(rhs.y),
431            self.z.abs_diff(rhs.z),
432        ]
433        .into_iter()
434        .max()
435        .unwrap()
436    }
437
438    /// Casts all elements of `self` to `f32`.
439    #[inline]
440    #[must_use]
441    pub fn as_vec3(&self) -> crate::Vec3 {
442        crate::Vec3::new(self.x as f32, self.y as f32, self.z as f32)
443    }
444
445    /// Casts all elements of `self` to `f32`.
446    #[inline]
447    #[must_use]
448    pub fn as_vec3a(&self) -> crate::Vec3A {
449        crate::Vec3A::new(self.x as f32, self.y as f32, self.z as f32)
450    }
451
452    /// Casts all elements of `self` to `f64`.
453    #[inline]
454    #[must_use]
455    pub fn as_dvec3(&self) -> crate::DVec3 {
456        crate::DVec3::new(self.x as f64, self.y as f64, self.z as f64)
457    }
458
459    /// Casts all elements of `self` to `i8`.
460    #[inline]
461    #[must_use]
462    pub fn as_i8vec3(&self) -> crate::I8Vec3 {
463        crate::I8Vec3::new(self.x as i8, self.y as i8, self.z as i8)
464    }
465
466    /// Casts all elements of `self` to `u8`.
467    #[inline]
468    #[must_use]
469    pub fn as_u8vec3(&self) -> crate::U8Vec3 {
470        crate::U8Vec3::new(self.x as u8, self.y as u8, self.z as u8)
471    }
472
473    /// Casts all elements of `self` to `i16`.
474    #[inline]
475    #[must_use]
476    pub fn as_i16vec3(&self) -> crate::I16Vec3 {
477        crate::I16Vec3::new(self.x as i16, self.y as i16, self.z as i16)
478    }
479
480    /// Casts all elements of `self` to `u16`.
481    #[inline]
482    #[must_use]
483    pub fn as_u16vec3(&self) -> crate::U16Vec3 {
484        crate::U16Vec3::new(self.x as u16, self.y as u16, self.z as u16)
485    }
486
487    /// Casts all elements of `self` to `i32`.
488    #[inline]
489    #[must_use]
490    pub fn as_ivec3(&self) -> crate::IVec3 {
491        crate::IVec3::new(self.x as i32, self.y as i32, self.z as i32)
492    }
493
494    /// Casts all elements of `self` to `u32`.
495    #[inline]
496    #[must_use]
497    pub fn as_uvec3(&self) -> crate::UVec3 {
498        crate::UVec3::new(self.x as u32, self.y as u32, self.z as u32)
499    }
500
501    /// Casts all elements of `self` to `i64`.
502    #[inline]
503    #[must_use]
504    pub fn as_i64vec3(&self) -> crate::I64Vec3 {
505        crate::I64Vec3::new(self.x as i64, self.y as i64, self.z as i64)
506    }
507
508    /// Casts all elements of `self` to `u64`.
509    #[inline]
510    #[must_use]
511    pub fn as_u64vec3(&self) -> crate::U64Vec3 {
512        crate::U64Vec3::new(self.x as u64, self.y as u64, self.z as u64)
513    }
514
515    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
516    ///
517    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
518    #[inline]
519    #[must_use]
520    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
521        let x = match self.x.checked_add(rhs.x) {
522            Some(v) => v,
523            None => return None,
524        };
525        let y = match self.y.checked_add(rhs.y) {
526            Some(v) => v,
527            None => return None,
528        };
529        let z = match self.z.checked_add(rhs.z) {
530            Some(v) => v,
531            None => return None,
532        };
533
534        Some(Self { x, y, z })
535    }
536
537    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
538    ///
539    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
540    #[inline]
541    #[must_use]
542    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
543        let x = match self.x.checked_sub(rhs.x) {
544            Some(v) => v,
545            None => return None,
546        };
547        let y = match self.y.checked_sub(rhs.y) {
548            Some(v) => v,
549            None => return None,
550        };
551        let z = match self.z.checked_sub(rhs.z) {
552            Some(v) => v,
553            None => return None,
554        };
555
556        Some(Self { x, y, z })
557    }
558
559    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
560    ///
561    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
562    #[inline]
563    #[must_use]
564    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
565        let x = match self.x.checked_mul(rhs.x) {
566            Some(v) => v,
567            None => return None,
568        };
569        let y = match self.y.checked_mul(rhs.y) {
570            Some(v) => v,
571            None => return None,
572        };
573        let z = match self.z.checked_mul(rhs.z) {
574            Some(v) => v,
575            None => return None,
576        };
577
578        Some(Self { x, y, z })
579    }
580
581    /// Returns a vector containing the wrapping division of `self` and `rhs`.
582    ///
583    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
584    #[inline]
585    #[must_use]
586    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
587        let x = match self.x.checked_div(rhs.x) {
588            Some(v) => v,
589            None => return None,
590        };
591        let y = match self.y.checked_div(rhs.y) {
592            Some(v) => v,
593            None => return None,
594        };
595        let z = match self.z.checked_div(rhs.z) {
596            Some(v) => v,
597            None => return None,
598        };
599
600        Some(Self { x, y, z })
601    }
602
603    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
604    ///
605    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
606    #[inline]
607    #[must_use]
608    pub const fn wrapping_add(self, rhs: Self) -> Self {
609        Self {
610            x: self.x.wrapping_add(rhs.x),
611            y: self.y.wrapping_add(rhs.y),
612            z: self.z.wrapping_add(rhs.z),
613        }
614    }
615
616    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
617    ///
618    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
619    #[inline]
620    #[must_use]
621    pub const fn wrapping_sub(self, rhs: Self) -> Self {
622        Self {
623            x: self.x.wrapping_sub(rhs.x),
624            y: self.y.wrapping_sub(rhs.y),
625            z: self.z.wrapping_sub(rhs.z),
626        }
627    }
628
629    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
630    ///
631    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
632    #[inline]
633    #[must_use]
634    pub const fn wrapping_mul(self, rhs: Self) -> Self {
635        Self {
636            x: self.x.wrapping_mul(rhs.x),
637            y: self.y.wrapping_mul(rhs.y),
638            z: self.z.wrapping_mul(rhs.z),
639        }
640    }
641
642    /// Returns a vector containing the wrapping division of `self` and `rhs`.
643    ///
644    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
645    #[inline]
646    #[must_use]
647    pub const fn wrapping_div(self, rhs: Self) -> Self {
648        Self {
649            x: self.x.wrapping_div(rhs.x),
650            y: self.y.wrapping_div(rhs.y),
651            z: self.z.wrapping_div(rhs.z),
652        }
653    }
654
655    /// Returns a vector containing the saturating addition of `self` and `rhs`.
656    ///
657    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
658    #[inline]
659    #[must_use]
660    pub const fn saturating_add(self, rhs: Self) -> Self {
661        Self {
662            x: self.x.saturating_add(rhs.x),
663            y: self.y.saturating_add(rhs.y),
664            z: self.z.saturating_add(rhs.z),
665        }
666    }
667
668    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
669    ///
670    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
671    #[inline]
672    #[must_use]
673    pub const fn saturating_sub(self, rhs: Self) -> Self {
674        Self {
675            x: self.x.saturating_sub(rhs.x),
676            y: self.y.saturating_sub(rhs.y),
677            z: self.z.saturating_sub(rhs.z),
678        }
679    }
680
681    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
682    ///
683    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
684    #[inline]
685    #[must_use]
686    pub const fn saturating_mul(self, rhs: Self) -> Self {
687        Self {
688            x: self.x.saturating_mul(rhs.x),
689            y: self.y.saturating_mul(rhs.y),
690            z: self.z.saturating_mul(rhs.z),
691        }
692    }
693
694    /// Returns a vector containing the saturating division of `self` and `rhs`.
695    ///
696    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
697    #[inline]
698    #[must_use]
699    pub const fn saturating_div(self, rhs: Self) -> Self {
700        Self {
701            x: self.x.saturating_div(rhs.x),
702            y: self.y.saturating_div(rhs.y),
703            z: self.z.saturating_div(rhs.z),
704        }
705    }
706}
707
708impl Default for USizeVec3 {
709    #[inline(always)]
710    fn default() -> Self {
711        Self::ZERO
712    }
713}
714
715impl Div for USizeVec3 {
716    type Output = Self;
717    #[inline]
718    fn div(self, rhs: Self) -> Self {
719        Self {
720            x: self.x.div(rhs.x),
721            y: self.y.div(rhs.y),
722            z: self.z.div(rhs.z),
723        }
724    }
725}
726
727impl Div<&Self> for USizeVec3 {
728    type Output = Self;
729    #[inline]
730    fn div(self, rhs: &Self) -> Self {
731        self.div(*rhs)
732    }
733}
734
735impl Div<&USizeVec3> for &USizeVec3 {
736    type Output = USizeVec3;
737    #[inline]
738    fn div(self, rhs: &USizeVec3) -> USizeVec3 {
739        (*self).div(*rhs)
740    }
741}
742
743impl Div<USizeVec3> for &USizeVec3 {
744    type Output = USizeVec3;
745    #[inline]
746    fn div(self, rhs: USizeVec3) -> USizeVec3 {
747        (*self).div(rhs)
748    }
749}
750
751impl DivAssign for USizeVec3 {
752    #[inline]
753    fn div_assign(&mut self, rhs: Self) {
754        self.x.div_assign(rhs.x);
755        self.y.div_assign(rhs.y);
756        self.z.div_assign(rhs.z);
757    }
758}
759
760impl DivAssign<&Self> for USizeVec3 {
761    #[inline]
762    fn div_assign(&mut self, rhs: &Self) {
763        self.div_assign(*rhs);
764    }
765}
766
767impl Div<usize> for USizeVec3 {
768    type Output = Self;
769    #[inline]
770    fn div(self, rhs: usize) -> Self {
771        Self {
772            x: self.x.div(rhs),
773            y: self.y.div(rhs),
774            z: self.z.div(rhs),
775        }
776    }
777}
778
779impl Div<&usize> for USizeVec3 {
780    type Output = Self;
781    #[inline]
782    fn div(self, rhs: &usize) -> Self {
783        self.div(*rhs)
784    }
785}
786
787impl Div<&usize> for &USizeVec3 {
788    type Output = USizeVec3;
789    #[inline]
790    fn div(self, rhs: &usize) -> USizeVec3 {
791        (*self).div(*rhs)
792    }
793}
794
795impl Div<usize> for &USizeVec3 {
796    type Output = USizeVec3;
797    #[inline]
798    fn div(self, rhs: usize) -> USizeVec3 {
799        (*self).div(rhs)
800    }
801}
802
803impl DivAssign<usize> for USizeVec3 {
804    #[inline]
805    fn div_assign(&mut self, rhs: usize) {
806        self.x.div_assign(rhs);
807        self.y.div_assign(rhs);
808        self.z.div_assign(rhs);
809    }
810}
811
812impl DivAssign<&usize> for USizeVec3 {
813    #[inline]
814    fn div_assign(&mut self, rhs: &usize) {
815        self.div_assign(*rhs);
816    }
817}
818
819impl Div<USizeVec3> for usize {
820    type Output = USizeVec3;
821    #[inline]
822    fn div(self, rhs: USizeVec3) -> USizeVec3 {
823        USizeVec3 {
824            x: self.div(rhs.x),
825            y: self.div(rhs.y),
826            z: self.div(rhs.z),
827        }
828    }
829}
830
831impl Div<&USizeVec3> for usize {
832    type Output = USizeVec3;
833    #[inline]
834    fn div(self, rhs: &USizeVec3) -> USizeVec3 {
835        self.div(*rhs)
836    }
837}
838
839impl Div<&USizeVec3> for &usize {
840    type Output = USizeVec3;
841    #[inline]
842    fn div(self, rhs: &USizeVec3) -> USizeVec3 {
843        (*self).div(*rhs)
844    }
845}
846
847impl Div<USizeVec3> for &usize {
848    type Output = USizeVec3;
849    #[inline]
850    fn div(self, rhs: USizeVec3) -> USizeVec3 {
851        (*self).div(rhs)
852    }
853}
854
855impl Mul for USizeVec3 {
856    type Output = Self;
857    #[inline]
858    fn mul(self, rhs: Self) -> Self {
859        Self {
860            x: self.x.mul(rhs.x),
861            y: self.y.mul(rhs.y),
862            z: self.z.mul(rhs.z),
863        }
864    }
865}
866
867impl Mul<&Self> for USizeVec3 {
868    type Output = Self;
869    #[inline]
870    fn mul(self, rhs: &Self) -> Self {
871        self.mul(*rhs)
872    }
873}
874
875impl Mul<&USizeVec3> for &USizeVec3 {
876    type Output = USizeVec3;
877    #[inline]
878    fn mul(self, rhs: &USizeVec3) -> USizeVec3 {
879        (*self).mul(*rhs)
880    }
881}
882
883impl Mul<USizeVec3> for &USizeVec3 {
884    type Output = USizeVec3;
885    #[inline]
886    fn mul(self, rhs: USizeVec3) -> USizeVec3 {
887        (*self).mul(rhs)
888    }
889}
890
891impl MulAssign for USizeVec3 {
892    #[inline]
893    fn mul_assign(&mut self, rhs: Self) {
894        self.x.mul_assign(rhs.x);
895        self.y.mul_assign(rhs.y);
896        self.z.mul_assign(rhs.z);
897    }
898}
899
900impl MulAssign<&Self> for USizeVec3 {
901    #[inline]
902    fn mul_assign(&mut self, rhs: &Self) {
903        self.mul_assign(*rhs);
904    }
905}
906
907impl Mul<usize> for USizeVec3 {
908    type Output = Self;
909    #[inline]
910    fn mul(self, rhs: usize) -> Self {
911        Self {
912            x: self.x.mul(rhs),
913            y: self.y.mul(rhs),
914            z: self.z.mul(rhs),
915        }
916    }
917}
918
919impl Mul<&usize> for USizeVec3 {
920    type Output = Self;
921    #[inline]
922    fn mul(self, rhs: &usize) -> Self {
923        self.mul(*rhs)
924    }
925}
926
927impl Mul<&usize> for &USizeVec3 {
928    type Output = USizeVec3;
929    #[inline]
930    fn mul(self, rhs: &usize) -> USizeVec3 {
931        (*self).mul(*rhs)
932    }
933}
934
935impl Mul<usize> for &USizeVec3 {
936    type Output = USizeVec3;
937    #[inline]
938    fn mul(self, rhs: usize) -> USizeVec3 {
939        (*self).mul(rhs)
940    }
941}
942
943impl MulAssign<usize> for USizeVec3 {
944    #[inline]
945    fn mul_assign(&mut self, rhs: usize) {
946        self.x.mul_assign(rhs);
947        self.y.mul_assign(rhs);
948        self.z.mul_assign(rhs);
949    }
950}
951
952impl MulAssign<&usize> for USizeVec3 {
953    #[inline]
954    fn mul_assign(&mut self, rhs: &usize) {
955        self.mul_assign(*rhs);
956    }
957}
958
959impl Mul<USizeVec3> for usize {
960    type Output = USizeVec3;
961    #[inline]
962    fn mul(self, rhs: USizeVec3) -> USizeVec3 {
963        USizeVec3 {
964            x: self.mul(rhs.x),
965            y: self.mul(rhs.y),
966            z: self.mul(rhs.z),
967        }
968    }
969}
970
971impl Mul<&USizeVec3> for usize {
972    type Output = USizeVec3;
973    #[inline]
974    fn mul(self, rhs: &USizeVec3) -> USizeVec3 {
975        self.mul(*rhs)
976    }
977}
978
979impl Mul<&USizeVec3> for &usize {
980    type Output = USizeVec3;
981    #[inline]
982    fn mul(self, rhs: &USizeVec3) -> USizeVec3 {
983        (*self).mul(*rhs)
984    }
985}
986
987impl Mul<USizeVec3> for &usize {
988    type Output = USizeVec3;
989    #[inline]
990    fn mul(self, rhs: USizeVec3) -> USizeVec3 {
991        (*self).mul(rhs)
992    }
993}
994
995impl Add for USizeVec3 {
996    type Output = Self;
997    #[inline]
998    fn add(self, rhs: Self) -> Self {
999        Self {
1000            x: self.x.add(rhs.x),
1001            y: self.y.add(rhs.y),
1002            z: self.z.add(rhs.z),
1003        }
1004    }
1005}
1006
1007impl Add<&Self> for USizeVec3 {
1008    type Output = Self;
1009    #[inline]
1010    fn add(self, rhs: &Self) -> Self {
1011        self.add(*rhs)
1012    }
1013}
1014
1015impl Add<&USizeVec3> for &USizeVec3 {
1016    type Output = USizeVec3;
1017    #[inline]
1018    fn add(self, rhs: &USizeVec3) -> USizeVec3 {
1019        (*self).add(*rhs)
1020    }
1021}
1022
1023impl Add<USizeVec3> for &USizeVec3 {
1024    type Output = USizeVec3;
1025    #[inline]
1026    fn add(self, rhs: USizeVec3) -> USizeVec3 {
1027        (*self).add(rhs)
1028    }
1029}
1030
1031impl AddAssign for USizeVec3 {
1032    #[inline]
1033    fn add_assign(&mut self, rhs: Self) {
1034        self.x.add_assign(rhs.x);
1035        self.y.add_assign(rhs.y);
1036        self.z.add_assign(rhs.z);
1037    }
1038}
1039
1040impl AddAssign<&Self> for USizeVec3 {
1041    #[inline]
1042    fn add_assign(&mut self, rhs: &Self) {
1043        self.add_assign(*rhs);
1044    }
1045}
1046
1047impl Add<usize> for USizeVec3 {
1048    type Output = Self;
1049    #[inline]
1050    fn add(self, rhs: usize) -> Self {
1051        Self {
1052            x: self.x.add(rhs),
1053            y: self.y.add(rhs),
1054            z: self.z.add(rhs),
1055        }
1056    }
1057}
1058
1059impl Add<&usize> for USizeVec3 {
1060    type Output = Self;
1061    #[inline]
1062    fn add(self, rhs: &usize) -> Self {
1063        self.add(*rhs)
1064    }
1065}
1066
1067impl Add<&usize> for &USizeVec3 {
1068    type Output = USizeVec3;
1069    #[inline]
1070    fn add(self, rhs: &usize) -> USizeVec3 {
1071        (*self).add(*rhs)
1072    }
1073}
1074
1075impl Add<usize> for &USizeVec3 {
1076    type Output = USizeVec3;
1077    #[inline]
1078    fn add(self, rhs: usize) -> USizeVec3 {
1079        (*self).add(rhs)
1080    }
1081}
1082
1083impl AddAssign<usize> for USizeVec3 {
1084    #[inline]
1085    fn add_assign(&mut self, rhs: usize) {
1086        self.x.add_assign(rhs);
1087        self.y.add_assign(rhs);
1088        self.z.add_assign(rhs);
1089    }
1090}
1091
1092impl AddAssign<&usize> for USizeVec3 {
1093    #[inline]
1094    fn add_assign(&mut self, rhs: &usize) {
1095        self.add_assign(*rhs);
1096    }
1097}
1098
1099impl Add<USizeVec3> for usize {
1100    type Output = USizeVec3;
1101    #[inline]
1102    fn add(self, rhs: USizeVec3) -> USizeVec3 {
1103        USizeVec3 {
1104            x: self.add(rhs.x),
1105            y: self.add(rhs.y),
1106            z: self.add(rhs.z),
1107        }
1108    }
1109}
1110
1111impl Add<&USizeVec3> for usize {
1112    type Output = USizeVec3;
1113    #[inline]
1114    fn add(self, rhs: &USizeVec3) -> USizeVec3 {
1115        self.add(*rhs)
1116    }
1117}
1118
1119impl Add<&USizeVec3> for &usize {
1120    type Output = USizeVec3;
1121    #[inline]
1122    fn add(self, rhs: &USizeVec3) -> USizeVec3 {
1123        (*self).add(*rhs)
1124    }
1125}
1126
1127impl Add<USizeVec3> for &usize {
1128    type Output = USizeVec3;
1129    #[inline]
1130    fn add(self, rhs: USizeVec3) -> USizeVec3 {
1131        (*self).add(rhs)
1132    }
1133}
1134
1135impl Sub for USizeVec3 {
1136    type Output = Self;
1137    #[inline]
1138    fn sub(self, rhs: Self) -> Self {
1139        Self {
1140            x: self.x.sub(rhs.x),
1141            y: self.y.sub(rhs.y),
1142            z: self.z.sub(rhs.z),
1143        }
1144    }
1145}
1146
1147impl Sub<&Self> for USizeVec3 {
1148    type Output = Self;
1149    #[inline]
1150    fn sub(self, rhs: &Self) -> Self {
1151        self.sub(*rhs)
1152    }
1153}
1154
1155impl Sub<&USizeVec3> for &USizeVec3 {
1156    type Output = USizeVec3;
1157    #[inline]
1158    fn sub(self, rhs: &USizeVec3) -> USizeVec3 {
1159        (*self).sub(*rhs)
1160    }
1161}
1162
1163impl Sub<USizeVec3> for &USizeVec3 {
1164    type Output = USizeVec3;
1165    #[inline]
1166    fn sub(self, rhs: USizeVec3) -> USizeVec3 {
1167        (*self).sub(rhs)
1168    }
1169}
1170
1171impl SubAssign for USizeVec3 {
1172    #[inline]
1173    fn sub_assign(&mut self, rhs: Self) {
1174        self.x.sub_assign(rhs.x);
1175        self.y.sub_assign(rhs.y);
1176        self.z.sub_assign(rhs.z);
1177    }
1178}
1179
1180impl SubAssign<&Self> for USizeVec3 {
1181    #[inline]
1182    fn sub_assign(&mut self, rhs: &Self) {
1183        self.sub_assign(*rhs);
1184    }
1185}
1186
1187impl Sub<usize> for USizeVec3 {
1188    type Output = Self;
1189    #[inline]
1190    fn sub(self, rhs: usize) -> Self {
1191        Self {
1192            x: self.x.sub(rhs),
1193            y: self.y.sub(rhs),
1194            z: self.z.sub(rhs),
1195        }
1196    }
1197}
1198
1199impl Sub<&usize> for USizeVec3 {
1200    type Output = Self;
1201    #[inline]
1202    fn sub(self, rhs: &usize) -> Self {
1203        self.sub(*rhs)
1204    }
1205}
1206
1207impl Sub<&usize> for &USizeVec3 {
1208    type Output = USizeVec3;
1209    #[inline]
1210    fn sub(self, rhs: &usize) -> USizeVec3 {
1211        (*self).sub(*rhs)
1212    }
1213}
1214
1215impl Sub<usize> for &USizeVec3 {
1216    type Output = USizeVec3;
1217    #[inline]
1218    fn sub(self, rhs: usize) -> USizeVec3 {
1219        (*self).sub(rhs)
1220    }
1221}
1222
1223impl SubAssign<usize> for USizeVec3 {
1224    #[inline]
1225    fn sub_assign(&mut self, rhs: usize) {
1226        self.x.sub_assign(rhs);
1227        self.y.sub_assign(rhs);
1228        self.z.sub_assign(rhs);
1229    }
1230}
1231
1232impl SubAssign<&usize> for USizeVec3 {
1233    #[inline]
1234    fn sub_assign(&mut self, rhs: &usize) {
1235        self.sub_assign(*rhs);
1236    }
1237}
1238
1239impl Sub<USizeVec3> for usize {
1240    type Output = USizeVec3;
1241    #[inline]
1242    fn sub(self, rhs: USizeVec3) -> USizeVec3 {
1243        USizeVec3 {
1244            x: self.sub(rhs.x),
1245            y: self.sub(rhs.y),
1246            z: self.sub(rhs.z),
1247        }
1248    }
1249}
1250
1251impl Sub<&USizeVec3> for usize {
1252    type Output = USizeVec3;
1253    #[inline]
1254    fn sub(self, rhs: &USizeVec3) -> USizeVec3 {
1255        self.sub(*rhs)
1256    }
1257}
1258
1259impl Sub<&USizeVec3> for &usize {
1260    type Output = USizeVec3;
1261    #[inline]
1262    fn sub(self, rhs: &USizeVec3) -> USizeVec3 {
1263        (*self).sub(*rhs)
1264    }
1265}
1266
1267impl Sub<USizeVec3> for &usize {
1268    type Output = USizeVec3;
1269    #[inline]
1270    fn sub(self, rhs: USizeVec3) -> USizeVec3 {
1271        (*self).sub(rhs)
1272    }
1273}
1274
1275impl Rem for USizeVec3 {
1276    type Output = Self;
1277    #[inline]
1278    fn rem(self, rhs: Self) -> Self {
1279        Self {
1280            x: self.x.rem(rhs.x),
1281            y: self.y.rem(rhs.y),
1282            z: self.z.rem(rhs.z),
1283        }
1284    }
1285}
1286
1287impl Rem<&Self> for USizeVec3 {
1288    type Output = Self;
1289    #[inline]
1290    fn rem(self, rhs: &Self) -> Self {
1291        self.rem(*rhs)
1292    }
1293}
1294
1295impl Rem<&USizeVec3> for &USizeVec3 {
1296    type Output = USizeVec3;
1297    #[inline]
1298    fn rem(self, rhs: &USizeVec3) -> USizeVec3 {
1299        (*self).rem(*rhs)
1300    }
1301}
1302
1303impl Rem<USizeVec3> for &USizeVec3 {
1304    type Output = USizeVec3;
1305    #[inline]
1306    fn rem(self, rhs: USizeVec3) -> USizeVec3 {
1307        (*self).rem(rhs)
1308    }
1309}
1310
1311impl RemAssign for USizeVec3 {
1312    #[inline]
1313    fn rem_assign(&mut self, rhs: Self) {
1314        self.x.rem_assign(rhs.x);
1315        self.y.rem_assign(rhs.y);
1316        self.z.rem_assign(rhs.z);
1317    }
1318}
1319
1320impl RemAssign<&Self> for USizeVec3 {
1321    #[inline]
1322    fn rem_assign(&mut self, rhs: &Self) {
1323        self.rem_assign(*rhs);
1324    }
1325}
1326
1327impl Rem<usize> for USizeVec3 {
1328    type Output = Self;
1329    #[inline]
1330    fn rem(self, rhs: usize) -> Self {
1331        Self {
1332            x: self.x.rem(rhs),
1333            y: self.y.rem(rhs),
1334            z: self.z.rem(rhs),
1335        }
1336    }
1337}
1338
1339impl Rem<&usize> for USizeVec3 {
1340    type Output = Self;
1341    #[inline]
1342    fn rem(self, rhs: &usize) -> Self {
1343        self.rem(*rhs)
1344    }
1345}
1346
1347impl Rem<&usize> for &USizeVec3 {
1348    type Output = USizeVec3;
1349    #[inline]
1350    fn rem(self, rhs: &usize) -> USizeVec3 {
1351        (*self).rem(*rhs)
1352    }
1353}
1354
1355impl Rem<usize> for &USizeVec3 {
1356    type Output = USizeVec3;
1357    #[inline]
1358    fn rem(self, rhs: usize) -> USizeVec3 {
1359        (*self).rem(rhs)
1360    }
1361}
1362
1363impl RemAssign<usize> for USizeVec3 {
1364    #[inline]
1365    fn rem_assign(&mut self, rhs: usize) {
1366        self.x.rem_assign(rhs);
1367        self.y.rem_assign(rhs);
1368        self.z.rem_assign(rhs);
1369    }
1370}
1371
1372impl RemAssign<&usize> for USizeVec3 {
1373    #[inline]
1374    fn rem_assign(&mut self, rhs: &usize) {
1375        self.rem_assign(*rhs);
1376    }
1377}
1378
1379impl Rem<USizeVec3> for usize {
1380    type Output = USizeVec3;
1381    #[inline]
1382    fn rem(self, rhs: USizeVec3) -> USizeVec3 {
1383        USizeVec3 {
1384            x: self.rem(rhs.x),
1385            y: self.rem(rhs.y),
1386            z: self.rem(rhs.z),
1387        }
1388    }
1389}
1390
1391impl Rem<&USizeVec3> for usize {
1392    type Output = USizeVec3;
1393    #[inline]
1394    fn rem(self, rhs: &USizeVec3) -> USizeVec3 {
1395        self.rem(*rhs)
1396    }
1397}
1398
1399impl Rem<&USizeVec3> for &usize {
1400    type Output = USizeVec3;
1401    #[inline]
1402    fn rem(self, rhs: &USizeVec3) -> USizeVec3 {
1403        (*self).rem(*rhs)
1404    }
1405}
1406
1407impl Rem<USizeVec3> for &usize {
1408    type Output = USizeVec3;
1409    #[inline]
1410    fn rem(self, rhs: USizeVec3) -> USizeVec3 {
1411        (*self).rem(rhs)
1412    }
1413}
1414
1415impl AsRef<[usize; 3]> for USizeVec3 {
1416    #[inline]
1417    fn as_ref(&self) -> &[usize; 3] {
1418        unsafe { &*(self as *const Self as *const [usize; 3]) }
1419    }
1420}
1421
1422impl AsMut<[usize; 3]> for USizeVec3 {
1423    #[inline]
1424    fn as_mut(&mut self) -> &mut [usize; 3] {
1425        unsafe { &mut *(self as *mut Self as *mut [usize; 3]) }
1426    }
1427}
1428
1429impl Sum for USizeVec3 {
1430    #[inline]
1431    fn sum<I>(iter: I) -> Self
1432    where
1433        I: Iterator<Item = Self>,
1434    {
1435        iter.fold(Self::ZERO, Self::add)
1436    }
1437}
1438
1439impl<'a> Sum<&'a Self> for USizeVec3 {
1440    #[inline]
1441    fn sum<I>(iter: I) -> Self
1442    where
1443        I: Iterator<Item = &'a Self>,
1444    {
1445        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
1446    }
1447}
1448
1449impl Product for USizeVec3 {
1450    #[inline]
1451    fn product<I>(iter: I) -> Self
1452    where
1453        I: Iterator<Item = Self>,
1454    {
1455        iter.fold(Self::ONE, Self::mul)
1456    }
1457}
1458
1459impl<'a> Product<&'a Self> for USizeVec3 {
1460    #[inline]
1461    fn product<I>(iter: I) -> Self
1462    where
1463        I: Iterator<Item = &'a Self>,
1464    {
1465        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
1466    }
1467}
1468
1469impl Not for USizeVec3 {
1470    type Output = Self;
1471    #[inline]
1472    fn not(self) -> Self {
1473        Self {
1474            x: self.x.not(),
1475            y: self.y.not(),
1476            z: self.z.not(),
1477        }
1478    }
1479}
1480
1481impl Not for &USizeVec3 {
1482    type Output = USizeVec3;
1483    #[inline]
1484    fn not(self) -> USizeVec3 {
1485        (*self).not()
1486    }
1487}
1488
1489impl BitAnd for USizeVec3 {
1490    type Output = Self;
1491    #[inline]
1492    fn bitand(self, rhs: Self) -> Self::Output {
1493        Self {
1494            x: self.x.bitand(rhs.x),
1495            y: self.y.bitand(rhs.y),
1496            z: self.z.bitand(rhs.z),
1497        }
1498    }
1499}
1500
1501impl BitAnd<&Self> for USizeVec3 {
1502    type Output = Self;
1503    #[inline]
1504    fn bitand(self, rhs: &Self) -> Self {
1505        self.bitand(*rhs)
1506    }
1507}
1508
1509impl BitAnd<&USizeVec3> for &USizeVec3 {
1510    type Output = USizeVec3;
1511    #[inline]
1512    fn bitand(self, rhs: &USizeVec3) -> USizeVec3 {
1513        (*self).bitand(*rhs)
1514    }
1515}
1516
1517impl BitAnd<USizeVec3> for &USizeVec3 {
1518    type Output = USizeVec3;
1519    #[inline]
1520    fn bitand(self, rhs: USizeVec3) -> USizeVec3 {
1521        (*self).bitand(rhs)
1522    }
1523}
1524
1525impl BitAndAssign for USizeVec3 {
1526    #[inline]
1527    fn bitand_assign(&mut self, rhs: Self) {
1528        *self = self.bitand(rhs);
1529    }
1530}
1531
1532impl BitAndAssign<&Self> for USizeVec3 {
1533    #[inline]
1534    fn bitand_assign(&mut self, rhs: &Self) {
1535        self.bitand_assign(*rhs);
1536    }
1537}
1538
1539impl BitOr for USizeVec3 {
1540    type Output = Self;
1541    #[inline]
1542    fn bitor(self, rhs: Self) -> Self::Output {
1543        Self {
1544            x: self.x.bitor(rhs.x),
1545            y: self.y.bitor(rhs.y),
1546            z: self.z.bitor(rhs.z),
1547        }
1548    }
1549}
1550
1551impl BitOr<&Self> for USizeVec3 {
1552    type Output = Self;
1553    #[inline]
1554    fn bitor(self, rhs: &Self) -> Self {
1555        self.bitor(*rhs)
1556    }
1557}
1558
1559impl BitOr<&USizeVec3> for &USizeVec3 {
1560    type Output = USizeVec3;
1561    #[inline]
1562    fn bitor(self, rhs: &USizeVec3) -> USizeVec3 {
1563        (*self).bitor(*rhs)
1564    }
1565}
1566
1567impl BitOr<USizeVec3> for &USizeVec3 {
1568    type Output = USizeVec3;
1569    #[inline]
1570    fn bitor(self, rhs: USizeVec3) -> USizeVec3 {
1571        (*self).bitor(rhs)
1572    }
1573}
1574
1575impl BitOrAssign for USizeVec3 {
1576    #[inline]
1577    fn bitor_assign(&mut self, rhs: Self) {
1578        *self = self.bitor(rhs);
1579    }
1580}
1581
1582impl BitOrAssign<&Self> for USizeVec3 {
1583    #[inline]
1584    fn bitor_assign(&mut self, rhs: &Self) {
1585        self.bitor_assign(*rhs);
1586    }
1587}
1588
1589impl BitXor for USizeVec3 {
1590    type Output = Self;
1591    #[inline]
1592    fn bitxor(self, rhs: Self) -> Self::Output {
1593        Self {
1594            x: self.x.bitxor(rhs.x),
1595            y: self.y.bitxor(rhs.y),
1596            z: self.z.bitxor(rhs.z),
1597        }
1598    }
1599}
1600
1601impl BitXor<&Self> for USizeVec3 {
1602    type Output = Self;
1603    #[inline]
1604    fn bitxor(self, rhs: &Self) -> Self {
1605        self.bitxor(*rhs)
1606    }
1607}
1608
1609impl BitXor<&USizeVec3> for &USizeVec3 {
1610    type Output = USizeVec3;
1611    #[inline]
1612    fn bitxor(self, rhs: &USizeVec3) -> USizeVec3 {
1613        (*self).bitxor(*rhs)
1614    }
1615}
1616
1617impl BitXor<USizeVec3> for &USizeVec3 {
1618    type Output = USizeVec3;
1619    #[inline]
1620    fn bitxor(self, rhs: USizeVec3) -> USizeVec3 {
1621        (*self).bitxor(rhs)
1622    }
1623}
1624
1625impl BitXorAssign for USizeVec3 {
1626    #[inline]
1627    fn bitxor_assign(&mut self, rhs: Self) {
1628        *self = self.bitxor(rhs);
1629    }
1630}
1631
1632impl BitXorAssign<&Self> for USizeVec3 {
1633    #[inline]
1634    fn bitxor_assign(&mut self, rhs: &Self) {
1635        self.bitxor_assign(*rhs);
1636    }
1637}
1638
1639impl BitAnd<usize> for USizeVec3 {
1640    type Output = Self;
1641    #[inline]
1642    fn bitand(self, rhs: usize) -> Self::Output {
1643        Self {
1644            x: self.x.bitand(rhs),
1645            y: self.y.bitand(rhs),
1646            z: self.z.bitand(rhs),
1647        }
1648    }
1649}
1650
1651impl BitAnd<&usize> for USizeVec3 {
1652    type Output = Self;
1653    #[inline]
1654    fn bitand(self, rhs: &usize) -> Self {
1655        self.bitand(*rhs)
1656    }
1657}
1658
1659impl BitAnd<&usize> for &USizeVec3 {
1660    type Output = USizeVec3;
1661    #[inline]
1662    fn bitand(self, rhs: &usize) -> USizeVec3 {
1663        (*self).bitand(*rhs)
1664    }
1665}
1666
1667impl BitAnd<usize> for &USizeVec3 {
1668    type Output = USizeVec3;
1669    #[inline]
1670    fn bitand(self, rhs: usize) -> USizeVec3 {
1671        (*self).bitand(rhs)
1672    }
1673}
1674
1675impl BitAndAssign<usize> for USizeVec3 {
1676    #[inline]
1677    fn bitand_assign(&mut self, rhs: usize) {
1678        *self = self.bitand(rhs);
1679    }
1680}
1681
1682impl BitAndAssign<&usize> for USizeVec3 {
1683    #[inline]
1684    fn bitand_assign(&mut self, rhs: &usize) {
1685        self.bitand_assign(*rhs);
1686    }
1687}
1688
1689impl BitOr<usize> for USizeVec3 {
1690    type Output = Self;
1691    #[inline]
1692    fn bitor(self, rhs: usize) -> Self::Output {
1693        Self {
1694            x: self.x.bitor(rhs),
1695            y: self.y.bitor(rhs),
1696            z: self.z.bitor(rhs),
1697        }
1698    }
1699}
1700
1701impl BitOr<&usize> for USizeVec3 {
1702    type Output = Self;
1703    #[inline]
1704    fn bitor(self, rhs: &usize) -> Self {
1705        self.bitor(*rhs)
1706    }
1707}
1708
1709impl BitOr<&usize> for &USizeVec3 {
1710    type Output = USizeVec3;
1711    #[inline]
1712    fn bitor(self, rhs: &usize) -> USizeVec3 {
1713        (*self).bitor(*rhs)
1714    }
1715}
1716
1717impl BitOr<usize> for &USizeVec3 {
1718    type Output = USizeVec3;
1719    #[inline]
1720    fn bitor(self, rhs: usize) -> USizeVec3 {
1721        (*self).bitor(rhs)
1722    }
1723}
1724
1725impl BitOrAssign<usize> for USizeVec3 {
1726    #[inline]
1727    fn bitor_assign(&mut self, rhs: usize) {
1728        *self = self.bitor(rhs);
1729    }
1730}
1731
1732impl BitOrAssign<&usize> for USizeVec3 {
1733    #[inline]
1734    fn bitor_assign(&mut self, rhs: &usize) {
1735        self.bitor_assign(*rhs);
1736    }
1737}
1738
1739impl BitXor<usize> for USizeVec3 {
1740    type Output = Self;
1741    #[inline]
1742    fn bitxor(self, rhs: usize) -> Self::Output {
1743        Self {
1744            x: self.x.bitxor(rhs),
1745            y: self.y.bitxor(rhs),
1746            z: self.z.bitxor(rhs),
1747        }
1748    }
1749}
1750
1751impl BitXor<&usize> for USizeVec3 {
1752    type Output = Self;
1753    #[inline]
1754    fn bitxor(self, rhs: &usize) -> Self {
1755        self.bitxor(*rhs)
1756    }
1757}
1758
1759impl BitXor<&usize> for &USizeVec3 {
1760    type Output = USizeVec3;
1761    #[inline]
1762    fn bitxor(self, rhs: &usize) -> USizeVec3 {
1763        (*self).bitxor(*rhs)
1764    }
1765}
1766
1767impl BitXor<usize> for &USizeVec3 {
1768    type Output = USizeVec3;
1769    #[inline]
1770    fn bitxor(self, rhs: usize) -> USizeVec3 {
1771        (*self).bitxor(rhs)
1772    }
1773}
1774
1775impl BitXorAssign<usize> for USizeVec3 {
1776    #[inline]
1777    fn bitxor_assign(&mut self, rhs: usize) {
1778        *self = self.bitxor(rhs);
1779    }
1780}
1781
1782impl BitXorAssign<&usize> for USizeVec3 {
1783    #[inline]
1784    fn bitxor_assign(&mut self, rhs: &usize) {
1785        self.bitxor_assign(*rhs);
1786    }
1787}
1788
1789impl Shl<i8> for USizeVec3 {
1790    type Output = Self;
1791    #[inline]
1792    fn shl(self, rhs: i8) -> Self::Output {
1793        Self {
1794            x: self.x.shl(rhs),
1795            y: self.y.shl(rhs),
1796            z: self.z.shl(rhs),
1797        }
1798    }
1799}
1800
1801impl Shl<&i8> for USizeVec3 {
1802    type Output = Self;
1803    #[inline]
1804    fn shl(self, rhs: &i8) -> Self {
1805        self.shl(*rhs)
1806    }
1807}
1808
1809impl Shl<&i8> for &USizeVec3 {
1810    type Output = USizeVec3;
1811    #[inline]
1812    fn shl(self, rhs: &i8) -> USizeVec3 {
1813        (*self).shl(*rhs)
1814    }
1815}
1816
1817impl Shl<i8> for &USizeVec3 {
1818    type Output = USizeVec3;
1819    #[inline]
1820    fn shl(self, rhs: i8) -> USizeVec3 {
1821        (*self).shl(rhs)
1822    }
1823}
1824
1825impl ShlAssign<i8> for USizeVec3 {
1826    #[inline]
1827    fn shl_assign(&mut self, rhs: i8) {
1828        *self = self.shl(rhs);
1829    }
1830}
1831
1832impl ShlAssign<&i8> for USizeVec3 {
1833    #[inline]
1834    fn shl_assign(&mut self, rhs: &i8) {
1835        self.shl_assign(*rhs);
1836    }
1837}
1838
1839impl Shr<i8> for USizeVec3 {
1840    type Output = Self;
1841    #[inline]
1842    fn shr(self, rhs: i8) -> Self::Output {
1843        Self {
1844            x: self.x.shr(rhs),
1845            y: self.y.shr(rhs),
1846            z: self.z.shr(rhs),
1847        }
1848    }
1849}
1850
1851impl Shr<&i8> for USizeVec3 {
1852    type Output = Self;
1853    #[inline]
1854    fn shr(self, rhs: &i8) -> Self {
1855        self.shr(*rhs)
1856    }
1857}
1858
1859impl Shr<&i8> for &USizeVec3 {
1860    type Output = USizeVec3;
1861    #[inline]
1862    fn shr(self, rhs: &i8) -> USizeVec3 {
1863        (*self).shr(*rhs)
1864    }
1865}
1866
1867impl Shr<i8> for &USizeVec3 {
1868    type Output = USizeVec3;
1869    #[inline]
1870    fn shr(self, rhs: i8) -> USizeVec3 {
1871        (*self).shr(rhs)
1872    }
1873}
1874
1875impl ShrAssign<i8> for USizeVec3 {
1876    #[inline]
1877    fn shr_assign(&mut self, rhs: i8) {
1878        *self = self.shr(rhs);
1879    }
1880}
1881
1882impl ShrAssign<&i8> for USizeVec3 {
1883    #[inline]
1884    fn shr_assign(&mut self, rhs: &i8) {
1885        self.shr_assign(*rhs);
1886    }
1887}
1888
1889impl Shl<i16> for USizeVec3 {
1890    type Output = Self;
1891    #[inline]
1892    fn shl(self, rhs: i16) -> Self::Output {
1893        Self {
1894            x: self.x.shl(rhs),
1895            y: self.y.shl(rhs),
1896            z: self.z.shl(rhs),
1897        }
1898    }
1899}
1900
1901impl Shl<&i16> for USizeVec3 {
1902    type Output = Self;
1903    #[inline]
1904    fn shl(self, rhs: &i16) -> Self {
1905        self.shl(*rhs)
1906    }
1907}
1908
1909impl Shl<&i16> for &USizeVec3 {
1910    type Output = USizeVec3;
1911    #[inline]
1912    fn shl(self, rhs: &i16) -> USizeVec3 {
1913        (*self).shl(*rhs)
1914    }
1915}
1916
1917impl Shl<i16> for &USizeVec3 {
1918    type Output = USizeVec3;
1919    #[inline]
1920    fn shl(self, rhs: i16) -> USizeVec3 {
1921        (*self).shl(rhs)
1922    }
1923}
1924
1925impl ShlAssign<i16> for USizeVec3 {
1926    #[inline]
1927    fn shl_assign(&mut self, rhs: i16) {
1928        *self = self.shl(rhs);
1929    }
1930}
1931
1932impl ShlAssign<&i16> for USizeVec3 {
1933    #[inline]
1934    fn shl_assign(&mut self, rhs: &i16) {
1935        self.shl_assign(*rhs);
1936    }
1937}
1938
1939impl Shr<i16> for USizeVec3 {
1940    type Output = Self;
1941    #[inline]
1942    fn shr(self, rhs: i16) -> Self::Output {
1943        Self {
1944            x: self.x.shr(rhs),
1945            y: self.y.shr(rhs),
1946            z: self.z.shr(rhs),
1947        }
1948    }
1949}
1950
1951impl Shr<&i16> for USizeVec3 {
1952    type Output = Self;
1953    #[inline]
1954    fn shr(self, rhs: &i16) -> Self {
1955        self.shr(*rhs)
1956    }
1957}
1958
1959impl Shr<&i16> for &USizeVec3 {
1960    type Output = USizeVec3;
1961    #[inline]
1962    fn shr(self, rhs: &i16) -> USizeVec3 {
1963        (*self).shr(*rhs)
1964    }
1965}
1966
1967impl Shr<i16> for &USizeVec3 {
1968    type Output = USizeVec3;
1969    #[inline]
1970    fn shr(self, rhs: i16) -> USizeVec3 {
1971        (*self).shr(rhs)
1972    }
1973}
1974
1975impl ShrAssign<i16> for USizeVec3 {
1976    #[inline]
1977    fn shr_assign(&mut self, rhs: i16) {
1978        *self = self.shr(rhs);
1979    }
1980}
1981
1982impl ShrAssign<&i16> for USizeVec3 {
1983    #[inline]
1984    fn shr_assign(&mut self, rhs: &i16) {
1985        self.shr_assign(*rhs);
1986    }
1987}
1988
1989impl Shl<i32> for USizeVec3 {
1990    type Output = Self;
1991    #[inline]
1992    fn shl(self, rhs: i32) -> Self::Output {
1993        Self {
1994            x: self.x.shl(rhs),
1995            y: self.y.shl(rhs),
1996            z: self.z.shl(rhs),
1997        }
1998    }
1999}
2000
2001impl Shl<&i32> for USizeVec3 {
2002    type Output = Self;
2003    #[inline]
2004    fn shl(self, rhs: &i32) -> Self {
2005        self.shl(*rhs)
2006    }
2007}
2008
2009impl Shl<&i32> for &USizeVec3 {
2010    type Output = USizeVec3;
2011    #[inline]
2012    fn shl(self, rhs: &i32) -> USizeVec3 {
2013        (*self).shl(*rhs)
2014    }
2015}
2016
2017impl Shl<i32> for &USizeVec3 {
2018    type Output = USizeVec3;
2019    #[inline]
2020    fn shl(self, rhs: i32) -> USizeVec3 {
2021        (*self).shl(rhs)
2022    }
2023}
2024
2025impl ShlAssign<i32> for USizeVec3 {
2026    #[inline]
2027    fn shl_assign(&mut self, rhs: i32) {
2028        *self = self.shl(rhs);
2029    }
2030}
2031
2032impl ShlAssign<&i32> for USizeVec3 {
2033    #[inline]
2034    fn shl_assign(&mut self, rhs: &i32) {
2035        self.shl_assign(*rhs);
2036    }
2037}
2038
2039impl Shr<i32> for USizeVec3 {
2040    type Output = Self;
2041    #[inline]
2042    fn shr(self, rhs: i32) -> Self::Output {
2043        Self {
2044            x: self.x.shr(rhs),
2045            y: self.y.shr(rhs),
2046            z: self.z.shr(rhs),
2047        }
2048    }
2049}
2050
2051impl Shr<&i32> for USizeVec3 {
2052    type Output = Self;
2053    #[inline]
2054    fn shr(self, rhs: &i32) -> Self {
2055        self.shr(*rhs)
2056    }
2057}
2058
2059impl Shr<&i32> for &USizeVec3 {
2060    type Output = USizeVec3;
2061    #[inline]
2062    fn shr(self, rhs: &i32) -> USizeVec3 {
2063        (*self).shr(*rhs)
2064    }
2065}
2066
2067impl Shr<i32> for &USizeVec3 {
2068    type Output = USizeVec3;
2069    #[inline]
2070    fn shr(self, rhs: i32) -> USizeVec3 {
2071        (*self).shr(rhs)
2072    }
2073}
2074
2075impl ShrAssign<i32> for USizeVec3 {
2076    #[inline]
2077    fn shr_assign(&mut self, rhs: i32) {
2078        *self = self.shr(rhs);
2079    }
2080}
2081
2082impl ShrAssign<&i32> for USizeVec3 {
2083    #[inline]
2084    fn shr_assign(&mut self, rhs: &i32) {
2085        self.shr_assign(*rhs);
2086    }
2087}
2088
2089impl Shl<i64> for USizeVec3 {
2090    type Output = Self;
2091    #[inline]
2092    fn shl(self, rhs: i64) -> Self::Output {
2093        Self {
2094            x: self.x.shl(rhs),
2095            y: self.y.shl(rhs),
2096            z: self.z.shl(rhs),
2097        }
2098    }
2099}
2100
2101impl Shl<&i64> for USizeVec3 {
2102    type Output = Self;
2103    #[inline]
2104    fn shl(self, rhs: &i64) -> Self {
2105        self.shl(*rhs)
2106    }
2107}
2108
2109impl Shl<&i64> for &USizeVec3 {
2110    type Output = USizeVec3;
2111    #[inline]
2112    fn shl(self, rhs: &i64) -> USizeVec3 {
2113        (*self).shl(*rhs)
2114    }
2115}
2116
2117impl Shl<i64> for &USizeVec3 {
2118    type Output = USizeVec3;
2119    #[inline]
2120    fn shl(self, rhs: i64) -> USizeVec3 {
2121        (*self).shl(rhs)
2122    }
2123}
2124
2125impl ShlAssign<i64> for USizeVec3 {
2126    #[inline]
2127    fn shl_assign(&mut self, rhs: i64) {
2128        *self = self.shl(rhs);
2129    }
2130}
2131
2132impl ShlAssign<&i64> for USizeVec3 {
2133    #[inline]
2134    fn shl_assign(&mut self, rhs: &i64) {
2135        self.shl_assign(*rhs);
2136    }
2137}
2138
2139impl Shr<i64> for USizeVec3 {
2140    type Output = Self;
2141    #[inline]
2142    fn shr(self, rhs: i64) -> Self::Output {
2143        Self {
2144            x: self.x.shr(rhs),
2145            y: self.y.shr(rhs),
2146            z: self.z.shr(rhs),
2147        }
2148    }
2149}
2150
2151impl Shr<&i64> for USizeVec3 {
2152    type Output = Self;
2153    #[inline]
2154    fn shr(self, rhs: &i64) -> Self {
2155        self.shr(*rhs)
2156    }
2157}
2158
2159impl Shr<&i64> for &USizeVec3 {
2160    type Output = USizeVec3;
2161    #[inline]
2162    fn shr(self, rhs: &i64) -> USizeVec3 {
2163        (*self).shr(*rhs)
2164    }
2165}
2166
2167impl Shr<i64> for &USizeVec3 {
2168    type Output = USizeVec3;
2169    #[inline]
2170    fn shr(self, rhs: i64) -> USizeVec3 {
2171        (*self).shr(rhs)
2172    }
2173}
2174
2175impl ShrAssign<i64> for USizeVec3 {
2176    #[inline]
2177    fn shr_assign(&mut self, rhs: i64) {
2178        *self = self.shr(rhs);
2179    }
2180}
2181
2182impl ShrAssign<&i64> for USizeVec3 {
2183    #[inline]
2184    fn shr_assign(&mut self, rhs: &i64) {
2185        self.shr_assign(*rhs);
2186    }
2187}
2188
2189impl Shl<u8> for USizeVec3 {
2190    type Output = Self;
2191    #[inline]
2192    fn shl(self, rhs: u8) -> Self::Output {
2193        Self {
2194            x: self.x.shl(rhs),
2195            y: self.y.shl(rhs),
2196            z: self.z.shl(rhs),
2197        }
2198    }
2199}
2200
2201impl Shl<&u8> for USizeVec3 {
2202    type Output = Self;
2203    #[inline]
2204    fn shl(self, rhs: &u8) -> Self {
2205        self.shl(*rhs)
2206    }
2207}
2208
2209impl Shl<&u8> for &USizeVec3 {
2210    type Output = USizeVec3;
2211    #[inline]
2212    fn shl(self, rhs: &u8) -> USizeVec3 {
2213        (*self).shl(*rhs)
2214    }
2215}
2216
2217impl Shl<u8> for &USizeVec3 {
2218    type Output = USizeVec3;
2219    #[inline]
2220    fn shl(self, rhs: u8) -> USizeVec3 {
2221        (*self).shl(rhs)
2222    }
2223}
2224
2225impl ShlAssign<u8> for USizeVec3 {
2226    #[inline]
2227    fn shl_assign(&mut self, rhs: u8) {
2228        *self = self.shl(rhs);
2229    }
2230}
2231
2232impl ShlAssign<&u8> for USizeVec3 {
2233    #[inline]
2234    fn shl_assign(&mut self, rhs: &u8) {
2235        self.shl_assign(*rhs);
2236    }
2237}
2238
2239impl Shr<u8> for USizeVec3 {
2240    type Output = Self;
2241    #[inline]
2242    fn shr(self, rhs: u8) -> Self::Output {
2243        Self {
2244            x: self.x.shr(rhs),
2245            y: self.y.shr(rhs),
2246            z: self.z.shr(rhs),
2247        }
2248    }
2249}
2250
2251impl Shr<&u8> for USizeVec3 {
2252    type Output = Self;
2253    #[inline]
2254    fn shr(self, rhs: &u8) -> Self {
2255        self.shr(*rhs)
2256    }
2257}
2258
2259impl Shr<&u8> for &USizeVec3 {
2260    type Output = USizeVec3;
2261    #[inline]
2262    fn shr(self, rhs: &u8) -> USizeVec3 {
2263        (*self).shr(*rhs)
2264    }
2265}
2266
2267impl Shr<u8> for &USizeVec3 {
2268    type Output = USizeVec3;
2269    #[inline]
2270    fn shr(self, rhs: u8) -> USizeVec3 {
2271        (*self).shr(rhs)
2272    }
2273}
2274
2275impl ShrAssign<u8> for USizeVec3 {
2276    #[inline]
2277    fn shr_assign(&mut self, rhs: u8) {
2278        *self = self.shr(rhs);
2279    }
2280}
2281
2282impl ShrAssign<&u8> for USizeVec3 {
2283    #[inline]
2284    fn shr_assign(&mut self, rhs: &u8) {
2285        self.shr_assign(*rhs);
2286    }
2287}
2288
2289impl Shl<u16> for USizeVec3 {
2290    type Output = Self;
2291    #[inline]
2292    fn shl(self, rhs: u16) -> Self::Output {
2293        Self {
2294            x: self.x.shl(rhs),
2295            y: self.y.shl(rhs),
2296            z: self.z.shl(rhs),
2297        }
2298    }
2299}
2300
2301impl Shl<&u16> for USizeVec3 {
2302    type Output = Self;
2303    #[inline]
2304    fn shl(self, rhs: &u16) -> Self {
2305        self.shl(*rhs)
2306    }
2307}
2308
2309impl Shl<&u16> for &USizeVec3 {
2310    type Output = USizeVec3;
2311    #[inline]
2312    fn shl(self, rhs: &u16) -> USizeVec3 {
2313        (*self).shl(*rhs)
2314    }
2315}
2316
2317impl Shl<u16> for &USizeVec3 {
2318    type Output = USizeVec3;
2319    #[inline]
2320    fn shl(self, rhs: u16) -> USizeVec3 {
2321        (*self).shl(rhs)
2322    }
2323}
2324
2325impl ShlAssign<u16> for USizeVec3 {
2326    #[inline]
2327    fn shl_assign(&mut self, rhs: u16) {
2328        *self = self.shl(rhs);
2329    }
2330}
2331
2332impl ShlAssign<&u16> for USizeVec3 {
2333    #[inline]
2334    fn shl_assign(&mut self, rhs: &u16) {
2335        self.shl_assign(*rhs);
2336    }
2337}
2338
2339impl Shr<u16> for USizeVec3 {
2340    type Output = Self;
2341    #[inline]
2342    fn shr(self, rhs: u16) -> Self::Output {
2343        Self {
2344            x: self.x.shr(rhs),
2345            y: self.y.shr(rhs),
2346            z: self.z.shr(rhs),
2347        }
2348    }
2349}
2350
2351impl Shr<&u16> for USizeVec3 {
2352    type Output = Self;
2353    #[inline]
2354    fn shr(self, rhs: &u16) -> Self {
2355        self.shr(*rhs)
2356    }
2357}
2358
2359impl Shr<&u16> for &USizeVec3 {
2360    type Output = USizeVec3;
2361    #[inline]
2362    fn shr(self, rhs: &u16) -> USizeVec3 {
2363        (*self).shr(*rhs)
2364    }
2365}
2366
2367impl Shr<u16> for &USizeVec3 {
2368    type Output = USizeVec3;
2369    #[inline]
2370    fn shr(self, rhs: u16) -> USizeVec3 {
2371        (*self).shr(rhs)
2372    }
2373}
2374
2375impl ShrAssign<u16> for USizeVec3 {
2376    #[inline]
2377    fn shr_assign(&mut self, rhs: u16) {
2378        *self = self.shr(rhs);
2379    }
2380}
2381
2382impl ShrAssign<&u16> for USizeVec3 {
2383    #[inline]
2384    fn shr_assign(&mut self, rhs: &u16) {
2385        self.shr_assign(*rhs);
2386    }
2387}
2388
2389impl Shl<u32> for USizeVec3 {
2390    type Output = Self;
2391    #[inline]
2392    fn shl(self, rhs: u32) -> Self::Output {
2393        Self {
2394            x: self.x.shl(rhs),
2395            y: self.y.shl(rhs),
2396            z: self.z.shl(rhs),
2397        }
2398    }
2399}
2400
2401impl Shl<&u32> for USizeVec3 {
2402    type Output = Self;
2403    #[inline]
2404    fn shl(self, rhs: &u32) -> Self {
2405        self.shl(*rhs)
2406    }
2407}
2408
2409impl Shl<&u32> for &USizeVec3 {
2410    type Output = USizeVec3;
2411    #[inline]
2412    fn shl(self, rhs: &u32) -> USizeVec3 {
2413        (*self).shl(*rhs)
2414    }
2415}
2416
2417impl Shl<u32> for &USizeVec3 {
2418    type Output = USizeVec3;
2419    #[inline]
2420    fn shl(self, rhs: u32) -> USizeVec3 {
2421        (*self).shl(rhs)
2422    }
2423}
2424
2425impl ShlAssign<u32> for USizeVec3 {
2426    #[inline]
2427    fn shl_assign(&mut self, rhs: u32) {
2428        *self = self.shl(rhs);
2429    }
2430}
2431
2432impl ShlAssign<&u32> for USizeVec3 {
2433    #[inline]
2434    fn shl_assign(&mut self, rhs: &u32) {
2435        self.shl_assign(*rhs);
2436    }
2437}
2438
2439impl Shr<u32> for USizeVec3 {
2440    type Output = Self;
2441    #[inline]
2442    fn shr(self, rhs: u32) -> Self::Output {
2443        Self {
2444            x: self.x.shr(rhs),
2445            y: self.y.shr(rhs),
2446            z: self.z.shr(rhs),
2447        }
2448    }
2449}
2450
2451impl Shr<&u32> for USizeVec3 {
2452    type Output = Self;
2453    #[inline]
2454    fn shr(self, rhs: &u32) -> Self {
2455        self.shr(*rhs)
2456    }
2457}
2458
2459impl Shr<&u32> for &USizeVec3 {
2460    type Output = USizeVec3;
2461    #[inline]
2462    fn shr(self, rhs: &u32) -> USizeVec3 {
2463        (*self).shr(*rhs)
2464    }
2465}
2466
2467impl Shr<u32> for &USizeVec3 {
2468    type Output = USizeVec3;
2469    #[inline]
2470    fn shr(self, rhs: u32) -> USizeVec3 {
2471        (*self).shr(rhs)
2472    }
2473}
2474
2475impl ShrAssign<u32> for USizeVec3 {
2476    #[inline]
2477    fn shr_assign(&mut self, rhs: u32) {
2478        *self = self.shr(rhs);
2479    }
2480}
2481
2482impl ShrAssign<&u32> for USizeVec3 {
2483    #[inline]
2484    fn shr_assign(&mut self, rhs: &u32) {
2485        self.shr_assign(*rhs);
2486    }
2487}
2488
2489impl Shl<u64> for USizeVec3 {
2490    type Output = Self;
2491    #[inline]
2492    fn shl(self, rhs: u64) -> Self::Output {
2493        Self {
2494            x: self.x.shl(rhs),
2495            y: self.y.shl(rhs),
2496            z: self.z.shl(rhs),
2497        }
2498    }
2499}
2500
2501impl Shl<&u64> for USizeVec3 {
2502    type Output = Self;
2503    #[inline]
2504    fn shl(self, rhs: &u64) -> Self {
2505        self.shl(*rhs)
2506    }
2507}
2508
2509impl Shl<&u64> for &USizeVec3 {
2510    type Output = USizeVec3;
2511    #[inline]
2512    fn shl(self, rhs: &u64) -> USizeVec3 {
2513        (*self).shl(*rhs)
2514    }
2515}
2516
2517impl Shl<u64> for &USizeVec3 {
2518    type Output = USizeVec3;
2519    #[inline]
2520    fn shl(self, rhs: u64) -> USizeVec3 {
2521        (*self).shl(rhs)
2522    }
2523}
2524
2525impl ShlAssign<u64> for USizeVec3 {
2526    #[inline]
2527    fn shl_assign(&mut self, rhs: u64) {
2528        *self = self.shl(rhs);
2529    }
2530}
2531
2532impl ShlAssign<&u64> for USizeVec3 {
2533    #[inline]
2534    fn shl_assign(&mut self, rhs: &u64) {
2535        self.shl_assign(*rhs);
2536    }
2537}
2538
2539impl Shr<u64> for USizeVec3 {
2540    type Output = Self;
2541    #[inline]
2542    fn shr(self, rhs: u64) -> Self::Output {
2543        Self {
2544            x: self.x.shr(rhs),
2545            y: self.y.shr(rhs),
2546            z: self.z.shr(rhs),
2547        }
2548    }
2549}
2550
2551impl Shr<&u64> for USizeVec3 {
2552    type Output = Self;
2553    #[inline]
2554    fn shr(self, rhs: &u64) -> Self {
2555        self.shr(*rhs)
2556    }
2557}
2558
2559impl Shr<&u64> for &USizeVec3 {
2560    type Output = USizeVec3;
2561    #[inline]
2562    fn shr(self, rhs: &u64) -> USizeVec3 {
2563        (*self).shr(*rhs)
2564    }
2565}
2566
2567impl Shr<u64> for &USizeVec3 {
2568    type Output = USizeVec3;
2569    #[inline]
2570    fn shr(self, rhs: u64) -> USizeVec3 {
2571        (*self).shr(rhs)
2572    }
2573}
2574
2575impl ShrAssign<u64> for USizeVec3 {
2576    #[inline]
2577    fn shr_assign(&mut self, rhs: u64) {
2578        *self = self.shr(rhs);
2579    }
2580}
2581
2582impl ShrAssign<&u64> for USizeVec3 {
2583    #[inline]
2584    fn shr_assign(&mut self, rhs: &u64) {
2585        self.shr_assign(*rhs);
2586    }
2587}
2588
2589impl Shl<IVec3> for USizeVec3 {
2590    type Output = Self;
2591    #[inline]
2592    fn shl(self, rhs: IVec3) -> Self {
2593        Self {
2594            x: self.x.shl(rhs.x),
2595            y: self.y.shl(rhs.y),
2596            z: self.z.shl(rhs.z),
2597        }
2598    }
2599}
2600
2601impl Shl<&IVec3> for USizeVec3 {
2602    type Output = Self;
2603    #[inline]
2604    fn shl(self, rhs: &IVec3) -> Self {
2605        self.shl(*rhs)
2606    }
2607}
2608
2609impl Shl<&IVec3> for &USizeVec3 {
2610    type Output = USizeVec3;
2611    #[inline]
2612    fn shl(self, rhs: &IVec3) -> USizeVec3 {
2613        (*self).shl(*rhs)
2614    }
2615}
2616
2617impl Shl<IVec3> for &USizeVec3 {
2618    type Output = USizeVec3;
2619    #[inline]
2620    fn shl(self, rhs: IVec3) -> USizeVec3 {
2621        (*self).shl(rhs)
2622    }
2623}
2624
2625impl Shr<IVec3> for USizeVec3 {
2626    type Output = Self;
2627    #[inline]
2628    fn shr(self, rhs: IVec3) -> Self {
2629        Self {
2630            x: self.x.shr(rhs.x),
2631            y: self.y.shr(rhs.y),
2632            z: self.z.shr(rhs.z),
2633        }
2634    }
2635}
2636
2637impl Shr<&IVec3> for USizeVec3 {
2638    type Output = Self;
2639    #[inline]
2640    fn shr(self, rhs: &IVec3) -> Self {
2641        self.shr(*rhs)
2642    }
2643}
2644
2645impl Shr<&IVec3> for &USizeVec3 {
2646    type Output = USizeVec3;
2647    #[inline]
2648    fn shr(self, rhs: &IVec3) -> USizeVec3 {
2649        (*self).shr(*rhs)
2650    }
2651}
2652
2653impl Shr<IVec3> for &USizeVec3 {
2654    type Output = USizeVec3;
2655    #[inline]
2656    fn shr(self, rhs: IVec3) -> USizeVec3 {
2657        (*self).shr(rhs)
2658    }
2659}
2660
2661impl Shl<UVec3> for USizeVec3 {
2662    type Output = Self;
2663    #[inline]
2664    fn shl(self, rhs: UVec3) -> Self {
2665        Self {
2666            x: self.x.shl(rhs.x),
2667            y: self.y.shl(rhs.y),
2668            z: self.z.shl(rhs.z),
2669        }
2670    }
2671}
2672
2673impl Shl<&UVec3> for USizeVec3 {
2674    type Output = Self;
2675    #[inline]
2676    fn shl(self, rhs: &UVec3) -> Self {
2677        self.shl(*rhs)
2678    }
2679}
2680
2681impl Shl<&UVec3> for &USizeVec3 {
2682    type Output = USizeVec3;
2683    #[inline]
2684    fn shl(self, rhs: &UVec3) -> USizeVec3 {
2685        (*self).shl(*rhs)
2686    }
2687}
2688
2689impl Shl<UVec3> for &USizeVec3 {
2690    type Output = USizeVec3;
2691    #[inline]
2692    fn shl(self, rhs: UVec3) -> USizeVec3 {
2693        (*self).shl(rhs)
2694    }
2695}
2696
2697impl Shr<UVec3> for USizeVec3 {
2698    type Output = Self;
2699    #[inline]
2700    fn shr(self, rhs: UVec3) -> Self {
2701        Self {
2702            x: self.x.shr(rhs.x),
2703            y: self.y.shr(rhs.y),
2704            z: self.z.shr(rhs.z),
2705        }
2706    }
2707}
2708
2709impl Shr<&UVec3> for USizeVec3 {
2710    type Output = Self;
2711    #[inline]
2712    fn shr(self, rhs: &UVec3) -> Self {
2713        self.shr(*rhs)
2714    }
2715}
2716
2717impl Shr<&UVec3> for &USizeVec3 {
2718    type Output = USizeVec3;
2719    #[inline]
2720    fn shr(self, rhs: &UVec3) -> USizeVec3 {
2721        (*self).shr(*rhs)
2722    }
2723}
2724
2725impl Shr<UVec3> for &USizeVec3 {
2726    type Output = USizeVec3;
2727    #[inline]
2728    fn shr(self, rhs: UVec3) -> USizeVec3 {
2729        (*self).shr(rhs)
2730    }
2731}
2732
2733impl Index<usize> for USizeVec3 {
2734    type Output = usize;
2735    #[inline]
2736    fn index(&self, index: usize) -> &Self::Output {
2737        match index {
2738            0 => &self.x,
2739            1 => &self.y,
2740            2 => &self.z,
2741            _ => panic!("index out of bounds"),
2742        }
2743    }
2744}
2745
2746impl IndexMut<usize> for USizeVec3 {
2747    #[inline]
2748    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
2749        match index {
2750            0 => &mut self.x,
2751            1 => &mut self.y,
2752            2 => &mut self.z,
2753            _ => panic!("index out of bounds"),
2754        }
2755    }
2756}
2757
2758impl fmt::Display for USizeVec3 {
2759    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2760        write!(f, "[{}, {}, {}]", self.x, self.y, self.z)
2761    }
2762}
2763
2764impl fmt::Debug for USizeVec3 {
2765    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
2766        fmt.debug_tuple(stringify!(USizeVec3))
2767            .field(&self.x)
2768            .field(&self.y)
2769            .field(&self.z)
2770            .finish()
2771    }
2772}
2773
2774impl From<[usize; 3]> for USizeVec3 {
2775    #[inline]
2776    fn from(a: [usize; 3]) -> Self {
2777        Self::new(a[0], a[1], a[2])
2778    }
2779}
2780
2781impl From<USizeVec3> for [usize; 3] {
2782    #[inline]
2783    fn from(v: USizeVec3) -> Self {
2784        [v.x, v.y, v.z]
2785    }
2786}
2787
2788impl From<(usize, usize, usize)> for USizeVec3 {
2789    #[inline]
2790    fn from(t: (usize, usize, usize)) -> Self {
2791        Self::new(t.0, t.1, t.2)
2792    }
2793}
2794
2795impl From<USizeVec3> for (usize, usize, usize) {
2796    #[inline]
2797    fn from(v: USizeVec3) -> Self {
2798        (v.x, v.y, v.z)
2799    }
2800}
2801
2802impl From<(USizeVec2, usize)> for USizeVec3 {
2803    #[inline]
2804    fn from((v, z): (USizeVec2, usize)) -> Self {
2805        Self::new(v.x, v.y, z)
2806    }
2807}
2808
2809impl From<U8Vec3> for USizeVec3 {
2810    #[inline]
2811    fn from(v: U8Vec3) -> Self {
2812        Self::new(usize::from(v.x), usize::from(v.y), usize::from(v.z))
2813    }
2814}
2815
2816impl From<U16Vec3> for USizeVec3 {
2817    #[inline]
2818    fn from(v: U16Vec3) -> Self {
2819        Self::new(usize::from(v.x), usize::from(v.y), usize::from(v.z))
2820    }
2821}
2822
2823impl TryFrom<I8Vec3> for USizeVec3 {
2824    type Error = core::num::TryFromIntError;
2825
2826    #[inline]
2827    fn try_from(v: I8Vec3) -> Result<Self, Self::Error> {
2828        Ok(Self::new(
2829            usize::try_from(v.x)?,
2830            usize::try_from(v.y)?,
2831            usize::try_from(v.z)?,
2832        ))
2833    }
2834}
2835
2836impl TryFrom<I16Vec3> for USizeVec3 {
2837    type Error = core::num::TryFromIntError;
2838
2839    #[inline]
2840    fn try_from(v: I16Vec3) -> Result<Self, Self::Error> {
2841        Ok(Self::new(
2842            usize::try_from(v.x)?,
2843            usize::try_from(v.y)?,
2844            usize::try_from(v.z)?,
2845        ))
2846    }
2847}
2848
2849impl TryFrom<IVec3> for USizeVec3 {
2850    type Error = core::num::TryFromIntError;
2851
2852    #[inline]
2853    fn try_from(v: IVec3) -> Result<Self, Self::Error> {
2854        Ok(Self::new(
2855            usize::try_from(v.x)?,
2856            usize::try_from(v.y)?,
2857            usize::try_from(v.z)?,
2858        ))
2859    }
2860}
2861
2862impl TryFrom<I64Vec3> for USizeVec3 {
2863    type Error = core::num::TryFromIntError;
2864
2865    #[inline]
2866    fn try_from(v: I64Vec3) -> Result<Self, Self::Error> {
2867        Ok(Self::new(
2868            usize::try_from(v.x)?,
2869            usize::try_from(v.y)?,
2870            usize::try_from(v.z)?,
2871        ))
2872    }
2873}
2874
2875impl TryFrom<UVec3> for USizeVec3 {
2876    type Error = core::num::TryFromIntError;
2877
2878    #[inline]
2879    fn try_from(v: UVec3) -> Result<Self, Self::Error> {
2880        Ok(Self::new(
2881            usize::try_from(v.x)?,
2882            usize::try_from(v.y)?,
2883            usize::try_from(v.z)?,
2884        ))
2885    }
2886}
2887
2888impl TryFrom<U64Vec3> for USizeVec3 {
2889    type Error = core::num::TryFromIntError;
2890
2891    #[inline]
2892    fn try_from(v: U64Vec3) -> Result<Self, Self::Error> {
2893        Ok(Self::new(
2894            usize::try_from(v.x)?,
2895            usize::try_from(v.y)?,
2896            usize::try_from(v.z)?,
2897        ))
2898    }
2899}
2900
2901impl From<BVec3> for USizeVec3 {
2902    #[inline]
2903    fn from(v: BVec3) -> Self {
2904        Self::new(usize::from(v.x), usize::from(v.y), usize::from(v.z))
2905    }
2906}
2907
2908impl From<BVec3A> for USizeVec3 {
2909    #[inline]
2910    fn from(v: BVec3A) -> Self {
2911        let bool_array: [bool; 3] = v.into();
2912        Self::new(
2913            usize::from(bool_array[0]),
2914            usize::from(bool_array[1]),
2915            usize::from(bool_array[2]),
2916        )
2917    }
2918}