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