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