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