• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitshifter / glam-rs / 24918269367

25 Apr 2026 12:40AM UTC coverage: 97.134%. Remained the same
24918269367

push

github

bitshifter
Add types are conditional.

57276 of 58966 relevant lines covered (97.13%)

3.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.95
/src/u32/uvec3.rs
1
// Generated from vec.rs.tera template. Edit the template, not the generated file.
2

3
use crate::{BVec3, BVec3A, U16Vec3, U8Vec3, UVec2, UVec4};
4

5
#[cfg(feature = "i8")]
6
use crate::I8Vec3;
7

8
#[cfg(feature = "i16")]
9
use crate::I16Vec3;
10

11
#[cfg(feature = "i32")]
12
use crate::IVec3;
13

14
#[cfg(feature = "i64")]
15
use crate::I64Vec3;
16

17
#[cfg(feature = "u64")]
18
use crate::U64Vec3;
19

20
#[cfg(feature = "isize")]
21
use crate::ISizeVec3;
22

23
#[cfg(feature = "usize")]
24
use crate::USizeVec3;
25

26
use core::fmt;
27
use core::iter::{Product, Sum};
28
use core::{f32, ops::*};
29

30
#[cfg(feature = "zerocopy")]
31
use zerocopy_derive::*;
32

33
/// Creates a 3-dimensional vector.
34
#[inline(always)]
35
#[must_use]
36
pub const fn uvec3(x: u32, y: u32, z: u32) -> UVec3 {
6✔
37
    UVec3::new(x, y, z)
×
38
}
39

40
/// A 3-dimensional vector.
41
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
42
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
43
#[cfg_attr(
44
    feature = "zerocopy",
45
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
46
)]
47
#[repr(C)]
48
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
49
pub struct UVec3 {
50
    pub x: u32,
51
    pub y: u32,
52
    pub z: u32,
53
}
54

55
impl UVec3 {
56
    /// All zeroes.
57
    pub const ZERO: Self = Self::splat(0);
58

59
    /// All ones.
60
    pub const ONE: Self = Self::splat(1);
61

62
    /// All `u32::MIN`.
63
    pub const MIN: Self = Self::splat(u32::MIN);
64

65
    /// All `u32::MAX`.
66
    pub const MAX: Self = Self::splat(u32::MAX);
67

68
    /// A unit vector pointing along the positive X axis.
69
    pub const X: Self = Self::new(1, 0, 0);
70

71
    /// A unit vector pointing along the positive Y axis.
72
    pub const Y: Self = Self::new(0, 1, 0);
73

74
    /// A unit vector pointing along the positive Z axis.
75
    pub const Z: Self = Self::new(0, 0, 1);
76

77
    /// The unit axes.
78
    pub const AXES: [Self; 3] = [Self::X, Self::Y, Self::Z];
79

80
    /// Creates a new vector.
81
    #[inline(always)]
82
    #[must_use]
83
    pub const fn new(x: u32, y: u32, z: u32) -> Self {
15✔
84
        Self { x, y, z }
85
    }
86

87
    /// Creates a vector with all elements set to `v`.
88
    #[inline]
89
    #[must_use]
90
    pub const fn splat(v: u32) -> Self {
3✔
91
        Self { x: v, y: v, z: v }
92
    }
93

94
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
95
    #[inline]
96
    #[must_use]
97
    pub fn map<F>(self, f: F) -> Self
6✔
98
    where
99
        F: Fn(u32) -> u32,
100
    {
101
        Self::new(f(self.x), f(self.y), f(self.z))
12✔
102
    }
103

104
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
105
    /// for each element of `self`.
106
    ///
107
    /// A true element in the mask uses the corresponding element from `if_true`, and false
108
    /// uses the element from `if_false`.
109
    #[inline]
110
    #[must_use]
111
    pub fn select(mask: BVec3, if_true: Self, if_false: Self) -> Self {
3✔
112
        Self {
113
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
114
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
115
            z: if mask.test(2) { if_true.z } else { if_false.z },
3✔
116
        }
117
    }
118

119
    /// Creates a new vector from an array.
120
    #[inline]
121
    #[must_use]
122
    pub const fn from_array(a: [u32; 3]) -> Self {
×
123
        Self::new(a[0], a[1], a[2])
×
124
    }
125

126
    /// Converts `self` to `[x, y, z]`
127
    #[inline]
128
    #[must_use]
129
    pub const fn to_array(&self) -> [u32; 3] {
3✔
130
        [self.x, self.y, self.z]
3✔
131
    }
132

133
    /// Creates a vector from the first 3 values in `slice`.
134
    ///
135
    /// # Panics
136
    ///
137
    /// Panics if `slice` is less than 3 elements long.
138
    #[inline]
139
    #[must_use]
140
    pub const fn from_slice(slice: &[u32]) -> Self {
3✔
141
        assert!(slice.len() >= 3);
3✔
142
        Self::new(slice[0], slice[1], slice[2])
3✔
143
    }
144

145
    /// Writes the elements of `self` to the first 3 elements in `slice`.
146
    ///
147
    /// # Panics
148
    ///
149
    /// Panics if `slice` is less than 3 elements long.
150
    #[inline]
151
    pub fn write_to_slice(self, slice: &mut [u32]) {
3✔
152
        slice[..3].copy_from_slice(&self.to_array());
3✔
153
    }
154

155
    /// Internal method for creating a 3D vector from a 4D vector, discarding `w`.
156
    #[allow(dead_code)]
157
    #[inline]
158
    #[must_use]
159
    pub(crate) fn from_vec4(v: UVec4) -> Self {
×
160
        Self {
161
            x: v.x,
×
162
            y: v.y,
×
163
            z: v.z,
×
164
        }
165
    }
166

167
    /// Creates a 4D vector from `self` and the given `w` value.
168
    #[inline]
169
    #[must_use]
170
    pub fn extend(self, w: u32) -> UVec4 {
3✔
171
        UVec4::new(self.x, self.y, self.z, w)
3✔
172
    }
173

174
    /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`.
175
    ///
176
    /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()].
177
    #[inline]
178
    #[must_use]
179
    pub fn truncate(self) -> UVec2 {
×
180
        use crate::swizzles::Vec3Swizzles;
181
        self.xy()
×
182
    }
183

184
    /// Creates a 3D vector from `self` with the given value of `x`.
185
    #[inline]
186
    #[must_use]
187
    pub fn with_x(mut self, x: u32) -> Self {
3✔
188
        self.x = x;
3✔
189
        self
3✔
190
    }
191

192
    /// Creates a 3D vector from `self` with the given value of `y`.
193
    #[inline]
194
    #[must_use]
195
    pub fn with_y(mut self, y: u32) -> Self {
3✔
196
        self.y = y;
3✔
197
        self
3✔
198
    }
199

200
    /// Creates a 3D vector from `self` with the given value of `z`.
201
    #[inline]
202
    #[must_use]
203
    pub fn with_z(mut self, z: u32) -> Self {
3✔
204
        self.z = z;
3✔
205
        self
3✔
206
    }
207

208
    /// Computes the dot product of `self` and `rhs`.
209
    #[inline]
210
    #[must_use]
211
    pub fn dot(self, rhs: Self) -> u32 {
3✔
212
        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z)
3✔
213
    }
214

215
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
216
    #[inline]
217
    #[must_use]
218
    pub fn dot_into_vec(self, rhs: Self) -> Self {
3✔
219
        Self::splat(self.dot(rhs))
3✔
220
    }
221

222
    /// Computes the cross product of `self` and `rhs`.
223
    #[inline]
224
    #[must_use]
225
    pub fn cross(self, rhs: Self) -> Self {
3✔
226
        Self {
227
            x: self.y * rhs.z - rhs.y * self.z,
3✔
228
            y: self.z * rhs.x - rhs.z * self.x,
6✔
229
            z: self.x * rhs.y - rhs.x * self.y,
6✔
230
        }
231
    }
232

233
    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
234
    ///
235
    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
236
    #[inline]
237
    #[must_use]
238
    pub fn min(self, rhs: Self) -> Self {
3✔
239
        Self {
240
            x: if self.x < rhs.x { self.x } else { rhs.x },
3✔
241
            y: if self.y < rhs.y { self.y } else { rhs.y },
3✔
242
            z: if self.z < rhs.z { self.z } else { rhs.z },
3✔
243
        }
244
    }
245

246
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
247
    ///
248
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
249
    #[inline]
250
    #[must_use]
251
    pub fn max(self, rhs: Self) -> Self {
3✔
252
        Self {
253
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
254
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
255
            z: if self.z > rhs.z { self.z } else { rhs.z },
3✔
256
        }
257
    }
258

259
    /// Component-wise clamping of values, similar to [`u32::clamp`].
260
    ///
261
    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
262
    ///
263
    /// # Panics
264
    ///
265
    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
266
    #[inline]
267
    #[must_use]
268
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
269
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
270
        self.max(min).min(max)
3✔
271
    }
272

273
    /// Returns the horizontal minimum of `self`.
274
    ///
275
    /// In other words this computes `min(x, y, ..)`.
276
    #[inline]
277
    #[must_use]
278
    pub fn min_element(self) -> u32 {
6✔
279
        let min = |a, b| if a < b { a } else { b };
12✔
280
        min(self.x, min(self.y, self.z))
6✔
281
    }
282

283
    /// Returns the horizontal maximum of `self`.
284
    ///
285
    /// In other words this computes `max(x, y, ..)`.
286
    #[inline]
287
    #[must_use]
288
    pub fn max_element(self) -> u32 {
6✔
289
        let max = |a, b| if a > b { a } else { b };
12✔
290
        max(self.x, max(self.y, self.z))
6✔
291
    }
292

293
    /// Returns the index of the first minimum element of `self`.
294
    #[doc(alias = "argmin")]
295
    #[inline]
296
    #[must_use]
297
    pub fn min_position(self) -> usize {
3✔
298
        let mut min = self.x;
3✔
299
        let mut index = 0;
3✔
300
        if self.y < min {
6✔
301
            min = self.y;
3✔
302
            index = 1;
3✔
303
        }
304
        if self.z < min {
6✔
305
            index = 2;
3✔
306
        }
307
        index
3✔
308
    }
309

310
    /// Returns the index of the first maximum element of `self`.
311
    #[doc(alias = "argmax")]
312
    #[inline]
313
    #[must_use]
314
    pub fn max_position(self) -> usize {
3✔
315
        let mut max = self.x;
3✔
316
        let mut index = 0;
3✔
317
        if self.y > max {
6✔
318
            max = self.y;
3✔
319
            index = 1;
3✔
320
        }
321
        if self.z > max {
6✔
322
            index = 2;
3✔
323
        }
324
        index
3✔
325
    }
326

327
    /// Returns the sum of all elements of `self`.
328
    ///
329
    /// In other words, this computes `self.x + self.y + ..`.
330
    #[inline]
331
    #[must_use]
332
    pub fn element_sum(self) -> u32 {
3✔
333
        self.x + self.y + self.z
3✔
334
    }
335

336
    /// Returns the product of all elements of `self`.
337
    ///
338
    /// In other words, this computes `self.x * self.y * ..`.
339
    #[inline]
340
    #[must_use]
341
    pub fn element_product(self) -> u32 {
3✔
342
        self.x * self.y * self.z
3✔
343
    }
344

345
    /// Returns a vector mask containing the result of a `==` comparison for each element of
346
    /// `self` and `rhs`.
347
    ///
348
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
349
    /// elements.
350
    #[inline]
351
    #[must_use]
352
    pub fn cmpeq(self, rhs: Self) -> BVec3 {
3✔
353
        BVec3::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y), self.z.eq(&rhs.z))
3✔
354
    }
355

356
    /// Returns a vector mask containing the result of a `!=` comparison for each element of
357
    /// `self` and `rhs`.
358
    ///
359
    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
360
    /// elements.
361
    #[inline]
362
    #[must_use]
363
    pub fn cmpne(self, rhs: Self) -> BVec3 {
3✔
364
        BVec3::new(self.x.ne(&rhs.x), self.y.ne(&rhs.y), self.z.ne(&rhs.z))
3✔
365
    }
366

367
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
368
    /// `self` and `rhs`.
369
    ///
370
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
371
    /// elements.
372
    #[inline]
373
    #[must_use]
374
    pub fn cmpge(self, rhs: Self) -> BVec3 {
3✔
375
        BVec3::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y), self.z.ge(&rhs.z))
3✔
376
    }
377

378
    /// Returns a vector mask containing the result of a `>` comparison for each element of
379
    /// `self` and `rhs`.
380
    ///
381
    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
382
    /// elements.
383
    #[inline]
384
    #[must_use]
385
    pub fn cmpgt(self, rhs: Self) -> BVec3 {
3✔
386
        BVec3::new(self.x.gt(&rhs.x), self.y.gt(&rhs.y), self.z.gt(&rhs.z))
3✔
387
    }
388

389
    /// Returns a vector mask containing the result of a `<=` comparison for each element of
390
    /// `self` and `rhs`.
391
    ///
392
    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
393
    /// elements.
394
    #[inline]
395
    #[must_use]
396
    pub fn cmple(self, rhs: Self) -> BVec3 {
6✔
397
        BVec3::new(self.x.le(&rhs.x), self.y.le(&rhs.y), self.z.le(&rhs.z))
6✔
398
    }
399

400
    /// Returns a vector mask containing the result of a `<` comparison for each element of
401
    /// `self` and `rhs`.
402
    ///
403
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
404
    /// elements.
405
    #[inline]
406
    #[must_use]
407
    pub fn cmplt(self, rhs: Self) -> BVec3 {
3✔
408
        BVec3::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y), self.z.lt(&rhs.z))
3✔
409
    }
410

411
    /// Computes the squared length of `self`.
412
    #[doc(alias = "magnitude2")]
413
    #[inline]
414
    #[must_use]
415
    pub fn length_squared(self) -> u32 {
3✔
416
        self.dot(self)
3✔
417
    }
418

419
    /// Computes the [manhattan distance] between two points.
420
    ///
421
    /// # Overflow
422
    /// This method may overflow if the result is greater than [`u32::MAX`].
423
    ///
424
    /// See also [`checked_manhattan_distance`][UVec3::checked_manhattan_distance].
425
    ///
426
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
427
    #[inline]
428
    #[must_use]
429
    pub fn manhattan_distance(self, rhs: Self) -> u32 {
3✔
430
        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y) + self.z.abs_diff(rhs.z)
3✔
431
    }
432

433
    /// Computes the [manhattan distance] between two points.
434
    ///
435
    /// This will returns [`None`] if the result is greater than [`u32::MAX`].
436
    ///
437
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
438
    #[inline]
439
    #[must_use]
440
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<u32> {
3✔
441
        let d = self.x.abs_diff(rhs.x);
3✔
442
        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
3✔
443
        d.checked_add(self.z.abs_diff(rhs.z))
3✔
444
    }
445

446
    /// Computes the [chebyshev distance] between two points.
447
    ///
448
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
449
    #[inline]
450
    #[must_use]
451
    pub fn chebyshev_distance(self, rhs: Self) -> u32 {
3✔
452
        // Note: the compiler will eventually optimize out the loop
453
        [
454
            self.x.abs_diff(rhs.x),
3✔
455
            self.y.abs_diff(rhs.y),
3✔
456
            self.z.abs_diff(rhs.z),
3✔
457
        ]
458
        .into_iter()
459
        .max()
460
        .unwrap()
461
    }
462

463
    /// Casts all elements of `self` to `f32`.
464
    #[inline]
465
    #[must_use]
466
    pub fn as_vec3(self) -> crate::Vec3 {
3✔
467
        crate::Vec3::new(self.x as f32, self.y as f32, self.z as f32)
3✔
468
    }
469

470
    /// Casts all elements of `self` to `f32`.
471
    #[inline]
472
    #[must_use]
473
    pub fn as_vec3a(self) -> crate::Vec3A {
3✔
474
        crate::Vec3A::new(self.x as f32, self.y as f32, self.z as f32)
3✔
475
    }
476

477
    /// Casts all elements of `self` to `f64`.
478
    #[cfg(feature = "f64")]
479
    #[inline]
480
    #[must_use]
481
    pub fn as_dvec3(self) -> crate::DVec3 {
3✔
482
        crate::DVec3::new(self.x as f64, self.y as f64, self.z as f64)
3✔
483
    }
484

485
    /// Casts all elements of `self` to `i8`.
486
    #[cfg(feature = "i8")]
487
    #[inline]
488
    #[must_use]
489
    pub fn as_i8vec3(self) -> crate::I8Vec3 {
3✔
490
        crate::I8Vec3::new(self.x as i8, self.y as i8, self.z as i8)
3✔
491
    }
492

493
    /// Casts all elements of `self` to `u8`.
494
    #[cfg(feature = "u8")]
495
    #[inline]
496
    #[must_use]
497
    pub fn as_u8vec3(self) -> crate::U8Vec3 {
3✔
498
        crate::U8Vec3::new(self.x as u8, self.y as u8, self.z as u8)
3✔
499
    }
500

501
    /// Casts all elements of `self` to `i16`.
502
    #[cfg(feature = "i16")]
503
    #[inline]
504
    #[must_use]
505
    pub fn as_i16vec3(self) -> crate::I16Vec3 {
3✔
506
        crate::I16Vec3::new(self.x as i16, self.y as i16, self.z as i16)
3✔
507
    }
508

509
    /// Casts all elements of `self` to `u16`.
510
    #[cfg(feature = "u16")]
511
    #[inline]
512
    #[must_use]
513
    pub fn as_u16vec3(self) -> crate::U16Vec3 {
3✔
514
        crate::U16Vec3::new(self.x as u16, self.y as u16, self.z as u16)
3✔
515
    }
516

517
    /// Casts all elements of `self` to `i32`.
518
    #[cfg(feature = "i32")]
519
    #[inline]
520
    #[must_use]
521
    pub fn as_ivec3(self) -> crate::IVec3 {
3✔
522
        crate::IVec3::new(self.x as i32, self.y as i32, self.z as i32)
3✔
523
    }
524

525
    /// Casts all elements of `self` to `i64`.
526
    #[cfg(feature = "i64")]
527
    #[inline]
528
    #[must_use]
529
    pub fn as_i64vec3(self) -> crate::I64Vec3 {
3✔
530
        crate::I64Vec3::new(self.x as i64, self.y as i64, self.z as i64)
3✔
531
    }
532

533
    /// Casts all elements of `self` to `u64`.
534
    #[cfg(feature = "u64")]
535
    #[inline]
536
    #[must_use]
537
    pub fn as_u64vec3(self) -> crate::U64Vec3 {
3✔
538
        crate::U64Vec3::new(self.x as u64, self.y as u64, self.z as u64)
3✔
539
    }
540

541
    /// Casts all elements of `self` to `isize`.
542
    #[cfg(feature = "isize")]
543
    #[inline]
544
    #[must_use]
545
    pub fn as_isizevec3(self) -> crate::ISizeVec3 {
3✔
546
        crate::ISizeVec3::new(self.x as isize, self.y as isize, self.z as isize)
3✔
547
    }
548

549
    /// Casts all elements of `self` to `usize`.
550
    #[cfg(feature = "usize")]
551
    #[inline]
552
    #[must_use]
553
    pub fn as_usizevec3(self) -> crate::USizeVec3 {
3✔
554
        crate::USizeVec3::new(self.x as usize, self.y as usize, self.z as usize)
3✔
555
    }
556

557
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
558
    ///
559
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
560
    #[inline]
561
    #[must_use]
562
    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
3✔
563
        let x = match self.x.checked_add(rhs.x) {
3✔
564
            Some(v) => v,
3✔
565
            None => return None,
3✔
566
        };
567
        let y = match self.y.checked_add(rhs.y) {
3✔
568
            Some(v) => v,
3✔
569
            None => return None,
3✔
570
        };
571
        let z = match self.z.checked_add(rhs.z) {
3✔
572
            Some(v) => v,
3✔
573
            None => return None,
3✔
574
        };
575

576
        Some(Self { x, y, z })
3✔
577
    }
578

579
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
580
    ///
581
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
582
    #[inline]
583
    #[must_use]
584
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
585
        let x = match self.x.checked_sub(rhs.x) {
3✔
586
            Some(v) => v,
3✔
587
            None => return None,
3✔
588
        };
589
        let y = match self.y.checked_sub(rhs.y) {
3✔
590
            Some(v) => v,
3✔
591
            None => return None,
3✔
592
        };
593
        let z = match self.z.checked_sub(rhs.z) {
3✔
594
            Some(v) => v,
3✔
595
            None => return None,
3✔
596
        };
597

598
        Some(Self { x, y, z })
3✔
599
    }
600

601
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
602
    ///
603
    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
604
    #[inline]
605
    #[must_use]
606
    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
3✔
607
        let x = match self.x.checked_mul(rhs.x) {
3✔
608
            Some(v) => v,
3✔
609
            None => return None,
3✔
610
        };
611
        let y = match self.y.checked_mul(rhs.y) {
3✔
612
            Some(v) => v,
3✔
613
            None => return None,
×
614
        };
615
        let z = match self.z.checked_mul(rhs.z) {
3✔
616
            Some(v) => v,
3✔
617
            None => return None,
×
618
        };
619

620
        Some(Self { x, y, z })
3✔
621
    }
622

623
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
624
    ///
625
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
626
    #[inline]
627
    #[must_use]
628
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
629
        let x = match self.x.checked_div(rhs.x) {
3✔
630
            Some(v) => v,
3✔
631
            None => return None,
3✔
632
        };
633
        let y = match self.y.checked_div(rhs.y) {
3✔
634
            Some(v) => v,
3✔
635
            None => return None,
3✔
636
        };
637
        let z = match self.z.checked_div(rhs.z) {
3✔
638
            Some(v) => v,
3✔
639
            None => return None,
×
640
        };
641

642
        Some(Self { x, y, z })
3✔
643
    }
644

645
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
646
    ///
647
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
648
    #[inline]
649
    #[must_use]
650
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
651
        Self {
652
            x: self.x.wrapping_add(rhs.x),
3✔
653
            y: self.y.wrapping_add(rhs.y),
3✔
654
            z: self.z.wrapping_add(rhs.z),
3✔
655
        }
656
    }
657

658
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
659
    ///
660
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
661
    #[inline]
662
    #[must_use]
663
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
664
        Self {
665
            x: self.x.wrapping_sub(rhs.x),
3✔
666
            y: self.y.wrapping_sub(rhs.y),
3✔
667
            z: self.z.wrapping_sub(rhs.z),
3✔
668
        }
669
    }
670

671
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
672
    ///
673
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
674
    #[inline]
675
    #[must_use]
676
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
677
        Self {
678
            x: self.x.wrapping_mul(rhs.x),
3✔
679
            y: self.y.wrapping_mul(rhs.y),
3✔
680
            z: self.z.wrapping_mul(rhs.z),
3✔
681
        }
682
    }
683

684
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
685
    ///
686
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
687
    #[inline]
688
    #[must_use]
689
    pub const fn wrapping_div(self, rhs: Self) -> Self {
3✔
690
        Self {
691
            x: self.x.wrapping_div(rhs.x),
3✔
692
            y: self.y.wrapping_div(rhs.y),
3✔
693
            z: self.z.wrapping_div(rhs.z),
3✔
694
        }
695
    }
696

697
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
698
    ///
699
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
700
    #[inline]
701
    #[must_use]
702
    pub const fn saturating_add(self, rhs: Self) -> Self {
3✔
703
        Self {
704
            x: self.x.saturating_add(rhs.x),
3✔
705
            y: self.y.saturating_add(rhs.y),
3✔
706
            z: self.z.saturating_add(rhs.z),
3✔
707
        }
708
    }
709

710
    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
711
    ///
712
    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
713
    #[inline]
714
    #[must_use]
715
    pub const fn saturating_sub(self, rhs: Self) -> Self {
3✔
716
        Self {
717
            x: self.x.saturating_sub(rhs.x),
3✔
718
            y: self.y.saturating_sub(rhs.y),
3✔
719
            z: self.z.saturating_sub(rhs.z),
3✔
720
        }
721
    }
722

723
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
724
    ///
725
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
726
    #[inline]
727
    #[must_use]
728
    pub const fn saturating_mul(self, rhs: Self) -> Self {
3✔
729
        Self {
730
            x: self.x.saturating_mul(rhs.x),
3✔
731
            y: self.y.saturating_mul(rhs.y),
3✔
732
            z: self.z.saturating_mul(rhs.z),
3✔
733
        }
734
    }
735

736
    /// Returns a vector containing the saturating division of `self` and `rhs`.
737
    ///
738
    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
739
    #[inline]
740
    #[must_use]
741
    pub const fn saturating_div(self, rhs: Self) -> Self {
3✔
742
        Self {
743
            x: self.x.saturating_div(rhs.x),
3✔
744
            y: self.y.saturating_div(rhs.y),
3✔
745
            z: self.z.saturating_div(rhs.z),
3✔
746
        }
747
    }
748

749
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
750
    ///
751
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
752

753
    #[cfg(feature = "i32")]
754
    #[inline]
755
    #[must_use]
756
    pub const fn checked_add_signed(self, rhs: IVec3) -> Option<Self> {
3✔
757
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
758
            Some(v) => v,
3✔
759
            None => return None,
3✔
760
        };
761
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
762
            Some(v) => v,
3✔
763
            None => return None,
×
764
        };
765
        let z = match self.z.checked_add_signed(rhs.z) {
3✔
766
            Some(v) => v,
3✔
767
            None => return None,
×
768
        };
769

770
        Some(Self { x, y, z })
3✔
771
    }
772

773
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
774
    ///
775
    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
776

777
    #[cfg(feature = "i32")]
778
    #[inline]
779
    #[must_use]
780
    pub const fn wrapping_add_signed(self, rhs: IVec3) -> Self {
3✔
781
        Self {
782
            x: self.x.wrapping_add_signed(rhs.x),
3✔
783
            y: self.y.wrapping_add_signed(rhs.y),
3✔
784
            z: self.z.wrapping_add_signed(rhs.z),
3✔
785
        }
786
    }
787

788
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
789
    ///
790
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
791

792
    #[cfg(feature = "i32")]
793
    #[inline]
794
    #[must_use]
795
    pub const fn saturating_add_signed(self, rhs: IVec3) -> Self {
3✔
796
        Self {
797
            x: self.x.saturating_add_signed(rhs.x),
3✔
798
            y: self.y.saturating_add_signed(rhs.y),
3✔
799
            z: self.z.saturating_add_signed(rhs.z),
3✔
800
        }
801
    }
802
}
803

804
impl Default for UVec3 {
805
    #[inline(always)]
806
    fn default() -> Self {
6✔
807
        Self::ZERO
6✔
808
    }
809
}
810

811
impl Div for UVec3 {
812
    type Output = Self;
813
    #[inline]
814
    fn div(self, rhs: Self) -> Self {
3✔
815
        Self {
816
            x: self.x.div(rhs.x),
3✔
817
            y: self.y.div(rhs.y),
3✔
818
            z: self.z.div(rhs.z),
3✔
819
        }
820
    }
821
}
822

823
impl Div<&Self> for UVec3 {
824
    type Output = Self;
825
    #[inline]
826
    fn div(self, rhs: &Self) -> Self {
3✔
827
        self.div(*rhs)
3✔
828
    }
829
}
830

831
impl Div<&UVec3> for &UVec3 {
832
    type Output = UVec3;
833
    #[inline]
834
    fn div(self, rhs: &UVec3) -> UVec3 {
3✔
835
        (*self).div(*rhs)
3✔
836
    }
837
}
838

839
impl Div<UVec3> for &UVec3 {
840
    type Output = UVec3;
841
    #[inline]
842
    fn div(self, rhs: UVec3) -> UVec3 {
3✔
843
        (*self).div(rhs)
3✔
844
    }
845
}
846

847
impl DivAssign for UVec3 {
848
    #[inline]
849
    fn div_assign(&mut self, rhs: Self) {
3✔
850
        self.x.div_assign(rhs.x);
3✔
851
        self.y.div_assign(rhs.y);
3✔
852
        self.z.div_assign(rhs.z);
3✔
853
    }
854
}
855

856
impl DivAssign<&Self> for UVec3 {
857
    #[inline]
858
    fn div_assign(&mut self, rhs: &Self) {
3✔
859
        self.div_assign(*rhs);
3✔
860
    }
861
}
862

863
impl Div<u32> for UVec3 {
864
    type Output = Self;
865
    #[inline]
866
    fn div(self, rhs: u32) -> Self {
6✔
867
        Self {
868
            x: self.x.div(rhs),
6✔
869
            y: self.y.div(rhs),
6✔
870
            z: self.z.div(rhs),
6✔
871
        }
872
    }
873
}
874

875
impl Div<&u32> for UVec3 {
876
    type Output = Self;
877
    #[inline]
878
    fn div(self, rhs: &u32) -> Self {
3✔
879
        self.div(*rhs)
3✔
880
    }
881
}
882

883
impl Div<&u32> for &UVec3 {
884
    type Output = UVec3;
885
    #[inline]
886
    fn div(self, rhs: &u32) -> UVec3 {
3✔
887
        (*self).div(*rhs)
3✔
888
    }
889
}
890

891
impl Div<u32> for &UVec3 {
892
    type Output = UVec3;
893
    #[inline]
894
    fn div(self, rhs: u32) -> UVec3 {
3✔
895
        (*self).div(rhs)
3✔
896
    }
897
}
898

899
impl DivAssign<u32> for UVec3 {
900
    #[inline]
901
    fn div_assign(&mut self, rhs: u32) {
3✔
902
        self.x.div_assign(rhs);
3✔
903
        self.y.div_assign(rhs);
4✔
904
        self.z.div_assign(rhs);
4✔
905
    }
906
}
907

908
impl DivAssign<&u32> for UVec3 {
909
    #[inline]
910
    fn div_assign(&mut self, rhs: &u32) {
3✔
911
        self.div_assign(*rhs);
3✔
912
    }
913
}
914

915
impl Div<UVec3> for u32 {
916
    type Output = UVec3;
917
    #[inline]
918
    fn div(self, rhs: UVec3) -> UVec3 {
3✔
919
        UVec3 {
920
            x: self.div(rhs.x),
3✔
921
            y: self.div(rhs.y),
3✔
922
            z: self.div(rhs.z),
3✔
923
        }
924
    }
925
}
926

927
impl Div<&UVec3> for u32 {
928
    type Output = UVec3;
929
    #[inline]
930
    fn div(self, rhs: &UVec3) -> UVec3 {
3✔
931
        self.div(*rhs)
3✔
932
    }
933
}
934

935
impl Div<&UVec3> for &u32 {
936
    type Output = UVec3;
937
    #[inline]
938
    fn div(self, rhs: &UVec3) -> UVec3 {
3✔
939
        (*self).div(*rhs)
3✔
940
    }
941
}
942

943
impl Div<UVec3> for &u32 {
944
    type Output = UVec3;
945
    #[inline]
946
    fn div(self, rhs: UVec3) -> UVec3 {
3✔
947
        (*self).div(rhs)
3✔
948
    }
949
}
950

951
impl Mul for UVec3 {
952
    type Output = Self;
953
    #[inline]
954
    fn mul(self, rhs: Self) -> Self {
3✔
955
        Self {
956
            x: self.x.mul(rhs.x),
3✔
957
            y: self.y.mul(rhs.y),
3✔
958
            z: self.z.mul(rhs.z),
3✔
959
        }
960
    }
961
}
962

963
impl Mul<&Self> for UVec3 {
964
    type Output = Self;
965
    #[inline]
966
    fn mul(self, rhs: &Self) -> Self {
3✔
967
        self.mul(*rhs)
3✔
968
    }
969
}
970

971
impl Mul<&UVec3> for &UVec3 {
972
    type Output = UVec3;
973
    #[inline]
974
    fn mul(self, rhs: &UVec3) -> UVec3 {
3✔
975
        (*self).mul(*rhs)
3✔
976
    }
977
}
978

979
impl Mul<UVec3> for &UVec3 {
980
    type Output = UVec3;
981
    #[inline]
982
    fn mul(self, rhs: UVec3) -> UVec3 {
3✔
983
        (*self).mul(rhs)
3✔
984
    }
985
}
986

987
impl MulAssign for UVec3 {
988
    #[inline]
989
    fn mul_assign(&mut self, rhs: Self) {
3✔
990
        self.x.mul_assign(rhs.x);
3✔
991
        self.y.mul_assign(rhs.y);
4✔
992
        self.z.mul_assign(rhs.z);
3✔
993
    }
994
}
995

996
impl MulAssign<&Self> for UVec3 {
997
    #[inline]
998
    fn mul_assign(&mut self, rhs: &Self) {
3✔
999
        self.mul_assign(*rhs);
3✔
1000
    }
1001
}
1002

1003
impl Mul<u32> for UVec3 {
1004
    type Output = Self;
1005
    #[inline]
1006
    fn mul(self, rhs: u32) -> Self {
3✔
1007
        Self {
1008
            x: self.x.mul(rhs),
3✔
1009
            y: self.y.mul(rhs),
3✔
1010
            z: self.z.mul(rhs),
3✔
1011
        }
1012
    }
1013
}
1014

1015
impl Mul<&u32> for UVec3 {
1016
    type Output = Self;
1017
    #[inline]
1018
    fn mul(self, rhs: &u32) -> Self {
3✔
1019
        self.mul(*rhs)
3✔
1020
    }
1021
}
1022

1023
impl Mul<&u32> for &UVec3 {
1024
    type Output = UVec3;
1025
    #[inline]
1026
    fn mul(self, rhs: &u32) -> UVec3 {
3✔
1027
        (*self).mul(*rhs)
3✔
1028
    }
1029
}
1030

1031
impl Mul<u32> for &UVec3 {
1032
    type Output = UVec3;
1033
    #[inline]
1034
    fn mul(self, rhs: u32) -> UVec3 {
3✔
1035
        (*self).mul(rhs)
3✔
1036
    }
1037
}
1038

1039
impl MulAssign<u32> for UVec3 {
1040
    #[inline]
1041
    fn mul_assign(&mut self, rhs: u32) {
3✔
1042
        self.x.mul_assign(rhs);
3✔
1043
        self.y.mul_assign(rhs);
4✔
1044
        self.z.mul_assign(rhs);
4✔
1045
    }
1046
}
1047

1048
impl MulAssign<&u32> for UVec3 {
1049
    #[inline]
1050
    fn mul_assign(&mut self, rhs: &u32) {
3✔
1051
        self.mul_assign(*rhs);
3✔
1052
    }
1053
}
1054

1055
impl Mul<UVec3> for u32 {
1056
    type Output = UVec3;
1057
    #[inline]
1058
    fn mul(self, rhs: UVec3) -> UVec3 {
3✔
1059
        UVec3 {
1060
            x: self.mul(rhs.x),
3✔
1061
            y: self.mul(rhs.y),
3✔
1062
            z: self.mul(rhs.z),
3✔
1063
        }
1064
    }
1065
}
1066

1067
impl Mul<&UVec3> for u32 {
1068
    type Output = UVec3;
1069
    #[inline]
1070
    fn mul(self, rhs: &UVec3) -> UVec3 {
3✔
1071
        self.mul(*rhs)
3✔
1072
    }
1073
}
1074

1075
impl Mul<&UVec3> for &u32 {
1076
    type Output = UVec3;
1077
    #[inline]
1078
    fn mul(self, rhs: &UVec3) -> UVec3 {
3✔
1079
        (*self).mul(*rhs)
3✔
1080
    }
1081
}
1082

1083
impl Mul<UVec3> for &u32 {
1084
    type Output = UVec3;
1085
    #[inline]
1086
    fn mul(self, rhs: UVec3) -> UVec3 {
3✔
1087
        (*self).mul(rhs)
3✔
1088
    }
1089
}
1090

1091
impl Add for UVec3 {
1092
    type Output = Self;
1093
    #[inline]
1094
    fn add(self, rhs: Self) -> Self {
3✔
1095
        Self {
1096
            x: self.x.add(rhs.x),
3✔
1097
            y: self.y.add(rhs.y),
4✔
1098
            z: self.z.add(rhs.z),
5✔
1099
        }
1100
    }
1101
}
1102

1103
impl Add<&Self> for UVec3 {
1104
    type Output = Self;
1105
    #[inline]
1106
    fn add(self, rhs: &Self) -> Self {
3✔
1107
        self.add(*rhs)
3✔
1108
    }
1109
}
1110

1111
impl Add<&UVec3> for &UVec3 {
1112
    type Output = UVec3;
1113
    #[inline]
1114
    fn add(self, rhs: &UVec3) -> UVec3 {
3✔
1115
        (*self).add(*rhs)
3✔
1116
    }
1117
}
1118

1119
impl Add<UVec3> for &UVec3 {
1120
    type Output = UVec3;
1121
    #[inline]
1122
    fn add(self, rhs: UVec3) -> UVec3 {
3✔
1123
        (*self).add(rhs)
3✔
1124
    }
1125
}
1126

1127
impl AddAssign for UVec3 {
1128
    #[inline]
1129
    fn add_assign(&mut self, rhs: Self) {
3✔
1130
        self.x.add_assign(rhs.x);
3✔
1131
        self.y.add_assign(rhs.y);
4✔
1132
        self.z.add_assign(rhs.z);
4✔
1133
    }
1134
}
1135

1136
impl AddAssign<&Self> for UVec3 {
1137
    #[inline]
1138
    fn add_assign(&mut self, rhs: &Self) {
3✔
1139
        self.add_assign(*rhs);
3✔
1140
    }
1141
}
1142

1143
impl Add<u32> for UVec3 {
1144
    type Output = Self;
1145
    #[inline]
1146
    fn add(self, rhs: u32) -> Self {
3✔
1147
        Self {
1148
            x: self.x.add(rhs),
3✔
1149
            y: self.y.add(rhs),
3✔
1150
            z: self.z.add(rhs),
3✔
1151
        }
1152
    }
1153
}
1154

1155
impl Add<&u32> for UVec3 {
1156
    type Output = Self;
1157
    #[inline]
1158
    fn add(self, rhs: &u32) -> Self {
3✔
1159
        self.add(*rhs)
3✔
1160
    }
1161
}
1162

1163
impl Add<&u32> for &UVec3 {
1164
    type Output = UVec3;
1165
    #[inline]
1166
    fn add(self, rhs: &u32) -> UVec3 {
3✔
1167
        (*self).add(*rhs)
3✔
1168
    }
1169
}
1170

1171
impl Add<u32> for &UVec3 {
1172
    type Output = UVec3;
1173
    #[inline]
1174
    fn add(self, rhs: u32) -> UVec3 {
3✔
1175
        (*self).add(rhs)
3✔
1176
    }
1177
}
1178

1179
impl AddAssign<u32> for UVec3 {
1180
    #[inline]
1181
    fn add_assign(&mut self, rhs: u32) {
3✔
1182
        self.x.add_assign(rhs);
3✔
1183
        self.y.add_assign(rhs);
3✔
1184
        self.z.add_assign(rhs);
3✔
1185
    }
1186
}
1187

1188
impl AddAssign<&u32> for UVec3 {
1189
    #[inline]
1190
    fn add_assign(&mut self, rhs: &u32) {
3✔
1191
        self.add_assign(*rhs);
3✔
1192
    }
1193
}
1194

1195
impl Add<UVec3> for u32 {
1196
    type Output = UVec3;
1197
    #[inline]
1198
    fn add(self, rhs: UVec3) -> UVec3 {
3✔
1199
        UVec3 {
1200
            x: self.add(rhs.x),
3✔
1201
            y: self.add(rhs.y),
3✔
1202
            z: self.add(rhs.z),
3✔
1203
        }
1204
    }
1205
}
1206

1207
impl Add<&UVec3> for u32 {
1208
    type Output = UVec3;
1209
    #[inline]
1210
    fn add(self, rhs: &UVec3) -> UVec3 {
3✔
1211
        self.add(*rhs)
3✔
1212
    }
1213
}
1214

1215
impl Add<&UVec3> for &u32 {
1216
    type Output = UVec3;
1217
    #[inline]
1218
    fn add(self, rhs: &UVec3) -> UVec3 {
3✔
1219
        (*self).add(*rhs)
3✔
1220
    }
1221
}
1222

1223
impl Add<UVec3> for &u32 {
1224
    type Output = UVec3;
1225
    #[inline]
1226
    fn add(self, rhs: UVec3) -> UVec3 {
3✔
1227
        (*self).add(rhs)
3✔
1228
    }
1229
}
1230

1231
impl Sub for UVec3 {
1232
    type Output = Self;
1233
    #[inline]
1234
    fn sub(self, rhs: Self) -> Self {
3✔
1235
        Self {
1236
            x: self.x.sub(rhs.x),
3✔
1237
            y: self.y.sub(rhs.y),
3✔
1238
            z: self.z.sub(rhs.z),
3✔
1239
        }
1240
    }
1241
}
1242

1243
impl Sub<&Self> for UVec3 {
1244
    type Output = Self;
1245
    #[inline]
1246
    fn sub(self, rhs: &Self) -> Self {
3✔
1247
        self.sub(*rhs)
3✔
1248
    }
1249
}
1250

1251
impl Sub<&UVec3> for &UVec3 {
1252
    type Output = UVec3;
1253
    #[inline]
1254
    fn sub(self, rhs: &UVec3) -> UVec3 {
3✔
1255
        (*self).sub(*rhs)
3✔
1256
    }
1257
}
1258

1259
impl Sub<UVec3> for &UVec3 {
1260
    type Output = UVec3;
1261
    #[inline]
1262
    fn sub(self, rhs: UVec3) -> UVec3 {
3✔
1263
        (*self).sub(rhs)
3✔
1264
    }
1265
}
1266

1267
impl SubAssign for UVec3 {
1268
    #[inline]
1269
    fn sub_assign(&mut self, rhs: Self) {
3✔
1270
        self.x.sub_assign(rhs.x);
3✔
1271
        self.y.sub_assign(rhs.y);
4✔
1272
        self.z.sub_assign(rhs.z);
4✔
1273
    }
1274
}
1275

1276
impl SubAssign<&Self> for UVec3 {
1277
    #[inline]
1278
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1279
        self.sub_assign(*rhs);
3✔
1280
    }
1281
}
1282

1283
impl Sub<u32> for UVec3 {
1284
    type Output = Self;
1285
    #[inline]
1286
    fn sub(self, rhs: u32) -> Self {
3✔
1287
        Self {
1288
            x: self.x.sub(rhs),
3✔
1289
            y: self.y.sub(rhs),
3✔
1290
            z: self.z.sub(rhs),
3✔
1291
        }
1292
    }
1293
}
1294

1295
impl Sub<&u32> for UVec3 {
1296
    type Output = Self;
1297
    #[inline]
1298
    fn sub(self, rhs: &u32) -> Self {
3✔
1299
        self.sub(*rhs)
3✔
1300
    }
1301
}
1302

1303
impl Sub<&u32> for &UVec3 {
1304
    type Output = UVec3;
1305
    #[inline]
1306
    fn sub(self, rhs: &u32) -> UVec3 {
3✔
1307
        (*self).sub(*rhs)
3✔
1308
    }
1309
}
1310

1311
impl Sub<u32> for &UVec3 {
1312
    type Output = UVec3;
1313
    #[inline]
1314
    fn sub(self, rhs: u32) -> UVec3 {
3✔
1315
        (*self).sub(rhs)
3✔
1316
    }
1317
}
1318

1319
impl SubAssign<u32> for UVec3 {
1320
    #[inline]
1321
    fn sub_assign(&mut self, rhs: u32) {
3✔
1322
        self.x.sub_assign(rhs);
3✔
1323
        self.y.sub_assign(rhs);
4✔
1324
        self.z.sub_assign(rhs);
4✔
1325
    }
1326
}
1327

1328
impl SubAssign<&u32> for UVec3 {
1329
    #[inline]
1330
    fn sub_assign(&mut self, rhs: &u32) {
3✔
1331
        self.sub_assign(*rhs);
3✔
1332
    }
1333
}
1334

1335
impl Sub<UVec3> for u32 {
1336
    type Output = UVec3;
1337
    #[inline]
1338
    fn sub(self, rhs: UVec3) -> UVec3 {
3✔
1339
        UVec3 {
1340
            x: self.sub(rhs.x),
3✔
1341
            y: self.sub(rhs.y),
3✔
1342
            z: self.sub(rhs.z),
3✔
1343
        }
1344
    }
1345
}
1346

1347
impl Sub<&UVec3> for u32 {
1348
    type Output = UVec3;
1349
    #[inline]
1350
    fn sub(self, rhs: &UVec3) -> UVec3 {
3✔
1351
        self.sub(*rhs)
3✔
1352
    }
1353
}
1354

1355
impl Sub<&UVec3> for &u32 {
1356
    type Output = UVec3;
1357
    #[inline]
1358
    fn sub(self, rhs: &UVec3) -> UVec3 {
3✔
1359
        (*self).sub(*rhs)
3✔
1360
    }
1361
}
1362

1363
impl Sub<UVec3> for &u32 {
1364
    type Output = UVec3;
1365
    #[inline]
1366
    fn sub(self, rhs: UVec3) -> UVec3 {
3✔
1367
        (*self).sub(rhs)
3✔
1368
    }
1369
}
1370

1371
impl Rem for UVec3 {
1372
    type Output = Self;
1373
    #[inline]
1374
    fn rem(self, rhs: Self) -> Self {
3✔
1375
        Self {
1376
            x: self.x.rem(rhs.x),
3✔
1377
            y: self.y.rem(rhs.y),
3✔
1378
            z: self.z.rem(rhs.z),
3✔
1379
        }
1380
    }
1381
}
1382

1383
impl Rem<&Self> for UVec3 {
1384
    type Output = Self;
1385
    #[inline]
1386
    fn rem(self, rhs: &Self) -> Self {
3✔
1387
        self.rem(*rhs)
3✔
1388
    }
1389
}
1390

1391
impl Rem<&UVec3> for &UVec3 {
1392
    type Output = UVec3;
1393
    #[inline]
1394
    fn rem(self, rhs: &UVec3) -> UVec3 {
3✔
1395
        (*self).rem(*rhs)
3✔
1396
    }
1397
}
1398

1399
impl Rem<UVec3> for &UVec3 {
1400
    type Output = UVec3;
1401
    #[inline]
1402
    fn rem(self, rhs: UVec3) -> UVec3 {
3✔
1403
        (*self).rem(rhs)
3✔
1404
    }
1405
}
1406

1407
impl RemAssign for UVec3 {
1408
    #[inline]
1409
    fn rem_assign(&mut self, rhs: Self) {
3✔
1410
        self.x.rem_assign(rhs.x);
3✔
1411
        self.y.rem_assign(rhs.y);
4✔
1412
        self.z.rem_assign(rhs.z);
3✔
1413
    }
1414
}
1415

1416
impl RemAssign<&Self> for UVec3 {
1417
    #[inline]
1418
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1419
        self.rem_assign(*rhs);
3✔
1420
    }
1421
}
1422

1423
impl Rem<u32> for UVec3 {
1424
    type Output = Self;
1425
    #[inline]
1426
    fn rem(self, rhs: u32) -> Self {
3✔
1427
        Self {
1428
            x: self.x.rem(rhs),
3✔
1429
            y: self.y.rem(rhs),
3✔
1430
            z: self.z.rem(rhs),
3✔
1431
        }
1432
    }
1433
}
1434

1435
impl Rem<&u32> for UVec3 {
1436
    type Output = Self;
1437
    #[inline]
1438
    fn rem(self, rhs: &u32) -> Self {
3✔
1439
        self.rem(*rhs)
3✔
1440
    }
1441
}
1442

1443
impl Rem<&u32> for &UVec3 {
1444
    type Output = UVec3;
1445
    #[inline]
1446
    fn rem(self, rhs: &u32) -> UVec3 {
3✔
1447
        (*self).rem(*rhs)
3✔
1448
    }
1449
}
1450

1451
impl Rem<u32> for &UVec3 {
1452
    type Output = UVec3;
1453
    #[inline]
1454
    fn rem(self, rhs: u32) -> UVec3 {
3✔
1455
        (*self).rem(rhs)
3✔
1456
    }
1457
}
1458

1459
impl RemAssign<u32> for UVec3 {
1460
    #[inline]
1461
    fn rem_assign(&mut self, rhs: u32) {
3✔
1462
        self.x.rem_assign(rhs);
3✔
1463
        self.y.rem_assign(rhs);
4✔
1464
        self.z.rem_assign(rhs);
4✔
1465
    }
1466
}
1467

1468
impl RemAssign<&u32> for UVec3 {
1469
    #[inline]
1470
    fn rem_assign(&mut self, rhs: &u32) {
3✔
1471
        self.rem_assign(*rhs);
3✔
1472
    }
1473
}
1474

1475
impl Rem<UVec3> for u32 {
1476
    type Output = UVec3;
1477
    #[inline]
1478
    fn rem(self, rhs: UVec3) -> UVec3 {
3✔
1479
        UVec3 {
1480
            x: self.rem(rhs.x),
3✔
1481
            y: self.rem(rhs.y),
3✔
1482
            z: self.rem(rhs.z),
3✔
1483
        }
1484
    }
1485
}
1486

1487
impl Rem<&UVec3> for u32 {
1488
    type Output = UVec3;
1489
    #[inline]
1490
    fn rem(self, rhs: &UVec3) -> UVec3 {
3✔
1491
        self.rem(*rhs)
3✔
1492
    }
1493
}
1494

1495
impl Rem<&UVec3> for &u32 {
1496
    type Output = UVec3;
1497
    #[inline]
1498
    fn rem(self, rhs: &UVec3) -> UVec3 {
3✔
1499
        (*self).rem(*rhs)
3✔
1500
    }
1501
}
1502

1503
impl Rem<UVec3> for &u32 {
1504
    type Output = UVec3;
1505
    #[inline]
1506
    fn rem(self, rhs: UVec3) -> UVec3 {
3✔
1507
        (*self).rem(rhs)
3✔
1508
    }
1509
}
1510

1511
impl AsRef<[u32; 3]> for UVec3 {
1512
    #[inline]
1513
    fn as_ref(&self) -> &[u32; 3] {
3✔
1514
        unsafe { &*(self as *const Self as *const [u32; 3]) }
3✔
1515
    }
1516
}
1517

1518
impl AsMut<[u32; 3]> for UVec3 {
1519
    #[inline]
1520
    fn as_mut(&mut self) -> &mut [u32; 3] {
3✔
1521
        unsafe { &mut *(self as *mut Self as *mut [u32; 3]) }
3✔
1522
    }
1523
}
1524

1525
impl Sum for UVec3 {
1526
    #[inline]
1527
    fn sum<I>(iter: I) -> Self
3✔
1528
    where
1529
        I: Iterator<Item = Self>,
1530
    {
1531
        iter.fold(Self::ZERO, Self::add)
3✔
1532
    }
1533
}
1534

1535
impl<'a> Sum<&'a Self> for UVec3 {
1536
    #[inline]
1537
    fn sum<I>(iter: I) -> Self
3✔
1538
    where
1539
        I: Iterator<Item = &'a Self>,
1540
    {
1541
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1542
    }
1543
}
1544

1545
impl Product for UVec3 {
1546
    #[inline]
1547
    fn product<I>(iter: I) -> Self
3✔
1548
    where
1549
        I: Iterator<Item = Self>,
1550
    {
1551
        iter.fold(Self::ONE, Self::mul)
3✔
1552
    }
1553
}
1554

1555
impl<'a> Product<&'a Self> for UVec3 {
1556
    #[inline]
1557
    fn product<I>(iter: I) -> Self
3✔
1558
    where
1559
        I: Iterator<Item = &'a Self>,
1560
    {
1561
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1562
    }
1563
}
1564

1565
impl Not for UVec3 {
1566
    type Output = Self;
1567
    #[inline]
1568
    fn not(self) -> Self {
3✔
1569
        Self {
1570
            x: self.x.not(),
3✔
1571
            y: self.y.not(),
3✔
1572
            z: self.z.not(),
3✔
1573
        }
1574
    }
1575
}
1576

1577
impl Not for &UVec3 {
1578
    type Output = UVec3;
1579
    #[inline]
1580
    fn not(self) -> UVec3 {
3✔
1581
        (*self).not()
3✔
1582
    }
1583
}
1584

1585
impl BitAnd for UVec3 {
1586
    type Output = Self;
1587
    #[inline]
1588
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1589
        Self {
1590
            x: self.x.bitand(rhs.x),
3✔
1591
            y: self.y.bitand(rhs.y),
3✔
1592
            z: self.z.bitand(rhs.z),
3✔
1593
        }
1594
    }
1595
}
1596

1597
impl BitAnd<&Self> for UVec3 {
1598
    type Output = Self;
1599
    #[inline]
1600
    fn bitand(self, rhs: &Self) -> Self {
3✔
1601
        self.bitand(*rhs)
3✔
1602
    }
1603
}
1604

1605
impl BitAnd<&UVec3> for &UVec3 {
1606
    type Output = UVec3;
1607
    #[inline]
1608
    fn bitand(self, rhs: &UVec3) -> UVec3 {
3✔
1609
        (*self).bitand(*rhs)
3✔
1610
    }
1611
}
1612

1613
impl BitAnd<UVec3> for &UVec3 {
1614
    type Output = UVec3;
1615
    #[inline]
1616
    fn bitand(self, rhs: UVec3) -> UVec3 {
3✔
1617
        (*self).bitand(rhs)
3✔
1618
    }
1619
}
1620

1621
impl BitAndAssign for UVec3 {
1622
    #[inline]
1623
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1624
        *self = self.bitand(rhs);
3✔
1625
    }
1626
}
1627

1628
impl BitAndAssign<&Self> for UVec3 {
1629
    #[inline]
1630
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1631
        self.bitand_assign(*rhs);
3✔
1632
    }
1633
}
1634

1635
impl BitOr for UVec3 {
1636
    type Output = Self;
1637
    #[inline]
1638
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1639
        Self {
1640
            x: self.x.bitor(rhs.x),
3✔
1641
            y: self.y.bitor(rhs.y),
3✔
1642
            z: self.z.bitor(rhs.z),
3✔
1643
        }
1644
    }
1645
}
1646

1647
impl BitOr<&Self> for UVec3 {
1648
    type Output = Self;
1649
    #[inline]
1650
    fn bitor(self, rhs: &Self) -> Self {
3✔
1651
        self.bitor(*rhs)
3✔
1652
    }
1653
}
1654

1655
impl BitOr<&UVec3> for &UVec3 {
1656
    type Output = UVec3;
1657
    #[inline]
1658
    fn bitor(self, rhs: &UVec3) -> UVec3 {
3✔
1659
        (*self).bitor(*rhs)
3✔
1660
    }
1661
}
1662

1663
impl BitOr<UVec3> for &UVec3 {
1664
    type Output = UVec3;
1665
    #[inline]
1666
    fn bitor(self, rhs: UVec3) -> UVec3 {
3✔
1667
        (*self).bitor(rhs)
3✔
1668
    }
1669
}
1670

1671
impl BitOrAssign for UVec3 {
1672
    #[inline]
1673
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1674
        *self = self.bitor(rhs);
3✔
1675
    }
1676
}
1677

1678
impl BitOrAssign<&Self> for UVec3 {
1679
    #[inline]
1680
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1681
        self.bitor_assign(*rhs);
3✔
1682
    }
1683
}
1684

1685
impl BitXor for UVec3 {
1686
    type Output = Self;
1687
    #[inline]
1688
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1689
        Self {
1690
            x: self.x.bitxor(rhs.x),
3✔
1691
            y: self.y.bitxor(rhs.y),
3✔
1692
            z: self.z.bitxor(rhs.z),
3✔
1693
        }
1694
    }
1695
}
1696

1697
impl BitXor<&Self> for UVec3 {
1698
    type Output = Self;
1699
    #[inline]
1700
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1701
        self.bitxor(*rhs)
3✔
1702
    }
1703
}
1704

1705
impl BitXor<&UVec3> for &UVec3 {
1706
    type Output = UVec3;
1707
    #[inline]
1708
    fn bitxor(self, rhs: &UVec3) -> UVec3 {
3✔
1709
        (*self).bitxor(*rhs)
3✔
1710
    }
1711
}
1712

1713
impl BitXor<UVec3> for &UVec3 {
1714
    type Output = UVec3;
1715
    #[inline]
1716
    fn bitxor(self, rhs: UVec3) -> UVec3 {
3✔
1717
        (*self).bitxor(rhs)
3✔
1718
    }
1719
}
1720

1721
impl BitXorAssign for UVec3 {
1722
    #[inline]
1723
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1724
        *self = self.bitxor(rhs);
3✔
1725
    }
1726
}
1727

1728
impl BitXorAssign<&Self> for UVec3 {
1729
    #[inline]
1730
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1731
        self.bitxor_assign(*rhs);
3✔
1732
    }
1733
}
1734

1735
impl BitAnd<u32> for UVec3 {
1736
    type Output = Self;
1737
    #[inline]
1738
    fn bitand(self, rhs: u32) -> Self::Output {
3✔
1739
        Self {
1740
            x: self.x.bitand(rhs),
3✔
1741
            y: self.y.bitand(rhs),
3✔
1742
            z: self.z.bitand(rhs),
3✔
1743
        }
1744
    }
1745
}
1746

1747
impl BitAnd<&u32> for UVec3 {
1748
    type Output = Self;
1749
    #[inline]
1750
    fn bitand(self, rhs: &u32) -> Self {
3✔
1751
        self.bitand(*rhs)
3✔
1752
    }
1753
}
1754

1755
impl BitAnd<&u32> for &UVec3 {
1756
    type Output = UVec3;
1757
    #[inline]
1758
    fn bitand(self, rhs: &u32) -> UVec3 {
3✔
1759
        (*self).bitand(*rhs)
3✔
1760
    }
1761
}
1762

1763
impl BitAnd<u32> for &UVec3 {
1764
    type Output = UVec3;
1765
    #[inline]
1766
    fn bitand(self, rhs: u32) -> UVec3 {
3✔
1767
        (*self).bitand(rhs)
3✔
1768
    }
1769
}
1770

1771
impl BitAndAssign<u32> for UVec3 {
1772
    #[inline]
1773
    fn bitand_assign(&mut self, rhs: u32) {
3✔
1774
        *self = self.bitand(rhs);
3✔
1775
    }
1776
}
1777

1778
impl BitAndAssign<&u32> for UVec3 {
1779
    #[inline]
1780
    fn bitand_assign(&mut self, rhs: &u32) {
3✔
1781
        self.bitand_assign(*rhs);
3✔
1782
    }
1783
}
1784

1785
impl BitOr<u32> for UVec3 {
1786
    type Output = Self;
1787
    #[inline]
1788
    fn bitor(self, rhs: u32) -> Self::Output {
3✔
1789
        Self {
1790
            x: self.x.bitor(rhs),
3✔
1791
            y: self.y.bitor(rhs),
3✔
1792
            z: self.z.bitor(rhs),
3✔
1793
        }
1794
    }
1795
}
1796

1797
impl BitOr<&u32> for UVec3 {
1798
    type Output = Self;
1799
    #[inline]
1800
    fn bitor(self, rhs: &u32) -> Self {
3✔
1801
        self.bitor(*rhs)
3✔
1802
    }
1803
}
1804

1805
impl BitOr<&u32> for &UVec3 {
1806
    type Output = UVec3;
1807
    #[inline]
1808
    fn bitor(self, rhs: &u32) -> UVec3 {
3✔
1809
        (*self).bitor(*rhs)
3✔
1810
    }
1811
}
1812

1813
impl BitOr<u32> for &UVec3 {
1814
    type Output = UVec3;
1815
    #[inline]
1816
    fn bitor(self, rhs: u32) -> UVec3 {
3✔
1817
        (*self).bitor(rhs)
3✔
1818
    }
1819
}
1820

1821
impl BitOrAssign<u32> for UVec3 {
1822
    #[inline]
1823
    fn bitor_assign(&mut self, rhs: u32) {
3✔
1824
        *self = self.bitor(rhs);
3✔
1825
    }
1826
}
1827

1828
impl BitOrAssign<&u32> for UVec3 {
1829
    #[inline]
1830
    fn bitor_assign(&mut self, rhs: &u32) {
3✔
1831
        self.bitor_assign(*rhs);
3✔
1832
    }
1833
}
1834

1835
impl BitXor<u32> for UVec3 {
1836
    type Output = Self;
1837
    #[inline]
1838
    fn bitxor(self, rhs: u32) -> Self::Output {
3✔
1839
        Self {
1840
            x: self.x.bitxor(rhs),
3✔
1841
            y: self.y.bitxor(rhs),
3✔
1842
            z: self.z.bitxor(rhs),
3✔
1843
        }
1844
    }
1845
}
1846

1847
impl BitXor<&u32> for UVec3 {
1848
    type Output = Self;
1849
    #[inline]
1850
    fn bitxor(self, rhs: &u32) -> Self {
3✔
1851
        self.bitxor(*rhs)
3✔
1852
    }
1853
}
1854

1855
impl BitXor<&u32> for &UVec3 {
1856
    type Output = UVec3;
1857
    #[inline]
1858
    fn bitxor(self, rhs: &u32) -> UVec3 {
3✔
1859
        (*self).bitxor(*rhs)
3✔
1860
    }
1861
}
1862

1863
impl BitXor<u32> for &UVec3 {
1864
    type Output = UVec3;
1865
    #[inline]
1866
    fn bitxor(self, rhs: u32) -> UVec3 {
3✔
1867
        (*self).bitxor(rhs)
3✔
1868
    }
1869
}
1870

1871
impl BitXorAssign<u32> for UVec3 {
1872
    #[inline]
1873
    fn bitxor_assign(&mut self, rhs: u32) {
3✔
1874
        *self = self.bitxor(rhs);
3✔
1875
    }
1876
}
1877

1878
impl BitXorAssign<&u32> for UVec3 {
1879
    #[inline]
1880
    fn bitxor_assign(&mut self, rhs: &u32) {
3✔
1881
        self.bitxor_assign(*rhs);
3✔
1882
    }
1883
}
1884

1885
impl Shl<i8> for UVec3 {
1886
    type Output = Self;
1887
    #[inline]
1888
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1889
        Self {
1890
            x: self.x.shl(rhs),
3✔
1891
            y: self.y.shl(rhs),
3✔
1892
            z: self.z.shl(rhs),
3✔
1893
        }
1894
    }
1895
}
1896

1897
impl Shl<&i8> for UVec3 {
1898
    type Output = Self;
1899
    #[inline]
1900
    fn shl(self, rhs: &i8) -> Self {
3✔
1901
        self.shl(*rhs)
3✔
1902
    }
1903
}
1904

1905
impl Shl<&i8> for &UVec3 {
1906
    type Output = UVec3;
1907
    #[inline]
1908
    fn shl(self, rhs: &i8) -> UVec3 {
3✔
1909
        (*self).shl(*rhs)
3✔
1910
    }
1911
}
1912

1913
impl Shl<i8> for &UVec3 {
1914
    type Output = UVec3;
1915
    #[inline]
1916
    fn shl(self, rhs: i8) -> UVec3 {
3✔
1917
        (*self).shl(rhs)
3✔
1918
    }
1919
}
1920

1921
impl ShlAssign<i8> for UVec3 {
1922
    #[inline]
1923
    fn shl_assign(&mut self, rhs: i8) {
3✔
1924
        *self = self.shl(rhs);
3✔
1925
    }
1926
}
1927

1928
impl ShlAssign<&i8> for UVec3 {
1929
    #[inline]
1930
    fn shl_assign(&mut self, rhs: &i8) {
3✔
1931
        self.shl_assign(*rhs);
3✔
1932
    }
1933
}
1934

1935
impl Shr<i8> for UVec3 {
1936
    type Output = Self;
1937
    #[inline]
1938
    fn shr(self, rhs: i8) -> Self::Output {
3✔
1939
        Self {
1940
            x: self.x.shr(rhs),
3✔
1941
            y: self.y.shr(rhs),
3✔
1942
            z: self.z.shr(rhs),
3✔
1943
        }
1944
    }
1945
}
1946

1947
impl Shr<&i8> for UVec3 {
1948
    type Output = Self;
1949
    #[inline]
1950
    fn shr(self, rhs: &i8) -> Self {
3✔
1951
        self.shr(*rhs)
3✔
1952
    }
1953
}
1954

1955
impl Shr<&i8> for &UVec3 {
1956
    type Output = UVec3;
1957
    #[inline]
1958
    fn shr(self, rhs: &i8) -> UVec3 {
3✔
1959
        (*self).shr(*rhs)
3✔
1960
    }
1961
}
1962

1963
impl Shr<i8> for &UVec3 {
1964
    type Output = UVec3;
1965
    #[inline]
1966
    fn shr(self, rhs: i8) -> UVec3 {
3✔
1967
        (*self).shr(rhs)
3✔
1968
    }
1969
}
1970

1971
impl ShrAssign<i8> for UVec3 {
1972
    #[inline]
1973
    fn shr_assign(&mut self, rhs: i8) {
3✔
1974
        *self = self.shr(rhs);
3✔
1975
    }
1976
}
1977

1978
impl ShrAssign<&i8> for UVec3 {
1979
    #[inline]
1980
    fn shr_assign(&mut self, rhs: &i8) {
3✔
1981
        self.shr_assign(*rhs);
3✔
1982
    }
1983
}
1984

1985
impl Shl<i16> for UVec3 {
1986
    type Output = Self;
1987
    #[inline]
1988
    fn shl(self, rhs: i16) -> Self::Output {
3✔
1989
        Self {
1990
            x: self.x.shl(rhs),
3✔
1991
            y: self.y.shl(rhs),
3✔
1992
            z: self.z.shl(rhs),
3✔
1993
        }
1994
    }
1995
}
1996

1997
impl Shl<&i16> for UVec3 {
1998
    type Output = Self;
1999
    #[inline]
2000
    fn shl(self, rhs: &i16) -> Self {
3✔
2001
        self.shl(*rhs)
3✔
2002
    }
2003
}
2004

2005
impl Shl<&i16> for &UVec3 {
2006
    type Output = UVec3;
2007
    #[inline]
2008
    fn shl(self, rhs: &i16) -> UVec3 {
3✔
2009
        (*self).shl(*rhs)
3✔
2010
    }
2011
}
2012

2013
impl Shl<i16> for &UVec3 {
2014
    type Output = UVec3;
2015
    #[inline]
2016
    fn shl(self, rhs: i16) -> UVec3 {
3✔
2017
        (*self).shl(rhs)
3✔
2018
    }
2019
}
2020

2021
impl ShlAssign<i16> for UVec3 {
2022
    #[inline]
2023
    fn shl_assign(&mut self, rhs: i16) {
3✔
2024
        *self = self.shl(rhs);
3✔
2025
    }
2026
}
2027

2028
impl ShlAssign<&i16> for UVec3 {
2029
    #[inline]
2030
    fn shl_assign(&mut self, rhs: &i16) {
3✔
2031
        self.shl_assign(*rhs);
3✔
2032
    }
2033
}
2034

2035
impl Shr<i16> for UVec3 {
2036
    type Output = Self;
2037
    #[inline]
2038
    fn shr(self, rhs: i16) -> Self::Output {
3✔
2039
        Self {
2040
            x: self.x.shr(rhs),
3✔
2041
            y: self.y.shr(rhs),
3✔
2042
            z: self.z.shr(rhs),
3✔
2043
        }
2044
    }
2045
}
2046

2047
impl Shr<&i16> for UVec3 {
2048
    type Output = Self;
2049
    #[inline]
2050
    fn shr(self, rhs: &i16) -> Self {
3✔
2051
        self.shr(*rhs)
3✔
2052
    }
2053
}
2054

2055
impl Shr<&i16> for &UVec3 {
2056
    type Output = UVec3;
2057
    #[inline]
2058
    fn shr(self, rhs: &i16) -> UVec3 {
3✔
2059
        (*self).shr(*rhs)
3✔
2060
    }
2061
}
2062

2063
impl Shr<i16> for &UVec3 {
2064
    type Output = UVec3;
2065
    #[inline]
2066
    fn shr(self, rhs: i16) -> UVec3 {
3✔
2067
        (*self).shr(rhs)
3✔
2068
    }
2069
}
2070

2071
impl ShrAssign<i16> for UVec3 {
2072
    #[inline]
2073
    fn shr_assign(&mut self, rhs: i16) {
3✔
2074
        *self = self.shr(rhs);
3✔
2075
    }
2076
}
2077

2078
impl ShrAssign<&i16> for UVec3 {
2079
    #[inline]
2080
    fn shr_assign(&mut self, rhs: &i16) {
3✔
2081
        self.shr_assign(*rhs);
3✔
2082
    }
2083
}
2084

2085
impl Shl<i32> for UVec3 {
2086
    type Output = Self;
2087
    #[inline]
2088
    fn shl(self, rhs: i32) -> Self::Output {
3✔
2089
        Self {
2090
            x: self.x.shl(rhs),
3✔
2091
            y: self.y.shl(rhs),
3✔
2092
            z: self.z.shl(rhs),
3✔
2093
        }
2094
    }
2095
}
2096

2097
impl Shl<&i32> for UVec3 {
2098
    type Output = Self;
2099
    #[inline]
2100
    fn shl(self, rhs: &i32) -> Self {
3✔
2101
        self.shl(*rhs)
3✔
2102
    }
2103
}
2104

2105
impl Shl<&i32> for &UVec3 {
2106
    type Output = UVec3;
2107
    #[inline]
2108
    fn shl(self, rhs: &i32) -> UVec3 {
3✔
2109
        (*self).shl(*rhs)
3✔
2110
    }
2111
}
2112

2113
impl Shl<i32> for &UVec3 {
2114
    type Output = UVec3;
2115
    #[inline]
2116
    fn shl(self, rhs: i32) -> UVec3 {
3✔
2117
        (*self).shl(rhs)
3✔
2118
    }
2119
}
2120

2121
impl ShlAssign<i32> for UVec3 {
2122
    #[inline]
2123
    fn shl_assign(&mut self, rhs: i32) {
3✔
2124
        *self = self.shl(rhs);
3✔
2125
    }
2126
}
2127

2128
impl ShlAssign<&i32> for UVec3 {
2129
    #[inline]
2130
    fn shl_assign(&mut self, rhs: &i32) {
3✔
2131
        self.shl_assign(*rhs);
3✔
2132
    }
2133
}
2134

2135
impl Shr<i32> for UVec3 {
2136
    type Output = Self;
2137
    #[inline]
2138
    fn shr(self, rhs: i32) -> Self::Output {
3✔
2139
        Self {
2140
            x: self.x.shr(rhs),
3✔
2141
            y: self.y.shr(rhs),
3✔
2142
            z: self.z.shr(rhs),
3✔
2143
        }
2144
    }
2145
}
2146

2147
impl Shr<&i32> for UVec3 {
2148
    type Output = Self;
2149
    #[inline]
2150
    fn shr(self, rhs: &i32) -> Self {
3✔
2151
        self.shr(*rhs)
3✔
2152
    }
2153
}
2154

2155
impl Shr<&i32> for &UVec3 {
2156
    type Output = UVec3;
2157
    #[inline]
2158
    fn shr(self, rhs: &i32) -> UVec3 {
3✔
2159
        (*self).shr(*rhs)
3✔
2160
    }
2161
}
2162

2163
impl Shr<i32> for &UVec3 {
2164
    type Output = UVec3;
2165
    #[inline]
2166
    fn shr(self, rhs: i32) -> UVec3 {
3✔
2167
        (*self).shr(rhs)
3✔
2168
    }
2169
}
2170

2171
impl ShrAssign<i32> for UVec3 {
2172
    #[inline]
2173
    fn shr_assign(&mut self, rhs: i32) {
3✔
2174
        *self = self.shr(rhs);
3✔
2175
    }
2176
}
2177

2178
impl ShrAssign<&i32> for UVec3 {
2179
    #[inline]
2180
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2181
        self.shr_assign(*rhs);
3✔
2182
    }
2183
}
2184

2185
impl Shl<i64> for UVec3 {
2186
    type Output = Self;
2187
    #[inline]
2188
    fn shl(self, rhs: i64) -> Self::Output {
3✔
2189
        Self {
2190
            x: self.x.shl(rhs),
3✔
2191
            y: self.y.shl(rhs),
3✔
2192
            z: self.z.shl(rhs),
3✔
2193
        }
2194
    }
2195
}
2196

2197
impl Shl<&i64> for UVec3 {
2198
    type Output = Self;
2199
    #[inline]
2200
    fn shl(self, rhs: &i64) -> Self {
3✔
2201
        self.shl(*rhs)
3✔
2202
    }
2203
}
2204

2205
impl Shl<&i64> for &UVec3 {
2206
    type Output = UVec3;
2207
    #[inline]
2208
    fn shl(self, rhs: &i64) -> UVec3 {
3✔
2209
        (*self).shl(*rhs)
3✔
2210
    }
2211
}
2212

2213
impl Shl<i64> for &UVec3 {
2214
    type Output = UVec3;
2215
    #[inline]
2216
    fn shl(self, rhs: i64) -> UVec3 {
3✔
2217
        (*self).shl(rhs)
3✔
2218
    }
2219
}
2220

2221
impl ShlAssign<i64> for UVec3 {
2222
    #[inline]
2223
    fn shl_assign(&mut self, rhs: i64) {
3✔
2224
        *self = self.shl(rhs);
3✔
2225
    }
2226
}
2227

2228
impl ShlAssign<&i64> for UVec3 {
2229
    #[inline]
2230
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2231
        self.shl_assign(*rhs);
3✔
2232
    }
2233
}
2234

2235
impl Shr<i64> for UVec3 {
2236
    type Output = Self;
2237
    #[inline]
2238
    fn shr(self, rhs: i64) -> Self::Output {
3✔
2239
        Self {
2240
            x: self.x.shr(rhs),
3✔
2241
            y: self.y.shr(rhs),
3✔
2242
            z: self.z.shr(rhs),
3✔
2243
        }
2244
    }
2245
}
2246

2247
impl Shr<&i64> for UVec3 {
2248
    type Output = Self;
2249
    #[inline]
2250
    fn shr(self, rhs: &i64) -> Self {
3✔
2251
        self.shr(*rhs)
3✔
2252
    }
2253
}
2254

2255
impl Shr<&i64> for &UVec3 {
2256
    type Output = UVec3;
2257
    #[inline]
2258
    fn shr(self, rhs: &i64) -> UVec3 {
3✔
2259
        (*self).shr(*rhs)
3✔
2260
    }
2261
}
2262

2263
impl Shr<i64> for &UVec3 {
2264
    type Output = UVec3;
2265
    #[inline]
2266
    fn shr(self, rhs: i64) -> UVec3 {
3✔
2267
        (*self).shr(rhs)
3✔
2268
    }
2269
}
2270

2271
impl ShrAssign<i64> for UVec3 {
2272
    #[inline]
2273
    fn shr_assign(&mut self, rhs: i64) {
3✔
2274
        *self = self.shr(rhs);
3✔
2275
    }
2276
}
2277

2278
impl ShrAssign<&i64> for UVec3 {
2279
    #[inline]
2280
    fn shr_assign(&mut self, rhs: &i64) {
3✔
2281
        self.shr_assign(*rhs);
3✔
2282
    }
2283
}
2284

2285
impl Shl<u8> for UVec3 {
2286
    type Output = Self;
2287
    #[inline]
2288
    fn shl(self, rhs: u8) -> Self::Output {
3✔
2289
        Self {
2290
            x: self.x.shl(rhs),
3✔
2291
            y: self.y.shl(rhs),
3✔
2292
            z: self.z.shl(rhs),
3✔
2293
        }
2294
    }
2295
}
2296

2297
impl Shl<&u8> for UVec3 {
2298
    type Output = Self;
2299
    #[inline]
2300
    fn shl(self, rhs: &u8) -> Self {
3✔
2301
        self.shl(*rhs)
3✔
2302
    }
2303
}
2304

2305
impl Shl<&u8> for &UVec3 {
2306
    type Output = UVec3;
2307
    #[inline]
2308
    fn shl(self, rhs: &u8) -> UVec3 {
3✔
2309
        (*self).shl(*rhs)
3✔
2310
    }
2311
}
2312

2313
impl Shl<u8> for &UVec3 {
2314
    type Output = UVec3;
2315
    #[inline]
2316
    fn shl(self, rhs: u8) -> UVec3 {
3✔
2317
        (*self).shl(rhs)
3✔
2318
    }
2319
}
2320

2321
impl ShlAssign<u8> for UVec3 {
2322
    #[inline]
2323
    fn shl_assign(&mut self, rhs: u8) {
3✔
2324
        *self = self.shl(rhs);
3✔
2325
    }
2326
}
2327

2328
impl ShlAssign<&u8> for UVec3 {
2329
    #[inline]
2330
    fn shl_assign(&mut self, rhs: &u8) {
3✔
2331
        self.shl_assign(*rhs);
3✔
2332
    }
2333
}
2334

2335
impl Shr<u8> for UVec3 {
2336
    type Output = Self;
2337
    #[inline]
2338
    fn shr(self, rhs: u8) -> Self::Output {
3✔
2339
        Self {
2340
            x: self.x.shr(rhs),
3✔
2341
            y: self.y.shr(rhs),
3✔
2342
            z: self.z.shr(rhs),
3✔
2343
        }
2344
    }
2345
}
2346

2347
impl Shr<&u8> for UVec3 {
2348
    type Output = Self;
2349
    #[inline]
2350
    fn shr(self, rhs: &u8) -> Self {
3✔
2351
        self.shr(*rhs)
3✔
2352
    }
2353
}
2354

2355
impl Shr<&u8> for &UVec3 {
2356
    type Output = UVec3;
2357
    #[inline]
2358
    fn shr(self, rhs: &u8) -> UVec3 {
3✔
2359
        (*self).shr(*rhs)
3✔
2360
    }
2361
}
2362

2363
impl Shr<u8> for &UVec3 {
2364
    type Output = UVec3;
2365
    #[inline]
2366
    fn shr(self, rhs: u8) -> UVec3 {
3✔
2367
        (*self).shr(rhs)
3✔
2368
    }
2369
}
2370

2371
impl ShrAssign<u8> for UVec3 {
2372
    #[inline]
2373
    fn shr_assign(&mut self, rhs: u8) {
3✔
2374
        *self = self.shr(rhs);
3✔
2375
    }
2376
}
2377

2378
impl ShrAssign<&u8> for UVec3 {
2379
    #[inline]
2380
    fn shr_assign(&mut self, rhs: &u8) {
3✔
2381
        self.shr_assign(*rhs);
3✔
2382
    }
2383
}
2384

2385
impl Shl<u16> for UVec3 {
2386
    type Output = Self;
2387
    #[inline]
2388
    fn shl(self, rhs: u16) -> Self::Output {
3✔
2389
        Self {
2390
            x: self.x.shl(rhs),
3✔
2391
            y: self.y.shl(rhs),
3✔
2392
            z: self.z.shl(rhs),
3✔
2393
        }
2394
    }
2395
}
2396

2397
impl Shl<&u16> for UVec3 {
2398
    type Output = Self;
2399
    #[inline]
2400
    fn shl(self, rhs: &u16) -> Self {
3✔
2401
        self.shl(*rhs)
3✔
2402
    }
2403
}
2404

2405
impl Shl<&u16> for &UVec3 {
2406
    type Output = UVec3;
2407
    #[inline]
2408
    fn shl(self, rhs: &u16) -> UVec3 {
3✔
2409
        (*self).shl(*rhs)
3✔
2410
    }
2411
}
2412

2413
impl Shl<u16> for &UVec3 {
2414
    type Output = UVec3;
2415
    #[inline]
2416
    fn shl(self, rhs: u16) -> UVec3 {
3✔
2417
        (*self).shl(rhs)
3✔
2418
    }
2419
}
2420

2421
impl ShlAssign<u16> for UVec3 {
2422
    #[inline]
2423
    fn shl_assign(&mut self, rhs: u16) {
3✔
2424
        *self = self.shl(rhs);
3✔
2425
    }
2426
}
2427

2428
impl ShlAssign<&u16> for UVec3 {
2429
    #[inline]
2430
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2431
        self.shl_assign(*rhs);
3✔
2432
    }
2433
}
2434

2435
impl Shr<u16> for UVec3 {
2436
    type Output = Self;
2437
    #[inline]
2438
    fn shr(self, rhs: u16) -> Self::Output {
3✔
2439
        Self {
2440
            x: self.x.shr(rhs),
3✔
2441
            y: self.y.shr(rhs),
3✔
2442
            z: self.z.shr(rhs),
3✔
2443
        }
2444
    }
2445
}
2446

2447
impl Shr<&u16> for UVec3 {
2448
    type Output = Self;
2449
    #[inline]
2450
    fn shr(self, rhs: &u16) -> Self {
3✔
2451
        self.shr(*rhs)
3✔
2452
    }
2453
}
2454

2455
impl Shr<&u16> for &UVec3 {
2456
    type Output = UVec3;
2457
    #[inline]
2458
    fn shr(self, rhs: &u16) -> UVec3 {
3✔
2459
        (*self).shr(*rhs)
3✔
2460
    }
2461
}
2462

2463
impl Shr<u16> for &UVec3 {
2464
    type Output = UVec3;
2465
    #[inline]
2466
    fn shr(self, rhs: u16) -> UVec3 {
3✔
2467
        (*self).shr(rhs)
3✔
2468
    }
2469
}
2470

2471
impl ShrAssign<u16> for UVec3 {
2472
    #[inline]
2473
    fn shr_assign(&mut self, rhs: u16) {
3✔
2474
        *self = self.shr(rhs);
3✔
2475
    }
2476
}
2477

2478
impl ShrAssign<&u16> for UVec3 {
2479
    #[inline]
2480
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2481
        self.shr_assign(*rhs);
3✔
2482
    }
2483
}
2484

2485
impl Shl<u32> for UVec3 {
2486
    type Output = Self;
2487
    #[inline]
2488
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2489
        Self {
2490
            x: self.x.shl(rhs),
3✔
2491
            y: self.y.shl(rhs),
3✔
2492
            z: self.z.shl(rhs),
3✔
2493
        }
2494
    }
2495
}
2496

2497
impl Shl<&u32> for UVec3 {
2498
    type Output = Self;
2499
    #[inline]
2500
    fn shl(self, rhs: &u32) -> Self {
3✔
2501
        self.shl(*rhs)
3✔
2502
    }
2503
}
2504

2505
impl Shl<&u32> for &UVec3 {
2506
    type Output = UVec3;
2507
    #[inline]
2508
    fn shl(self, rhs: &u32) -> UVec3 {
3✔
2509
        (*self).shl(*rhs)
3✔
2510
    }
2511
}
2512

2513
impl Shl<u32> for &UVec3 {
2514
    type Output = UVec3;
2515
    #[inline]
2516
    fn shl(self, rhs: u32) -> UVec3 {
3✔
2517
        (*self).shl(rhs)
3✔
2518
    }
2519
}
2520

2521
impl ShlAssign<u32> for UVec3 {
2522
    #[inline]
2523
    fn shl_assign(&mut self, rhs: u32) {
3✔
2524
        *self = self.shl(rhs);
3✔
2525
    }
2526
}
2527

2528
impl ShlAssign<&u32> for UVec3 {
2529
    #[inline]
2530
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2531
        self.shl_assign(*rhs);
3✔
2532
    }
2533
}
2534

2535
impl Shr<u32> for UVec3 {
2536
    type Output = Self;
2537
    #[inline]
2538
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2539
        Self {
2540
            x: self.x.shr(rhs),
3✔
2541
            y: self.y.shr(rhs),
3✔
2542
            z: self.z.shr(rhs),
3✔
2543
        }
2544
    }
2545
}
2546

2547
impl Shr<&u32> for UVec3 {
2548
    type Output = Self;
2549
    #[inline]
2550
    fn shr(self, rhs: &u32) -> Self {
3✔
2551
        self.shr(*rhs)
3✔
2552
    }
2553
}
2554

2555
impl Shr<&u32> for &UVec3 {
2556
    type Output = UVec3;
2557
    #[inline]
2558
    fn shr(self, rhs: &u32) -> UVec3 {
3✔
2559
        (*self).shr(*rhs)
3✔
2560
    }
2561
}
2562

2563
impl Shr<u32> for &UVec3 {
2564
    type Output = UVec3;
2565
    #[inline]
2566
    fn shr(self, rhs: u32) -> UVec3 {
3✔
2567
        (*self).shr(rhs)
3✔
2568
    }
2569
}
2570

2571
impl ShrAssign<u32> for UVec3 {
2572
    #[inline]
2573
    fn shr_assign(&mut self, rhs: u32) {
3✔
2574
        *self = self.shr(rhs);
3✔
2575
    }
2576
}
2577

2578
impl ShrAssign<&u32> for UVec3 {
2579
    #[inline]
2580
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2581
        self.shr_assign(*rhs);
3✔
2582
    }
2583
}
2584

2585
impl Shl<u64> for UVec3 {
2586
    type Output = Self;
2587
    #[inline]
2588
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2589
        Self {
2590
            x: self.x.shl(rhs),
3✔
2591
            y: self.y.shl(rhs),
3✔
2592
            z: self.z.shl(rhs),
3✔
2593
        }
2594
    }
2595
}
2596

2597
impl Shl<&u64> for UVec3 {
2598
    type Output = Self;
2599
    #[inline]
2600
    fn shl(self, rhs: &u64) -> Self {
3✔
2601
        self.shl(*rhs)
3✔
2602
    }
2603
}
2604

2605
impl Shl<&u64> for &UVec3 {
2606
    type Output = UVec3;
2607
    #[inline]
2608
    fn shl(self, rhs: &u64) -> UVec3 {
3✔
2609
        (*self).shl(*rhs)
3✔
2610
    }
2611
}
2612

2613
impl Shl<u64> for &UVec3 {
2614
    type Output = UVec3;
2615
    #[inline]
2616
    fn shl(self, rhs: u64) -> UVec3 {
3✔
2617
        (*self).shl(rhs)
3✔
2618
    }
2619
}
2620

2621
impl ShlAssign<u64> for UVec3 {
2622
    #[inline]
2623
    fn shl_assign(&mut self, rhs: u64) {
3✔
2624
        *self = self.shl(rhs);
3✔
2625
    }
2626
}
2627

2628
impl ShlAssign<&u64> for UVec3 {
2629
    #[inline]
2630
    fn shl_assign(&mut self, rhs: &u64) {
3✔
2631
        self.shl_assign(*rhs);
3✔
2632
    }
2633
}
2634

2635
impl Shr<u64> for UVec3 {
2636
    type Output = Self;
2637
    #[inline]
2638
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2639
        Self {
2640
            x: self.x.shr(rhs),
3✔
2641
            y: self.y.shr(rhs),
3✔
2642
            z: self.z.shr(rhs),
3✔
2643
        }
2644
    }
2645
}
2646

2647
impl Shr<&u64> for UVec3 {
2648
    type Output = Self;
2649
    #[inline]
2650
    fn shr(self, rhs: &u64) -> Self {
3✔
2651
        self.shr(*rhs)
3✔
2652
    }
2653
}
2654

2655
impl Shr<&u64> for &UVec3 {
2656
    type Output = UVec3;
2657
    #[inline]
2658
    fn shr(self, rhs: &u64) -> UVec3 {
3✔
2659
        (*self).shr(*rhs)
3✔
2660
    }
2661
}
2662

2663
impl Shr<u64> for &UVec3 {
2664
    type Output = UVec3;
2665
    #[inline]
2666
    fn shr(self, rhs: u64) -> UVec3 {
3✔
2667
        (*self).shr(rhs)
3✔
2668
    }
2669
}
2670

2671
impl ShrAssign<u64> for UVec3 {
2672
    #[inline]
2673
    fn shr_assign(&mut self, rhs: u64) {
3✔
2674
        *self = self.shr(rhs);
3✔
2675
    }
2676
}
2677

2678
impl ShrAssign<&u64> for UVec3 {
2679
    #[inline]
2680
    fn shr_assign(&mut self, rhs: &u64) {
3✔
2681
        self.shr_assign(*rhs);
3✔
2682
    }
2683
}
2684

2685
#[cfg(feature = "i32")]
2686

2687
impl Shl<IVec3> for UVec3 {
2688
    type Output = Self;
2689
    #[inline]
2690
    fn shl(self, rhs: IVec3) -> Self {
3✔
2691
        Self {
2692
            x: self.x.shl(rhs.x),
3✔
2693
            y: self.y.shl(rhs.y),
3✔
2694
            z: self.z.shl(rhs.z),
3✔
2695
        }
2696
    }
2697
}
2698

2699
#[cfg(feature = "i32")]
2700

2701
impl Shl<&IVec3> for UVec3 {
2702
    type Output = Self;
2703
    #[inline]
2704
    fn shl(self, rhs: &IVec3) -> Self {
3✔
2705
        self.shl(*rhs)
3✔
2706
    }
2707
}
2708

2709
#[cfg(feature = "i32")]
2710

2711
impl Shl<&IVec3> for &UVec3 {
2712
    type Output = UVec3;
2713
    #[inline]
2714
    fn shl(self, rhs: &IVec3) -> UVec3 {
3✔
2715
        (*self).shl(*rhs)
3✔
2716
    }
2717
}
2718

2719
#[cfg(feature = "i32")]
2720

2721
impl Shl<IVec3> for &UVec3 {
2722
    type Output = UVec3;
2723
    #[inline]
2724
    fn shl(self, rhs: IVec3) -> UVec3 {
3✔
2725
        (*self).shl(rhs)
3✔
2726
    }
2727
}
2728

2729
#[cfg(feature = "i32")]
2730

2731
impl Shr<IVec3> for UVec3 {
2732
    type Output = Self;
2733
    #[inline]
2734
    fn shr(self, rhs: IVec3) -> Self {
3✔
2735
        Self {
2736
            x: self.x.shr(rhs.x),
3✔
2737
            y: self.y.shr(rhs.y),
3✔
2738
            z: self.z.shr(rhs.z),
3✔
2739
        }
2740
    }
2741
}
2742

2743
#[cfg(feature = "i32")]
2744

2745
impl Shr<&IVec3> for UVec3 {
2746
    type Output = Self;
2747
    #[inline]
2748
    fn shr(self, rhs: &IVec3) -> Self {
3✔
2749
        self.shr(*rhs)
3✔
2750
    }
2751
}
2752

2753
#[cfg(feature = "i32")]
2754

2755
impl Shr<&IVec3> for &UVec3 {
2756
    type Output = UVec3;
2757
    #[inline]
2758
    fn shr(self, rhs: &IVec3) -> UVec3 {
3✔
2759
        (*self).shr(*rhs)
3✔
2760
    }
2761
}
2762

2763
#[cfg(feature = "i32")]
2764

2765
impl Shr<IVec3> for &UVec3 {
2766
    type Output = UVec3;
2767
    #[inline]
2768
    fn shr(self, rhs: IVec3) -> UVec3 {
3✔
2769
        (*self).shr(rhs)
3✔
2770
    }
2771
}
2772

2773
impl Shl for UVec3 {
2774
    type Output = Self;
2775
    #[inline]
2776
    fn shl(self, rhs: Self) -> Self {
3✔
2777
        Self {
2778
            x: self.x.shl(rhs.x),
3✔
2779
            y: self.y.shl(rhs.y),
3✔
2780
            z: self.z.shl(rhs.z),
3✔
2781
        }
2782
    }
2783
}
2784

2785
impl Shl<&Self> for UVec3 {
2786
    type Output = Self;
2787
    #[inline]
2788
    fn shl(self, rhs: &Self) -> Self {
3✔
2789
        self.shl(*rhs)
3✔
2790
    }
2791
}
2792

2793
impl Shl<&UVec3> for &UVec3 {
2794
    type Output = UVec3;
2795
    #[inline]
2796
    fn shl(self, rhs: &UVec3) -> UVec3 {
3✔
2797
        (*self).shl(*rhs)
3✔
2798
    }
2799
}
2800

2801
impl Shl<UVec3> for &UVec3 {
2802
    type Output = UVec3;
2803
    #[inline]
2804
    fn shl(self, rhs: UVec3) -> UVec3 {
3✔
2805
        (*self).shl(rhs)
3✔
2806
    }
2807
}
2808

2809
impl Shr for UVec3 {
2810
    type Output = Self;
2811
    #[inline]
2812
    fn shr(self, rhs: Self) -> Self {
3✔
2813
        Self {
2814
            x: self.x.shr(rhs.x),
3✔
2815
            y: self.y.shr(rhs.y),
3✔
2816
            z: self.z.shr(rhs.z),
3✔
2817
        }
2818
    }
2819
}
2820

2821
impl Shr<&Self> for UVec3 {
2822
    type Output = Self;
2823
    #[inline]
2824
    fn shr(self, rhs: &Self) -> Self {
3✔
2825
        self.shr(*rhs)
3✔
2826
    }
2827
}
2828

2829
impl Shr<&UVec3> for &UVec3 {
2830
    type Output = UVec3;
2831
    #[inline]
2832
    fn shr(self, rhs: &UVec3) -> UVec3 {
3✔
2833
        (*self).shr(*rhs)
3✔
2834
    }
2835
}
2836

2837
impl Shr<UVec3> for &UVec3 {
2838
    type Output = UVec3;
2839
    #[inline]
2840
    fn shr(self, rhs: UVec3) -> UVec3 {
3✔
2841
        (*self).shr(rhs)
3✔
2842
    }
2843
}
2844

2845
impl Index<usize> for UVec3 {
2846
    type Output = u32;
2847
    #[inline]
2848
    fn index(&self, index: usize) -> &Self::Output {
3✔
2849
        match index {
6✔
2850
            0 => &self.x,
3✔
2851
            1 => &self.y,
3✔
2852
            2 => &self.z,
3✔
2853
            _ => panic!("index out of bounds"),
×
2854
        }
2855
    }
2856
}
2857

2858
impl IndexMut<usize> for UVec3 {
2859
    #[inline]
2860
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2861
        match index {
6✔
2862
            0 => &mut self.x,
3✔
2863
            1 => &mut self.y,
3✔
2864
            2 => &mut self.z,
3✔
2865
            _ => panic!("index out of bounds"),
×
2866
        }
2867
    }
2868
}
2869

2870
impl fmt::Display for UVec3 {
2871
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2872
        write!(f, "[{}, {}, {}]", self.x, self.y, self.z)
3✔
2873
    }
2874
}
2875

2876
impl fmt::Debug for UVec3 {
2877
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2878
        fmt.debug_tuple(stringify!(UVec3))
3✔
2879
            .field(&self.x)
3✔
2880
            .field(&self.y)
3✔
2881
            .field(&self.z)
3✔
2882
            .finish()
2883
    }
2884
}
2885

2886
impl From<[u32; 3]> for UVec3 {
2887
    #[inline]
2888
    fn from(a: [u32; 3]) -> Self {
6✔
2889
        Self::new(a[0], a[1], a[2])
6✔
2890
    }
2891
}
2892

2893
impl From<UVec3> for [u32; 3] {
2894
    #[inline]
2895
    fn from(v: UVec3) -> Self {
3✔
2896
        [v.x, v.y, v.z]
3✔
2897
    }
2898
}
2899

2900
impl From<(u32, u32, u32)> for UVec3 {
2901
    #[inline]
2902
    fn from(t: (u32, u32, u32)) -> Self {
3✔
2903
        Self::new(t.0, t.1, t.2)
3✔
2904
    }
2905
}
2906

2907
impl From<UVec3> for (u32, u32, u32) {
2908
    #[inline]
2909
    fn from(v: UVec3) -> Self {
6✔
2910
        (v.x, v.y, v.z)
6✔
2911
    }
2912
}
2913

2914
impl From<(UVec2, u32)> for UVec3 {
2915
    #[inline]
2916
    fn from((v, z): (UVec2, u32)) -> Self {
×
2917
        Self::new(v.x, v.y, z)
×
2918
    }
2919
}
2920

2921
impl From<U8Vec3> for UVec3 {
2922
    #[inline]
2923
    fn from(v: U8Vec3) -> Self {
3✔
2924
        Self::new(u32::from(v.x), u32::from(v.y), u32::from(v.z))
3✔
2925
    }
2926
}
2927

2928
impl From<U16Vec3> for UVec3 {
2929
    #[inline]
2930
    fn from(v: U16Vec3) -> Self {
3✔
2931
        Self::new(u32::from(v.x), u32::from(v.y), u32::from(v.z))
3✔
2932
    }
2933
}
2934

2935
#[cfg(feature = "i8")]
2936

2937
impl TryFrom<I8Vec3> for UVec3 {
2938
    type Error = core::num::TryFromIntError;
2939

2940
    #[inline]
2941
    fn try_from(v: I8Vec3) -> Result<Self, Self::Error> {
3✔
2942
        Ok(Self::new(
3✔
2943
            u32::try_from(v.x)?,
3✔
2944
            u32::try_from(v.y)?,
3✔
2945
            u32::try_from(v.z)?,
3✔
2946
        ))
2947
    }
2948
}
2949

2950
#[cfg(feature = "i16")]
2951

2952
impl TryFrom<I16Vec3> for UVec3 {
2953
    type Error = core::num::TryFromIntError;
2954

2955
    #[inline]
2956
    fn try_from(v: I16Vec3) -> Result<Self, Self::Error> {
3✔
2957
        Ok(Self::new(
3✔
2958
            u32::try_from(v.x)?,
3✔
2959
            u32::try_from(v.y)?,
3✔
2960
            u32::try_from(v.z)?,
3✔
2961
        ))
2962
    }
2963
}
2964

2965
#[cfg(feature = "i32")]
2966

2967
impl TryFrom<IVec3> for UVec3 {
2968
    type Error = core::num::TryFromIntError;
2969

2970
    #[inline]
2971
    fn try_from(v: IVec3) -> Result<Self, Self::Error> {
3✔
2972
        Ok(Self::new(
3✔
2973
            u32::try_from(v.x)?,
3✔
2974
            u32::try_from(v.y)?,
3✔
2975
            u32::try_from(v.z)?,
3✔
2976
        ))
2977
    }
2978
}
2979

2980
#[cfg(feature = "i64")]
2981

2982
impl TryFrom<I64Vec3> for UVec3 {
2983
    type Error = core::num::TryFromIntError;
2984

2985
    #[inline]
2986
    fn try_from(v: I64Vec3) -> Result<Self, Self::Error> {
3✔
2987
        Ok(Self::new(
3✔
2988
            u32::try_from(v.x)?,
3✔
2989
            u32::try_from(v.y)?,
3✔
2990
            u32::try_from(v.z)?,
3✔
2991
        ))
2992
    }
2993
}
2994

2995
#[cfg(feature = "u64")]
2996

2997
impl TryFrom<U64Vec3> for UVec3 {
2998
    type Error = core::num::TryFromIntError;
2999

3000
    #[inline]
3001
    fn try_from(v: U64Vec3) -> Result<Self, Self::Error> {
3✔
3002
        Ok(Self::new(
3✔
3003
            u32::try_from(v.x)?,
3✔
3004
            u32::try_from(v.y)?,
3✔
3005
            u32::try_from(v.z)?,
3✔
3006
        ))
3007
    }
3008
}
3009

3010
#[cfg(feature = "isize")]
3011

3012
impl TryFrom<ISizeVec3> for UVec3 {
3013
    type Error = core::num::TryFromIntError;
3014

3015
    #[inline]
3016
    fn try_from(v: ISizeVec3) -> Result<Self, Self::Error> {
3✔
3017
        Ok(Self::new(
3✔
3018
            u32::try_from(v.x)?,
3✔
3019
            u32::try_from(v.y)?,
3✔
3020
            u32::try_from(v.z)?,
3✔
3021
        ))
3022
    }
3023
}
3024

3025
#[cfg(feature = "usize")]
3026

3027
impl TryFrom<USizeVec3> for UVec3 {
3028
    type Error = core::num::TryFromIntError;
3029

3030
    #[inline]
3031
    fn try_from(v: USizeVec3) -> Result<Self, Self::Error> {
3✔
3032
        Ok(Self::new(
3✔
3033
            u32::try_from(v.x)?,
3✔
3034
            u32::try_from(v.y)?,
3✔
3035
            u32::try_from(v.z)?,
3✔
3036
        ))
3037
    }
3038
}
3039

3040
impl From<BVec3> for UVec3 {
3041
    #[inline]
3042
    fn from(v: BVec3) -> Self {
3✔
3043
        Self::new(u32::from(v.x), u32::from(v.y), u32::from(v.z))
3✔
3044
    }
3045
}
3046

3047
impl From<BVec3A> for UVec3 {
3048
    #[inline]
3049
    fn from(v: BVec3A) -> Self {
3✔
3050
        let bool_array: [bool; 3] = v.into();
3✔
3051
        Self::new(
3052
            u32::from(bool_array[0]),
3✔
3053
            u32::from(bool_array[1]),
3✔
3054
            u32::from(bool_array[2]),
3✔
3055
        )
3056
    }
3057
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc