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