glam/i8/
i8vec3.rs

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