Skip to main content

glam/i64/
i64vec3.rs

1// Generated from vec.rs.tera template. Edit the template, not the generated file.
2
3use crate::{BVec3, BVec3A, I64Vec2, I64Vec4};
4
5#[cfg(feature = "i8")]
6use crate::I8Vec3;
7
8#[cfg(feature = "u8")]
9use crate::U8Vec3;
10
11#[cfg(feature = "i16")]
12use crate::I16Vec3;
13
14#[cfg(feature = "u16")]
15use crate::U16Vec3;
16
17#[cfg(feature = "i32")]
18use crate::IVec3;
19
20#[cfg(feature = "u32")]
21use crate::UVec3;
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/// Creates a 3-dimensional vector.
40#[inline(always)]
41#[must_use]
42pub const fn i64vec3(x: i64, y: i64, z: i64) -> I64Vec3 {
43    I64Vec3::new(x, y, z)
44}
45
46/// A 3-dimensional vector.
47#[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 I64Vec3 {
56    pub x: i64,
57    pub y: i64,
58    pub z: i64,
59}
60
61impl I64Vec3 {
62    /// All zeroes.
63    pub const ZERO: Self = Self::splat(0);
64
65    /// All ones.
66    pub const ONE: Self = Self::splat(1);
67
68    /// All negative ones.
69    pub const NEG_ONE: Self = Self::splat(-1);
70
71    /// All `i64::MIN`.
72    pub const MIN: Self = Self::splat(i64::MIN);
73
74    /// All `i64::MAX`.
75    pub const MAX: Self = Self::splat(i64::MAX);
76
77    /// A unit vector pointing along the positive X axis.
78    pub const X: Self = Self::new(1, 0, 0);
79
80    /// A unit vector pointing along the positive Y axis.
81    pub const Y: Self = Self::new(0, 1, 0);
82
83    /// A unit vector pointing along the positive Z axis.
84    pub const Z: Self = Self::new(0, 0, 1);
85
86    /// A unit vector pointing along the negative X axis.
87    pub const NEG_X: Self = Self::new(-1, 0, 0);
88
89    /// A unit vector pointing along the negative Y axis.
90    pub const NEG_Y: Self = Self::new(0, -1, 0);
91
92    /// A unit vector pointing along the negative Z axis.
93    pub const NEG_Z: Self = Self::new(0, 0, -1);
94
95    /// The unit axes.
96    pub const AXES: [Self; 3] = [Self::X, Self::Y, Self::Z];
97
98    /// Creates a new vector.
99    #[inline(always)]
100    #[must_use]
101    pub const fn new(x: i64, y: i64, z: i64) -> Self {
102        Self { x, y, z }
103    }
104
105    /// Creates a vector with all elements set to `v`.
106    #[inline]
107    #[must_use]
108    pub const fn splat(v: i64) -> Self {
109        Self::new(v, v, v)
110    }
111
112    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
113    #[inline]
114    #[must_use]
115    pub fn map<F>(self, mut f: F) -> Self
116    where
117        F: FnMut(i64) -> i64,
118    {
119        Self::new(f(self.x), f(self.y), f(self.z))
120    }
121
122    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
123    /// for each element of `self`.
124    ///
125    /// A true element in the mask uses the corresponding element from `if_true`, and false
126    /// uses the element from `if_false`.
127    #[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    /// Creates a new vector from an array.
138    #[inline]
139    #[must_use]
140    pub const fn from_array(a: [i64; 3]) -> Self {
141        Self::new(a[0], a[1], a[2])
142    }
143
144    /// Converts `self` to `[x, y, z]`
145    #[inline]
146    #[must_use]
147    pub const fn to_array(&self) -> [i64; 3] {
148        [self.x, self.y, self.z]
149    }
150
151    /// Creates a vector from the first 3 values in `slice`.
152    ///
153    /// # Panics
154    ///
155    /// Panics if `slice` is less than 3 elements long.
156    #[inline]
157    #[must_use]
158    #[track_caller]
159    pub const fn from_slice(slice: &[i64]) -> Self {
160        assert!(slice.len() >= 3);
161        Self::new(slice[0], slice[1], slice[2])
162    }
163
164    /// Writes the elements of `self` to the first 3 elements in `slice`.
165    ///
166    /// # Panics
167    ///
168    /// Panics if `slice` is less than 3 elements long.
169    #[inline]
170    #[track_caller]
171    pub fn write_to_slice(self, slice: &mut [i64]) {
172        slice[..3].copy_from_slice(&self.to_array());
173    }
174
175    /// Internal method for creating a 3D vector from a 4D vector, discarding `w`.
176    #[allow(dead_code)]
177    #[inline]
178    #[must_use]
179    pub(crate) fn from_vec4(v: I64Vec4) -> Self {
180        Self::new(v.x, v.y, v.z)
181    }
182
183    /// Creates a 4D vector from `self` and the given `w` value.
184    #[inline]
185    #[must_use]
186    pub fn extend(self, w: i64) -> I64Vec4 {
187        I64Vec4::new(self.x, self.y, self.z, w)
188    }
189
190    /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`.
191    ///
192    /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()].
193    #[inline]
194    #[must_use]
195    pub fn truncate(self) -> I64Vec2 {
196        use crate::swizzles::Vec3Swizzles;
197        self.xy()
198    }
199
200    /// Creates a 3D vector from `self` with the given value of `x`.
201    #[inline]
202    #[must_use]
203    pub fn with_x(mut self, x: i64) -> Self {
204        self.x = x;
205        self
206    }
207
208    /// Creates a 3D vector from `self` with the given value of `y`.
209    #[inline]
210    #[must_use]
211    pub fn with_y(mut self, y: i64) -> Self {
212        self.y = y;
213        self
214    }
215
216    /// Creates a 3D vector from `self` with the given value of `z`.
217    #[inline]
218    #[must_use]
219    pub fn with_z(mut self, z: i64) -> Self {
220        self.z = z;
221        self
222    }
223
224    /// Computes the dot product of `self` and `rhs`.
225    #[inline]
226    #[must_use]
227    pub fn dot(self, rhs: Self) -> i64 {
228        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z)
229    }
230
231    /// Returns a vector where every component is the dot product of `self` and `rhs`.
232    #[inline]
233    #[must_use]
234    pub fn dot_into_vec(self, rhs: Self) -> Self {
235        Self::splat(self.dot(rhs))
236    }
237
238    /// Computes the cross product of `self` and `rhs`.
239    #[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    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
250    ///
251    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
252    #[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    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
263    ///
264    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
265    #[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    /// Component-wise clamping of values, similar to [`i64::clamp`].
276    ///
277    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
278    ///
279    /// # Panics
280    ///
281    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
282    #[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    /// Returns the horizontal minimum of `self`.
291    ///
292    /// In other words this computes `min(x, y, ..)`.
293    #[inline]
294    #[must_use]
295    pub fn min_element(self) -> i64 {
296        let min = |a, b| if a < b { a } else { b };
297        min(self.x, min(self.y, self.z))
298    }
299
300    /// Returns the horizontal maximum of `self`.
301    ///
302    /// In other words this computes `max(x, y, ..)`.
303    #[inline]
304    #[must_use]
305    pub fn max_element(self) -> i64 {
306        let max = |a, b| if a > b { a } else { b };
307        max(self.x, max(self.y, self.z))
308    }
309
310    /// Returns the index of the first minimum element of `self`.
311    #[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    /// Returns the index of the first maximum element of `self`.
328    #[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    /// Returns the sum of all elements of `self`.
345    ///
346    /// In other words, this computes `self.x + self.y + ..`.
347    #[inline]
348    #[must_use]
349    pub fn element_sum(self) -> i64 {
350        self.x + self.y + self.z
351    }
352
353    /// Returns the product of all elements of `self`.
354    ///
355    /// In other words, this computes `self.x * self.y * ..`.
356    #[inline]
357    #[must_use]
358    pub fn element_product(self) -> i64 {
359        self.x * self.y * self.z
360    }
361
362    /// Returns a vector mask containing the result of a `==` comparison for each element of
363    /// `self` and `rhs`.
364    ///
365    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
366    /// elements.
367    #[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    /// Returns a vector mask containing the result of a `!=` comparison for each element of
374    /// `self` and `rhs`.
375    ///
376    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
377    /// elements.
378    #[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    /// Returns a vector mask containing the result of a `>=` comparison for each element of
385    /// `self` and `rhs`.
386    ///
387    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
388    /// elements.
389    #[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    /// Returns a vector mask containing the result of a `>` comparison for each element of
396    /// `self` and `rhs`.
397    ///
398    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
399    /// elements.
400    #[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    /// Returns a vector mask containing the result of a `<=` comparison for each element of
407    /// `self` and `rhs`.
408    ///
409    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
410    /// elements.
411    #[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    /// Returns a vector mask containing the result of a `<` comparison for each element of
418    /// `self` and `rhs`.
419    ///
420    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
421    /// elements.
422    #[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    /// Returns a vector containing the absolute value of each element of `self`.
429    #[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    /// Returns a vector with elements representing the sign of `self`.
436    ///
437    ///  - `0` if the number is zero
438    ///  - `1` if the number is positive
439    ///  - `-1` if the number is negative
440    #[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    /// Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`.
447    ///
448    /// A negative element results in a `1` bit and a positive element in a `0` bit.  Element `x` goes
449    /// into the first lowest bit, element `y` into the second, etc.
450    ///
451    /// An element is negative if it has a negative sign, including -0.0, NaNs with negative sign
452    /// bit and negative infinity.
453    #[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    /// Returns a mask indicating which components are negative.
462    ///
463    /// An element is negative if it has a negative sign, including -0.0, NaNs with negative sign
464    /// bit and negative infinity.
465    #[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    /// Computes the squared length of `self`.
476    #[doc(alias = "magnitude2")]
477    #[inline]
478    #[must_use]
479    pub fn length_squared(self) -> i64 {
480        self.dot(self)
481    }
482
483    /// Compute the squared euclidean distance between two points in space.
484    #[inline]
485    #[must_use]
486    pub fn distance_squared(self, rhs: Self) -> i64 {
487        (self - rhs).length_squared()
488    }
489
490    /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`.
491    ///
492    /// # Panics
493    /// This function will panic if any `rhs` element is 0 or the division results in overflow.
494    #[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    /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`.
505    ///
506    /// # Panics
507    /// This function will panic if any `rhs` element is 0 or the division results in overflow.
508    ///
509    /// [Euclidean division]: i64::rem_euclid
510    #[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    /// Computes the [manhattan distance] between two points.
521    ///
522    /// # Overflow
523    /// This method may overflow if the result is greater than [`u64::MAX`].
524    ///
525    /// See also [`checked_manhattan_distance`][I64Vec3::checked_manhattan_distance].
526    ///
527    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
528    #[inline]
529    #[must_use]
530    pub fn manhattan_distance(self, rhs: Self) -> u64 {
531        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y) + self.z.abs_diff(rhs.z)
532    }
533
534    /// Computes the [manhattan distance] between two points.
535    ///
536    /// This will returns [`None`] if the result is greater than [`u64::MAX`].
537    ///
538    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
539    #[inline]
540    #[must_use]
541    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<u64> {
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    /// Computes the [chebyshev distance] between two points.
548    ///
549    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
550    #[inline]
551    #[must_use]
552    pub fn chebyshev_distance(self, rhs: Self) -> u64 {
553        // Note: the compiler will eventually optimize out the loop
554        [
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    /// Casts all elements of `self` to `f32`.
565    #[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    /// Casts all elements of `self` to `f32`.
572    #[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    /// Casts all elements of `self` to `f64`.
579    #[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    /// Casts all elements of `self` to `i8`.
587    #[cfg(feature = "i8")]
588    #[inline]
589    #[must_use]
590    pub fn as_i8vec3(self) -> crate::I8Vec3 {
591        crate::I8Vec3::new(self.x as i8, self.y as i8, self.z as i8)
592    }
593
594    /// Casts all elements of `self` to `u8`.
595    #[cfg(feature = "u8")]
596    #[inline]
597    #[must_use]
598    pub fn as_u8vec3(self) -> crate::U8Vec3 {
599        crate::U8Vec3::new(self.x as u8, self.y as u8, self.z as u8)
600    }
601
602    /// Casts all elements of `self` to `i16`.
603    #[cfg(feature = "i16")]
604    #[inline]
605    #[must_use]
606    pub fn as_i16vec3(self) -> crate::I16Vec3 {
607        crate::I16Vec3::new(self.x as i16, self.y as i16, self.z as i16)
608    }
609
610    /// Casts all elements of `self` to `u16`.
611    #[cfg(feature = "u16")]
612    #[inline]
613    #[must_use]
614    pub fn as_u16vec3(self) -> crate::U16Vec3 {
615        crate::U16Vec3::new(self.x as u16, self.y as u16, self.z as u16)
616    }
617
618    /// Casts all elements of `self` to `i32`.
619    #[cfg(feature = "i32")]
620    #[inline]
621    #[must_use]
622    pub fn as_ivec3(self) -> crate::IVec3 {
623        crate::IVec3::new(self.x as i32, self.y as i32, self.z as i32)
624    }
625
626    /// Casts all elements of `self` to `u32`.
627    #[cfg(feature = "u32")]
628    #[inline]
629    #[must_use]
630    pub fn as_uvec3(self) -> crate::UVec3 {
631        crate::UVec3::new(self.x as u32, self.y as u32, self.z as u32)
632    }
633
634    /// Casts all elements of `self` to `u64`.
635    #[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    /// Casts all elements of `self` to `isize`.
643    #[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    /// Casts all elements of `self` to `usize`.
651    #[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    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
659    ///
660    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
661    #[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    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
681    ///
682    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
683    #[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    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
703    ///
704    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
705    #[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    /// Returns a vector containing the wrapping division of `self` and `rhs`.
725    ///
726    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
727    #[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    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
747    ///
748    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
749    #[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    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
760    ///
761    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
762    #[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    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
773    ///
774    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
775    #[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    /// Returns a vector containing the wrapping division of `self` and `rhs`.
786    ///
787    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
788    #[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    /// Returns a vector containing the saturating addition of `self` and `rhs`.
799    ///
800    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
801    #[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    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
812    ///
813    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
814    #[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    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
825    ///
826    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
827    #[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    /// Returns a vector containing the saturating division of `self` and `rhs`.
838    ///
839    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
840    #[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    /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`.
851    ///
852    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
853    #[cfg(feature = "u64")]
854    #[inline]
855    #[must_use]
856    pub const fn checked_add_unsigned(self, rhs: U64Vec3) -> 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    /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`.
874    ///
875    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
876    #[cfg(feature = "u64")]
877    #[inline]
878    #[must_use]
879    pub const fn checked_sub_unsigned(self, rhs: U64Vec3) -> 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    /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`.
897    ///
898    /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`.
899    #[cfg(feature = "u64")]
900    #[inline]
901    #[must_use]
902    pub const fn wrapping_add_unsigned(self, rhs: U64Vec3) -> 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    /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`.
911    ///
912    /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`.
913    #[cfg(feature = "u64")]
914    #[inline]
915    #[must_use]
916    pub const fn wrapping_sub_unsigned(self, rhs: U64Vec3) -> 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    // Returns a vector containing the saturating addition of `self` and unsigned vector `rhs`.
925    ///
926    /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`.
927    #[cfg(feature = "u64")]
928    #[inline]
929    #[must_use]
930    pub const fn saturating_add_unsigned(self, rhs: U64Vec3) -> 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    /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`.
939    ///
940    /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`.
941    #[cfg(feature = "u64")]
942    #[inline]
943    #[must_use]
944    pub const fn saturating_sub_unsigned(self, rhs: U64Vec3) -> 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 I64Vec3 {
954    #[inline(always)]
955    fn default() -> Self {
956        Self::ZERO
957    }
958}
959
960impl Div for I64Vec3 {
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 I64Vec3 {
969    type Output = Self;
970    #[inline]
971    fn div(self, rhs: &Self) -> Self {
972        self.div(*rhs)
973    }
974}
975
976impl Div<&I64Vec3> for &I64Vec3 {
977    type Output = I64Vec3;
978    #[inline]
979    fn div(self, rhs: &I64Vec3) -> I64Vec3 {
980        (*self).div(*rhs)
981    }
982}
983
984impl Div<I64Vec3> for &I64Vec3 {
985    type Output = I64Vec3;
986    #[inline]
987    fn div(self, rhs: I64Vec3) -> I64Vec3 {
988        (*self).div(rhs)
989    }
990}
991
992impl DivAssign for I64Vec3 {
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 I64Vec3 {
1002    #[inline]
1003    fn div_assign(&mut self, rhs: &Self) {
1004        self.div_assign(*rhs);
1005    }
1006}
1007
1008impl Div<i64> for I64Vec3 {
1009    type Output = Self;
1010    #[inline]
1011    fn div(self, rhs: i64) -> Self {
1012        Self::new(self.x.div(rhs), self.y.div(rhs), self.z.div(rhs))
1013    }
1014}
1015
1016impl Div<&i64> for I64Vec3 {
1017    type Output = Self;
1018    #[inline]
1019    fn div(self, rhs: &i64) -> Self {
1020        self.div(*rhs)
1021    }
1022}
1023
1024impl Div<&i64> for &I64Vec3 {
1025    type Output = I64Vec3;
1026    #[inline]
1027    fn div(self, rhs: &i64) -> I64Vec3 {
1028        (*self).div(*rhs)
1029    }
1030}
1031
1032impl Div<i64> for &I64Vec3 {
1033    type Output = I64Vec3;
1034    #[inline]
1035    fn div(self, rhs: i64) -> I64Vec3 {
1036        (*self).div(rhs)
1037    }
1038}
1039
1040impl DivAssign<i64> for I64Vec3 {
1041    #[inline]
1042    fn div_assign(&mut self, rhs: i64) {
1043        self.x.div_assign(rhs);
1044        self.y.div_assign(rhs);
1045        self.z.div_assign(rhs);
1046    }
1047}
1048
1049impl DivAssign<&i64> for I64Vec3 {
1050    #[inline]
1051    fn div_assign(&mut self, rhs: &i64) {
1052        self.div_assign(*rhs);
1053    }
1054}
1055
1056impl Div<I64Vec3> for i64 {
1057    type Output = I64Vec3;
1058    #[inline]
1059    fn div(self, rhs: I64Vec3) -> I64Vec3 {
1060        I64Vec3::new(self.div(rhs.x), self.div(rhs.y), self.div(rhs.z))
1061    }
1062}
1063
1064impl Div<&I64Vec3> for i64 {
1065    type Output = I64Vec3;
1066    #[inline]
1067    fn div(self, rhs: &I64Vec3) -> I64Vec3 {
1068        self.div(*rhs)
1069    }
1070}
1071
1072impl Div<&I64Vec3> for &i64 {
1073    type Output = I64Vec3;
1074    #[inline]
1075    fn div(self, rhs: &I64Vec3) -> I64Vec3 {
1076        (*self).div(*rhs)
1077    }
1078}
1079
1080impl Div<I64Vec3> for &i64 {
1081    type Output = I64Vec3;
1082    #[inline]
1083    fn div(self, rhs: I64Vec3) -> I64Vec3 {
1084        (*self).div(rhs)
1085    }
1086}
1087
1088impl Mul for I64Vec3 {
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 I64Vec3 {
1097    type Output = Self;
1098    #[inline]
1099    fn mul(self, rhs: &Self) -> Self {
1100        self.mul(*rhs)
1101    }
1102}
1103
1104impl Mul<&I64Vec3> for &I64Vec3 {
1105    type Output = I64Vec3;
1106    #[inline]
1107    fn mul(self, rhs: &I64Vec3) -> I64Vec3 {
1108        (*self).mul(*rhs)
1109    }
1110}
1111
1112impl Mul<I64Vec3> for &I64Vec3 {
1113    type Output = I64Vec3;
1114    #[inline]
1115    fn mul(self, rhs: I64Vec3) -> I64Vec3 {
1116        (*self).mul(rhs)
1117    }
1118}
1119
1120impl MulAssign for I64Vec3 {
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 I64Vec3 {
1130    #[inline]
1131    fn mul_assign(&mut self, rhs: &Self) {
1132        self.mul_assign(*rhs);
1133    }
1134}
1135
1136impl Mul<i64> for I64Vec3 {
1137    type Output = Self;
1138    #[inline]
1139    fn mul(self, rhs: i64) -> Self {
1140        Self::new(self.x.mul(rhs), self.y.mul(rhs), self.z.mul(rhs))
1141    }
1142}
1143
1144impl Mul<&i64> for I64Vec3 {
1145    type Output = Self;
1146    #[inline]
1147    fn mul(self, rhs: &i64) -> Self {
1148        self.mul(*rhs)
1149    }
1150}
1151
1152impl Mul<&i64> for &I64Vec3 {
1153    type Output = I64Vec3;
1154    #[inline]
1155    fn mul(self, rhs: &i64) -> I64Vec3 {
1156        (*self).mul(*rhs)
1157    }
1158}
1159
1160impl Mul<i64> for &I64Vec3 {
1161    type Output = I64Vec3;
1162    #[inline]
1163    fn mul(self, rhs: i64) -> I64Vec3 {
1164        (*self).mul(rhs)
1165    }
1166}
1167
1168impl MulAssign<i64> for I64Vec3 {
1169    #[inline]
1170    fn mul_assign(&mut self, rhs: i64) {
1171        self.x.mul_assign(rhs);
1172        self.y.mul_assign(rhs);
1173        self.z.mul_assign(rhs);
1174    }
1175}
1176
1177impl MulAssign<&i64> for I64Vec3 {
1178    #[inline]
1179    fn mul_assign(&mut self, rhs: &i64) {
1180        self.mul_assign(*rhs);
1181    }
1182}
1183
1184impl Mul<I64Vec3> for i64 {
1185    type Output = I64Vec3;
1186    #[inline]
1187    fn mul(self, rhs: I64Vec3) -> I64Vec3 {
1188        I64Vec3::new(self.mul(rhs.x), self.mul(rhs.y), self.mul(rhs.z))
1189    }
1190}
1191
1192impl Mul<&I64Vec3> for i64 {
1193    type Output = I64Vec3;
1194    #[inline]
1195    fn mul(self, rhs: &I64Vec3) -> I64Vec3 {
1196        self.mul(*rhs)
1197    }
1198}
1199
1200impl Mul<&I64Vec3> for &i64 {
1201    type Output = I64Vec3;
1202    #[inline]
1203    fn mul(self, rhs: &I64Vec3) -> I64Vec3 {
1204        (*self).mul(*rhs)
1205    }
1206}
1207
1208impl Mul<I64Vec3> for &i64 {
1209    type Output = I64Vec3;
1210    #[inline]
1211    fn mul(self, rhs: I64Vec3) -> I64Vec3 {
1212        (*self).mul(rhs)
1213    }
1214}
1215
1216impl Add for I64Vec3 {
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 I64Vec3 {
1225    type Output = Self;
1226    #[inline]
1227    fn add(self, rhs: &Self) -> Self {
1228        self.add(*rhs)
1229    }
1230}
1231
1232impl Add<&I64Vec3> for &I64Vec3 {
1233    type Output = I64Vec3;
1234    #[inline]
1235    fn add(self, rhs: &I64Vec3) -> I64Vec3 {
1236        (*self).add(*rhs)
1237    }
1238}
1239
1240impl Add<I64Vec3> for &I64Vec3 {
1241    type Output = I64Vec3;
1242    #[inline]
1243    fn add(self, rhs: I64Vec3) -> I64Vec3 {
1244        (*self).add(rhs)
1245    }
1246}
1247
1248impl AddAssign for I64Vec3 {
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 I64Vec3 {
1258    #[inline]
1259    fn add_assign(&mut self, rhs: &Self) {
1260        self.add_assign(*rhs);
1261    }
1262}
1263
1264impl Add<i64> for I64Vec3 {
1265    type Output = Self;
1266    #[inline]
1267    fn add(self, rhs: i64) -> Self {
1268        Self::new(self.x.add(rhs), self.y.add(rhs), self.z.add(rhs))
1269    }
1270}
1271
1272impl Add<&i64> for I64Vec3 {
1273    type Output = Self;
1274    #[inline]
1275    fn add(self, rhs: &i64) -> Self {
1276        self.add(*rhs)
1277    }
1278}
1279
1280impl Add<&i64> for &I64Vec3 {
1281    type Output = I64Vec3;
1282    #[inline]
1283    fn add(self, rhs: &i64) -> I64Vec3 {
1284        (*self).add(*rhs)
1285    }
1286}
1287
1288impl Add<i64> for &I64Vec3 {
1289    type Output = I64Vec3;
1290    #[inline]
1291    fn add(self, rhs: i64) -> I64Vec3 {
1292        (*self).add(rhs)
1293    }
1294}
1295
1296impl AddAssign<i64> for I64Vec3 {
1297    #[inline]
1298    fn add_assign(&mut self, rhs: i64) {
1299        self.x.add_assign(rhs);
1300        self.y.add_assign(rhs);
1301        self.z.add_assign(rhs);
1302    }
1303}
1304
1305impl AddAssign<&i64> for I64Vec3 {
1306    #[inline]
1307    fn add_assign(&mut self, rhs: &i64) {
1308        self.add_assign(*rhs);
1309    }
1310}
1311
1312impl Add<I64Vec3> for i64 {
1313    type Output = I64Vec3;
1314    #[inline]
1315    fn add(self, rhs: I64Vec3) -> I64Vec3 {
1316        I64Vec3::new(self.add(rhs.x), self.add(rhs.y), self.add(rhs.z))
1317    }
1318}
1319
1320impl Add<&I64Vec3> for i64 {
1321    type Output = I64Vec3;
1322    #[inline]
1323    fn add(self, rhs: &I64Vec3) -> I64Vec3 {
1324        self.add(*rhs)
1325    }
1326}
1327
1328impl Add<&I64Vec3> for &i64 {
1329    type Output = I64Vec3;
1330    #[inline]
1331    fn add(self, rhs: &I64Vec3) -> I64Vec3 {
1332        (*self).add(*rhs)
1333    }
1334}
1335
1336impl Add<I64Vec3> for &i64 {
1337    type Output = I64Vec3;
1338    #[inline]
1339    fn add(self, rhs: I64Vec3) -> I64Vec3 {
1340        (*self).add(rhs)
1341    }
1342}
1343
1344impl Sub for I64Vec3 {
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 I64Vec3 {
1353    type Output = Self;
1354    #[inline]
1355    fn sub(self, rhs: &Self) -> Self {
1356        self.sub(*rhs)
1357    }
1358}
1359
1360impl Sub<&I64Vec3> for &I64Vec3 {
1361    type Output = I64Vec3;
1362    #[inline]
1363    fn sub(self, rhs: &I64Vec3) -> I64Vec3 {
1364        (*self).sub(*rhs)
1365    }
1366}
1367
1368impl Sub<I64Vec3> for &I64Vec3 {
1369    type Output = I64Vec3;
1370    #[inline]
1371    fn sub(self, rhs: I64Vec3) -> I64Vec3 {
1372        (*self).sub(rhs)
1373    }
1374}
1375
1376impl SubAssign for I64Vec3 {
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 I64Vec3 {
1386    #[inline]
1387    fn sub_assign(&mut self, rhs: &Self) {
1388        self.sub_assign(*rhs);
1389    }
1390}
1391
1392impl Sub<i64> for I64Vec3 {
1393    type Output = Self;
1394    #[inline]
1395    fn sub(self, rhs: i64) -> Self {
1396        Self::new(self.x.sub(rhs), self.y.sub(rhs), self.z.sub(rhs))
1397    }
1398}
1399
1400impl Sub<&i64> for I64Vec3 {
1401    type Output = Self;
1402    #[inline]
1403    fn sub(self, rhs: &i64) -> Self {
1404        self.sub(*rhs)
1405    }
1406}
1407
1408impl Sub<&i64> for &I64Vec3 {
1409    type Output = I64Vec3;
1410    #[inline]
1411    fn sub(self, rhs: &i64) -> I64Vec3 {
1412        (*self).sub(*rhs)
1413    }
1414}
1415
1416impl Sub<i64> for &I64Vec3 {
1417    type Output = I64Vec3;
1418    #[inline]
1419    fn sub(self, rhs: i64) -> I64Vec3 {
1420        (*self).sub(rhs)
1421    }
1422}
1423
1424impl SubAssign<i64> for I64Vec3 {
1425    #[inline]
1426    fn sub_assign(&mut self, rhs: i64) {
1427        self.x.sub_assign(rhs);
1428        self.y.sub_assign(rhs);
1429        self.z.sub_assign(rhs);
1430    }
1431}
1432
1433impl SubAssign<&i64> for I64Vec3 {
1434    #[inline]
1435    fn sub_assign(&mut self, rhs: &i64) {
1436        self.sub_assign(*rhs);
1437    }
1438}
1439
1440impl Sub<I64Vec3> for i64 {
1441    type Output = I64Vec3;
1442    #[inline]
1443    fn sub(self, rhs: I64Vec3) -> I64Vec3 {
1444        I64Vec3::new(self.sub(rhs.x), self.sub(rhs.y), self.sub(rhs.z))
1445    }
1446}
1447
1448impl Sub<&I64Vec3> for i64 {
1449    type Output = I64Vec3;
1450    #[inline]
1451    fn sub(self, rhs: &I64Vec3) -> I64Vec3 {
1452        self.sub(*rhs)
1453    }
1454}
1455
1456impl Sub<&I64Vec3> for &i64 {
1457    type Output = I64Vec3;
1458    #[inline]
1459    fn sub(self, rhs: &I64Vec3) -> I64Vec3 {
1460        (*self).sub(*rhs)
1461    }
1462}
1463
1464impl Sub<I64Vec3> for &i64 {
1465    type Output = I64Vec3;
1466    #[inline]
1467    fn sub(self, rhs: I64Vec3) -> I64Vec3 {
1468        (*self).sub(rhs)
1469    }
1470}
1471
1472impl Rem for I64Vec3 {
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 I64Vec3 {
1481    type Output = Self;
1482    #[inline]
1483    fn rem(self, rhs: &Self) -> Self {
1484        self.rem(*rhs)
1485    }
1486}
1487
1488impl Rem<&I64Vec3> for &I64Vec3 {
1489    type Output = I64Vec3;
1490    #[inline]
1491    fn rem(self, rhs: &I64Vec3) -> I64Vec3 {
1492        (*self).rem(*rhs)
1493    }
1494}
1495
1496impl Rem<I64Vec3> for &I64Vec3 {
1497    type Output = I64Vec3;
1498    #[inline]
1499    fn rem(self, rhs: I64Vec3) -> I64Vec3 {
1500        (*self).rem(rhs)
1501    }
1502}
1503
1504impl RemAssign for I64Vec3 {
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 I64Vec3 {
1514    #[inline]
1515    fn rem_assign(&mut self, rhs: &Self) {
1516        self.rem_assign(*rhs);
1517    }
1518}
1519
1520impl Rem<i64> for I64Vec3 {
1521    type Output = Self;
1522    #[inline]
1523    fn rem(self, rhs: i64) -> Self {
1524        Self::new(self.x.rem(rhs), self.y.rem(rhs), self.z.rem(rhs))
1525    }
1526}
1527
1528impl Rem<&i64> for I64Vec3 {
1529    type Output = Self;
1530    #[inline]
1531    fn rem(self, rhs: &i64) -> Self {
1532        self.rem(*rhs)
1533    }
1534}
1535
1536impl Rem<&i64> for &I64Vec3 {
1537    type Output = I64Vec3;
1538    #[inline]
1539    fn rem(self, rhs: &i64) -> I64Vec3 {
1540        (*self).rem(*rhs)
1541    }
1542}
1543
1544impl Rem<i64> for &I64Vec3 {
1545    type Output = I64Vec3;
1546    #[inline]
1547    fn rem(self, rhs: i64) -> I64Vec3 {
1548        (*self).rem(rhs)
1549    }
1550}
1551
1552impl RemAssign<i64> for I64Vec3 {
1553    #[inline]
1554    fn rem_assign(&mut self, rhs: i64) {
1555        self.x.rem_assign(rhs);
1556        self.y.rem_assign(rhs);
1557        self.z.rem_assign(rhs);
1558    }
1559}
1560
1561impl RemAssign<&i64> for I64Vec3 {
1562    #[inline]
1563    fn rem_assign(&mut self, rhs: &i64) {
1564        self.rem_assign(*rhs);
1565    }
1566}
1567
1568impl Rem<I64Vec3> for i64 {
1569    type Output = I64Vec3;
1570    #[inline]
1571    fn rem(self, rhs: I64Vec3) -> I64Vec3 {
1572        I64Vec3::new(self.rem(rhs.x), self.rem(rhs.y), self.rem(rhs.z))
1573    }
1574}
1575
1576impl Rem<&I64Vec3> for i64 {
1577    type Output = I64Vec3;
1578    #[inline]
1579    fn rem(self, rhs: &I64Vec3) -> I64Vec3 {
1580        self.rem(*rhs)
1581    }
1582}
1583
1584impl Rem<&I64Vec3> for &i64 {
1585    type Output = I64Vec3;
1586    #[inline]
1587    fn rem(self, rhs: &I64Vec3) -> I64Vec3 {
1588        (*self).rem(*rhs)
1589    }
1590}
1591
1592impl Rem<I64Vec3> for &i64 {
1593    type Output = I64Vec3;
1594    #[inline]
1595    fn rem(self, rhs: I64Vec3) -> I64Vec3 {
1596        (*self).rem(rhs)
1597    }
1598}
1599
1600impl AsRef<[i64; 3]> for I64Vec3 {
1601    #[inline]
1602    fn as_ref(&self) -> &[i64; 3] {
1603        unsafe { &*(self as *const Self as *const [i64; 3]) }
1604    }
1605}
1606
1607impl AsMut<[i64; 3]> for I64Vec3 {
1608    #[inline]
1609    fn as_mut(&mut self) -> &mut [i64; 3] {
1610        unsafe { &mut *(self as *mut Self as *mut [i64; 3]) }
1611    }
1612}
1613
1614impl Sum for I64Vec3 {
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 I64Vec3 {
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 I64Vec3 {
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 I64Vec3 {
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 I64Vec3 {
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 &I64Vec3 {
1663    type Output = I64Vec3;
1664    #[inline]
1665    fn neg(self) -> I64Vec3 {
1666        (*self).neg()
1667    }
1668}
1669
1670impl Not for I64Vec3 {
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 &I64Vec3 {
1679    type Output = I64Vec3;
1680    #[inline]
1681    fn not(self) -> I64Vec3 {
1682        (*self).not()
1683    }
1684}
1685
1686impl BitAnd for I64Vec3 {
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 I64Vec3 {
1699    type Output = Self;
1700    #[inline]
1701    fn bitand(self, rhs: &Self) -> Self {
1702        self.bitand(*rhs)
1703    }
1704}
1705
1706impl BitAnd<&I64Vec3> for &I64Vec3 {
1707    type Output = I64Vec3;
1708    #[inline]
1709    fn bitand(self, rhs: &I64Vec3) -> I64Vec3 {
1710        (*self).bitand(*rhs)
1711    }
1712}
1713
1714impl BitAnd<I64Vec3> for &I64Vec3 {
1715    type Output = I64Vec3;
1716    #[inline]
1717    fn bitand(self, rhs: I64Vec3) -> I64Vec3 {
1718        (*self).bitand(rhs)
1719    }
1720}
1721
1722impl BitAndAssign for I64Vec3 {
1723    #[inline]
1724    fn bitand_assign(&mut self, rhs: Self) {
1725        *self = self.bitand(rhs);
1726    }
1727}
1728
1729impl BitAndAssign<&Self> for I64Vec3 {
1730    #[inline]
1731    fn bitand_assign(&mut self, rhs: &Self) {
1732        self.bitand_assign(*rhs);
1733    }
1734}
1735
1736impl BitOr for I64Vec3 {
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 I64Vec3 {
1749    type Output = Self;
1750    #[inline]
1751    fn bitor(self, rhs: &Self) -> Self {
1752        self.bitor(*rhs)
1753    }
1754}
1755
1756impl BitOr<&I64Vec3> for &I64Vec3 {
1757    type Output = I64Vec3;
1758    #[inline]
1759    fn bitor(self, rhs: &I64Vec3) -> I64Vec3 {
1760        (*self).bitor(*rhs)
1761    }
1762}
1763
1764impl BitOr<I64Vec3> for &I64Vec3 {
1765    type Output = I64Vec3;
1766    #[inline]
1767    fn bitor(self, rhs: I64Vec3) -> I64Vec3 {
1768        (*self).bitor(rhs)
1769    }
1770}
1771
1772impl BitOrAssign for I64Vec3 {
1773    #[inline]
1774    fn bitor_assign(&mut self, rhs: Self) {
1775        *self = self.bitor(rhs);
1776    }
1777}
1778
1779impl BitOrAssign<&Self> for I64Vec3 {
1780    #[inline]
1781    fn bitor_assign(&mut self, rhs: &Self) {
1782        self.bitor_assign(*rhs);
1783    }
1784}
1785
1786impl BitXor for I64Vec3 {
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 I64Vec3 {
1799    type Output = Self;
1800    #[inline]
1801    fn bitxor(self, rhs: &Self) -> Self {
1802        self.bitxor(*rhs)
1803    }
1804}
1805
1806impl BitXor<&I64Vec3> for &I64Vec3 {
1807    type Output = I64Vec3;
1808    #[inline]
1809    fn bitxor(self, rhs: &I64Vec3) -> I64Vec3 {
1810        (*self).bitxor(*rhs)
1811    }
1812}
1813
1814impl BitXor<I64Vec3> for &I64Vec3 {
1815    type Output = I64Vec3;
1816    #[inline]
1817    fn bitxor(self, rhs: I64Vec3) -> I64Vec3 {
1818        (*self).bitxor(rhs)
1819    }
1820}
1821
1822impl BitXorAssign for I64Vec3 {
1823    #[inline]
1824    fn bitxor_assign(&mut self, rhs: Self) {
1825        *self = self.bitxor(rhs);
1826    }
1827}
1828
1829impl BitXorAssign<&Self> for I64Vec3 {
1830    #[inline]
1831    fn bitxor_assign(&mut self, rhs: &Self) {
1832        self.bitxor_assign(*rhs);
1833    }
1834}
1835
1836impl BitAnd<i64> for I64Vec3 {
1837    type Output = Self;
1838    #[inline]
1839    fn bitand(self, rhs: i64) -> Self::Output {
1840        Self::new(self.x.bitand(rhs), self.y.bitand(rhs), self.z.bitand(rhs))
1841    }
1842}
1843
1844impl BitAnd<&i64> for I64Vec3 {
1845    type Output = Self;
1846    #[inline]
1847    fn bitand(self, rhs: &i64) -> Self {
1848        self.bitand(*rhs)
1849    }
1850}
1851
1852impl BitAnd<&i64> for &I64Vec3 {
1853    type Output = I64Vec3;
1854    #[inline]
1855    fn bitand(self, rhs: &i64) -> I64Vec3 {
1856        (*self).bitand(*rhs)
1857    }
1858}
1859
1860impl BitAnd<i64> for &I64Vec3 {
1861    type Output = I64Vec3;
1862    #[inline]
1863    fn bitand(self, rhs: i64) -> I64Vec3 {
1864        (*self).bitand(rhs)
1865    }
1866}
1867
1868impl BitAndAssign<i64> for I64Vec3 {
1869    #[inline]
1870    fn bitand_assign(&mut self, rhs: i64) {
1871        *self = self.bitand(rhs);
1872    }
1873}
1874
1875impl BitAndAssign<&i64> for I64Vec3 {
1876    #[inline]
1877    fn bitand_assign(&mut self, rhs: &i64) {
1878        self.bitand_assign(*rhs);
1879    }
1880}
1881
1882impl BitOr<i64> for I64Vec3 {
1883    type Output = Self;
1884    #[inline]
1885    fn bitor(self, rhs: i64) -> Self::Output {
1886        Self::new(self.x.bitor(rhs), self.y.bitor(rhs), self.z.bitor(rhs))
1887    }
1888}
1889
1890impl BitOr<&i64> for I64Vec3 {
1891    type Output = Self;
1892    #[inline]
1893    fn bitor(self, rhs: &i64) -> Self {
1894        self.bitor(*rhs)
1895    }
1896}
1897
1898impl BitOr<&i64> for &I64Vec3 {
1899    type Output = I64Vec3;
1900    #[inline]
1901    fn bitor(self, rhs: &i64) -> I64Vec3 {
1902        (*self).bitor(*rhs)
1903    }
1904}
1905
1906impl BitOr<i64> for &I64Vec3 {
1907    type Output = I64Vec3;
1908    #[inline]
1909    fn bitor(self, rhs: i64) -> I64Vec3 {
1910        (*self).bitor(rhs)
1911    }
1912}
1913
1914impl BitOrAssign<i64> for I64Vec3 {
1915    #[inline]
1916    fn bitor_assign(&mut self, rhs: i64) {
1917        *self = self.bitor(rhs);
1918    }
1919}
1920
1921impl BitOrAssign<&i64> for I64Vec3 {
1922    #[inline]
1923    fn bitor_assign(&mut self, rhs: &i64) {
1924        self.bitor_assign(*rhs);
1925    }
1926}
1927
1928impl BitXor<i64> for I64Vec3 {
1929    type Output = Self;
1930    #[inline]
1931    fn bitxor(self, rhs: i64) -> Self::Output {
1932        Self::new(self.x.bitxor(rhs), self.y.bitxor(rhs), self.z.bitxor(rhs))
1933    }
1934}
1935
1936impl BitXor<&i64> for I64Vec3 {
1937    type Output = Self;
1938    #[inline]
1939    fn bitxor(self, rhs: &i64) -> Self {
1940        self.bitxor(*rhs)
1941    }
1942}
1943
1944impl BitXor<&i64> for &I64Vec3 {
1945    type Output = I64Vec3;
1946    #[inline]
1947    fn bitxor(self, rhs: &i64) -> I64Vec3 {
1948        (*self).bitxor(*rhs)
1949    }
1950}
1951
1952impl BitXor<i64> for &I64Vec3 {
1953    type Output = I64Vec3;
1954    #[inline]
1955    fn bitxor(self, rhs: i64) -> I64Vec3 {
1956        (*self).bitxor(rhs)
1957    }
1958}
1959
1960impl BitXorAssign<i64> for I64Vec3 {
1961    #[inline]
1962    fn bitxor_assign(&mut self, rhs: i64) {
1963        *self = self.bitxor(rhs);
1964    }
1965}
1966
1967impl BitXorAssign<&i64> for I64Vec3 {
1968    #[inline]
1969    fn bitxor_assign(&mut self, rhs: &i64) {
1970        self.bitxor_assign(*rhs);
1971    }
1972}
1973
1974impl Shl<i8> for I64Vec3 {
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 I64Vec3 {
1983    type Output = Self;
1984    #[inline]
1985    fn shl(self, rhs: &i8) -> Self {
1986        self.shl(*rhs)
1987    }
1988}
1989
1990impl Shl<&i8> for &I64Vec3 {
1991    type Output = I64Vec3;
1992    #[inline]
1993    fn shl(self, rhs: &i8) -> I64Vec3 {
1994        (*self).shl(*rhs)
1995    }
1996}
1997
1998impl Shl<i8> for &I64Vec3 {
1999    type Output = I64Vec3;
2000    #[inline]
2001    fn shl(self, rhs: i8) -> I64Vec3 {
2002        (*self).shl(rhs)
2003    }
2004}
2005
2006impl ShlAssign<i8> for I64Vec3 {
2007    #[inline]
2008    fn shl_assign(&mut self, rhs: i8) {
2009        *self = self.shl(rhs);
2010    }
2011}
2012
2013impl ShlAssign<&i8> for I64Vec3 {
2014    #[inline]
2015    fn shl_assign(&mut self, rhs: &i8) {
2016        self.shl_assign(*rhs);
2017    }
2018}
2019
2020impl Shr<i8> for I64Vec3 {
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 I64Vec3 {
2029    type Output = Self;
2030    #[inline]
2031    fn shr(self, rhs: &i8) -> Self {
2032        self.shr(*rhs)
2033    }
2034}
2035
2036impl Shr<&i8> for &I64Vec3 {
2037    type Output = I64Vec3;
2038    #[inline]
2039    fn shr(self, rhs: &i8) -> I64Vec3 {
2040        (*self).shr(*rhs)
2041    }
2042}
2043
2044impl Shr<i8> for &I64Vec3 {
2045    type Output = I64Vec3;
2046    #[inline]
2047    fn shr(self, rhs: i8) -> I64Vec3 {
2048        (*self).shr(rhs)
2049    }
2050}
2051
2052impl ShrAssign<i8> for I64Vec3 {
2053    #[inline]
2054    fn shr_assign(&mut self, rhs: i8) {
2055        *self = self.shr(rhs);
2056    }
2057}
2058
2059impl ShrAssign<&i8> for I64Vec3 {
2060    #[inline]
2061    fn shr_assign(&mut self, rhs: &i8) {
2062        self.shr_assign(*rhs);
2063    }
2064}
2065
2066impl Shl<i16> for I64Vec3 {
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 I64Vec3 {
2075    type Output = Self;
2076    #[inline]
2077    fn shl(self, rhs: &i16) -> Self {
2078        self.shl(*rhs)
2079    }
2080}
2081
2082impl Shl<&i16> for &I64Vec3 {
2083    type Output = I64Vec3;
2084    #[inline]
2085    fn shl(self, rhs: &i16) -> I64Vec3 {
2086        (*self).shl(*rhs)
2087    }
2088}
2089
2090impl Shl<i16> for &I64Vec3 {
2091    type Output = I64Vec3;
2092    #[inline]
2093    fn shl(self, rhs: i16) -> I64Vec3 {
2094        (*self).shl(rhs)
2095    }
2096}
2097
2098impl ShlAssign<i16> for I64Vec3 {
2099    #[inline]
2100    fn shl_assign(&mut self, rhs: i16) {
2101        *self = self.shl(rhs);
2102    }
2103}
2104
2105impl ShlAssign<&i16> for I64Vec3 {
2106    #[inline]
2107    fn shl_assign(&mut self, rhs: &i16) {
2108        self.shl_assign(*rhs);
2109    }
2110}
2111
2112impl Shr<i16> for I64Vec3 {
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 I64Vec3 {
2121    type Output = Self;
2122    #[inline]
2123    fn shr(self, rhs: &i16) -> Self {
2124        self.shr(*rhs)
2125    }
2126}
2127
2128impl Shr<&i16> for &I64Vec3 {
2129    type Output = I64Vec3;
2130    #[inline]
2131    fn shr(self, rhs: &i16) -> I64Vec3 {
2132        (*self).shr(*rhs)
2133    }
2134}
2135
2136impl Shr<i16> for &I64Vec3 {
2137    type Output = I64Vec3;
2138    #[inline]
2139    fn shr(self, rhs: i16) -> I64Vec3 {
2140        (*self).shr(rhs)
2141    }
2142}
2143
2144impl ShrAssign<i16> for I64Vec3 {
2145    #[inline]
2146    fn shr_assign(&mut self, rhs: i16) {
2147        *self = self.shr(rhs);
2148    }
2149}
2150
2151impl ShrAssign<&i16> for I64Vec3 {
2152    #[inline]
2153    fn shr_assign(&mut self, rhs: &i16) {
2154        self.shr_assign(*rhs);
2155    }
2156}
2157
2158impl Shl<i32> for I64Vec3 {
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 I64Vec3 {
2167    type Output = Self;
2168    #[inline]
2169    fn shl(self, rhs: &i32) -> Self {
2170        self.shl(*rhs)
2171    }
2172}
2173
2174impl Shl<&i32> for &I64Vec3 {
2175    type Output = I64Vec3;
2176    #[inline]
2177    fn shl(self, rhs: &i32) -> I64Vec3 {
2178        (*self).shl(*rhs)
2179    }
2180}
2181
2182impl Shl<i32> for &I64Vec3 {
2183    type Output = I64Vec3;
2184    #[inline]
2185    fn shl(self, rhs: i32) -> I64Vec3 {
2186        (*self).shl(rhs)
2187    }
2188}
2189
2190impl ShlAssign<i32> for I64Vec3 {
2191    #[inline]
2192    fn shl_assign(&mut self, rhs: i32) {
2193        *self = self.shl(rhs);
2194    }
2195}
2196
2197impl ShlAssign<&i32> for I64Vec3 {
2198    #[inline]
2199    fn shl_assign(&mut self, rhs: &i32) {
2200        self.shl_assign(*rhs);
2201    }
2202}
2203
2204impl Shr<i32> for I64Vec3 {
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 I64Vec3 {
2213    type Output = Self;
2214    #[inline]
2215    fn shr(self, rhs: &i32) -> Self {
2216        self.shr(*rhs)
2217    }
2218}
2219
2220impl Shr<&i32> for &I64Vec3 {
2221    type Output = I64Vec3;
2222    #[inline]
2223    fn shr(self, rhs: &i32) -> I64Vec3 {
2224        (*self).shr(*rhs)
2225    }
2226}
2227
2228impl Shr<i32> for &I64Vec3 {
2229    type Output = I64Vec3;
2230    #[inline]
2231    fn shr(self, rhs: i32) -> I64Vec3 {
2232        (*self).shr(rhs)
2233    }
2234}
2235
2236impl ShrAssign<i32> for I64Vec3 {
2237    #[inline]
2238    fn shr_assign(&mut self, rhs: i32) {
2239        *self = self.shr(rhs);
2240    }
2241}
2242
2243impl ShrAssign<&i32> for I64Vec3 {
2244    #[inline]
2245    fn shr_assign(&mut self, rhs: &i32) {
2246        self.shr_assign(*rhs);
2247    }
2248}
2249
2250impl Shl<i64> for I64Vec3 {
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 I64Vec3 {
2259    type Output = Self;
2260    #[inline]
2261    fn shl(self, rhs: &i64) -> Self {
2262        self.shl(*rhs)
2263    }
2264}
2265
2266impl Shl<&i64> for &I64Vec3 {
2267    type Output = I64Vec3;
2268    #[inline]
2269    fn shl(self, rhs: &i64) -> I64Vec3 {
2270        (*self).shl(*rhs)
2271    }
2272}
2273
2274impl Shl<i64> for &I64Vec3 {
2275    type Output = I64Vec3;
2276    #[inline]
2277    fn shl(self, rhs: i64) -> I64Vec3 {
2278        (*self).shl(rhs)
2279    }
2280}
2281
2282impl ShlAssign<i64> for I64Vec3 {
2283    #[inline]
2284    fn shl_assign(&mut self, rhs: i64) {
2285        *self = self.shl(rhs);
2286    }
2287}
2288
2289impl ShlAssign<&i64> for I64Vec3 {
2290    #[inline]
2291    fn shl_assign(&mut self, rhs: &i64) {
2292        self.shl_assign(*rhs);
2293    }
2294}
2295
2296impl Shr<i64> for I64Vec3 {
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 I64Vec3 {
2305    type Output = Self;
2306    #[inline]
2307    fn shr(self, rhs: &i64) -> Self {
2308        self.shr(*rhs)
2309    }
2310}
2311
2312impl Shr<&i64> for &I64Vec3 {
2313    type Output = I64Vec3;
2314    #[inline]
2315    fn shr(self, rhs: &i64) -> I64Vec3 {
2316        (*self).shr(*rhs)
2317    }
2318}
2319
2320impl Shr<i64> for &I64Vec3 {
2321    type Output = I64Vec3;
2322    #[inline]
2323    fn shr(self, rhs: i64) -> I64Vec3 {
2324        (*self).shr(rhs)
2325    }
2326}
2327
2328impl ShrAssign<i64> for I64Vec3 {
2329    #[inline]
2330    fn shr_assign(&mut self, rhs: i64) {
2331        *self = self.shr(rhs);
2332    }
2333}
2334
2335impl ShrAssign<&i64> for I64Vec3 {
2336    #[inline]
2337    fn shr_assign(&mut self, rhs: &i64) {
2338        self.shr_assign(*rhs);
2339    }
2340}
2341
2342impl Shl<u8> for I64Vec3 {
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 I64Vec3 {
2351    type Output = Self;
2352    #[inline]
2353    fn shl(self, rhs: &u8) -> Self {
2354        self.shl(*rhs)
2355    }
2356}
2357
2358impl Shl<&u8> for &I64Vec3 {
2359    type Output = I64Vec3;
2360    #[inline]
2361    fn shl(self, rhs: &u8) -> I64Vec3 {
2362        (*self).shl(*rhs)
2363    }
2364}
2365
2366impl Shl<u8> for &I64Vec3 {
2367    type Output = I64Vec3;
2368    #[inline]
2369    fn shl(self, rhs: u8) -> I64Vec3 {
2370        (*self).shl(rhs)
2371    }
2372}
2373
2374impl ShlAssign<u8> for I64Vec3 {
2375    #[inline]
2376    fn shl_assign(&mut self, rhs: u8) {
2377        *self = self.shl(rhs);
2378    }
2379}
2380
2381impl ShlAssign<&u8> for I64Vec3 {
2382    #[inline]
2383    fn shl_assign(&mut self, rhs: &u8) {
2384        self.shl_assign(*rhs);
2385    }
2386}
2387
2388impl Shr<u8> for I64Vec3 {
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 I64Vec3 {
2397    type Output = Self;
2398    #[inline]
2399    fn shr(self, rhs: &u8) -> Self {
2400        self.shr(*rhs)
2401    }
2402}
2403
2404impl Shr<&u8> for &I64Vec3 {
2405    type Output = I64Vec3;
2406    #[inline]
2407    fn shr(self, rhs: &u8) -> I64Vec3 {
2408        (*self).shr(*rhs)
2409    }
2410}
2411
2412impl Shr<u8> for &I64Vec3 {
2413    type Output = I64Vec3;
2414    #[inline]
2415    fn shr(self, rhs: u8) -> I64Vec3 {
2416        (*self).shr(rhs)
2417    }
2418}
2419
2420impl ShrAssign<u8> for I64Vec3 {
2421    #[inline]
2422    fn shr_assign(&mut self, rhs: u8) {
2423        *self = self.shr(rhs);
2424    }
2425}
2426
2427impl ShrAssign<&u8> for I64Vec3 {
2428    #[inline]
2429    fn shr_assign(&mut self, rhs: &u8) {
2430        self.shr_assign(*rhs);
2431    }
2432}
2433
2434impl Shl<u16> for I64Vec3 {
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 I64Vec3 {
2443    type Output = Self;
2444    #[inline]
2445    fn shl(self, rhs: &u16) -> Self {
2446        self.shl(*rhs)
2447    }
2448}
2449
2450impl Shl<&u16> for &I64Vec3 {
2451    type Output = I64Vec3;
2452    #[inline]
2453    fn shl(self, rhs: &u16) -> I64Vec3 {
2454        (*self).shl(*rhs)
2455    }
2456}
2457
2458impl Shl<u16> for &I64Vec3 {
2459    type Output = I64Vec3;
2460    #[inline]
2461    fn shl(self, rhs: u16) -> I64Vec3 {
2462        (*self).shl(rhs)
2463    }
2464}
2465
2466impl ShlAssign<u16> for I64Vec3 {
2467    #[inline]
2468    fn shl_assign(&mut self, rhs: u16) {
2469        *self = self.shl(rhs);
2470    }
2471}
2472
2473impl ShlAssign<&u16> for I64Vec3 {
2474    #[inline]
2475    fn shl_assign(&mut self, rhs: &u16) {
2476        self.shl_assign(*rhs);
2477    }
2478}
2479
2480impl Shr<u16> for I64Vec3 {
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 I64Vec3 {
2489    type Output = Self;
2490    #[inline]
2491    fn shr(self, rhs: &u16) -> Self {
2492        self.shr(*rhs)
2493    }
2494}
2495
2496impl Shr<&u16> for &I64Vec3 {
2497    type Output = I64Vec3;
2498    #[inline]
2499    fn shr(self, rhs: &u16) -> I64Vec3 {
2500        (*self).shr(*rhs)
2501    }
2502}
2503
2504impl Shr<u16> for &I64Vec3 {
2505    type Output = I64Vec3;
2506    #[inline]
2507    fn shr(self, rhs: u16) -> I64Vec3 {
2508        (*self).shr(rhs)
2509    }
2510}
2511
2512impl ShrAssign<u16> for I64Vec3 {
2513    #[inline]
2514    fn shr_assign(&mut self, rhs: u16) {
2515        *self = self.shr(rhs);
2516    }
2517}
2518
2519impl ShrAssign<&u16> for I64Vec3 {
2520    #[inline]
2521    fn shr_assign(&mut self, rhs: &u16) {
2522        self.shr_assign(*rhs);
2523    }
2524}
2525
2526impl Shl<u32> for I64Vec3 {
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 I64Vec3 {
2535    type Output = Self;
2536    #[inline]
2537    fn shl(self, rhs: &u32) -> Self {
2538        self.shl(*rhs)
2539    }
2540}
2541
2542impl Shl<&u32> for &I64Vec3 {
2543    type Output = I64Vec3;
2544    #[inline]
2545    fn shl(self, rhs: &u32) -> I64Vec3 {
2546        (*self).shl(*rhs)
2547    }
2548}
2549
2550impl Shl<u32> for &I64Vec3 {
2551    type Output = I64Vec3;
2552    #[inline]
2553    fn shl(self, rhs: u32) -> I64Vec3 {
2554        (*self).shl(rhs)
2555    }
2556}
2557
2558impl ShlAssign<u32> for I64Vec3 {
2559    #[inline]
2560    fn shl_assign(&mut self, rhs: u32) {
2561        *self = self.shl(rhs);
2562    }
2563}
2564
2565impl ShlAssign<&u32> for I64Vec3 {
2566    #[inline]
2567    fn shl_assign(&mut self, rhs: &u32) {
2568        self.shl_assign(*rhs);
2569    }
2570}
2571
2572impl Shr<u32> for I64Vec3 {
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 I64Vec3 {
2581    type Output = Self;
2582    #[inline]
2583    fn shr(self, rhs: &u32) -> Self {
2584        self.shr(*rhs)
2585    }
2586}
2587
2588impl Shr<&u32> for &I64Vec3 {
2589    type Output = I64Vec3;
2590    #[inline]
2591    fn shr(self, rhs: &u32) -> I64Vec3 {
2592        (*self).shr(*rhs)
2593    }
2594}
2595
2596impl Shr<u32> for &I64Vec3 {
2597    type Output = I64Vec3;
2598    #[inline]
2599    fn shr(self, rhs: u32) -> I64Vec3 {
2600        (*self).shr(rhs)
2601    }
2602}
2603
2604impl ShrAssign<u32> for I64Vec3 {
2605    #[inline]
2606    fn shr_assign(&mut self, rhs: u32) {
2607        *self = self.shr(rhs);
2608    }
2609}
2610
2611impl ShrAssign<&u32> for I64Vec3 {
2612    #[inline]
2613    fn shr_assign(&mut self, rhs: &u32) {
2614        self.shr_assign(*rhs);
2615    }
2616}
2617
2618impl Shl<u64> for I64Vec3 {
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 I64Vec3 {
2627    type Output = Self;
2628    #[inline]
2629    fn shl(self, rhs: &u64) -> Self {
2630        self.shl(*rhs)
2631    }
2632}
2633
2634impl Shl<&u64> for &I64Vec3 {
2635    type Output = I64Vec3;
2636    #[inline]
2637    fn shl(self, rhs: &u64) -> I64Vec3 {
2638        (*self).shl(*rhs)
2639    }
2640}
2641
2642impl Shl<u64> for &I64Vec3 {
2643    type Output = I64Vec3;
2644    #[inline]
2645    fn shl(self, rhs: u64) -> I64Vec3 {
2646        (*self).shl(rhs)
2647    }
2648}
2649
2650impl ShlAssign<u64> for I64Vec3 {
2651    #[inline]
2652    fn shl_assign(&mut self, rhs: u64) {
2653        *self = self.shl(rhs);
2654    }
2655}
2656
2657impl ShlAssign<&u64> for I64Vec3 {
2658    #[inline]
2659    fn shl_assign(&mut self, rhs: &u64) {
2660        self.shl_assign(*rhs);
2661    }
2662}
2663
2664impl Shr<u64> for I64Vec3 {
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 I64Vec3 {
2673    type Output = Self;
2674    #[inline]
2675    fn shr(self, rhs: &u64) -> Self {
2676        self.shr(*rhs)
2677    }
2678}
2679
2680impl Shr<&u64> for &I64Vec3 {
2681    type Output = I64Vec3;
2682    #[inline]
2683    fn shr(self, rhs: &u64) -> I64Vec3 {
2684        (*self).shr(*rhs)
2685    }
2686}
2687
2688impl Shr<u64> for &I64Vec3 {
2689    type Output = I64Vec3;
2690    #[inline]
2691    fn shr(self, rhs: u64) -> I64Vec3 {
2692        (*self).shr(rhs)
2693    }
2694}
2695
2696impl ShrAssign<u64> for I64Vec3 {
2697    #[inline]
2698    fn shr_assign(&mut self, rhs: u64) {
2699        *self = self.shr(rhs);
2700    }
2701}
2702
2703impl ShrAssign<&u64> for I64Vec3 {
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 I64Vec3 {
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 I64Vec3 {
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 &I64Vec3 {
2730    type Output = I64Vec3;
2731    #[inline]
2732    fn shl(self, rhs: &IVec3) -> I64Vec3 {
2733        (*self).shl(*rhs)
2734    }
2735}
2736
2737#[cfg(feature = "i32")]
2738impl Shl<IVec3> for &I64Vec3 {
2739    type Output = I64Vec3;
2740    #[inline]
2741    fn shl(self, rhs: IVec3) -> I64Vec3 {
2742        (*self).shl(rhs)
2743    }
2744}
2745
2746#[cfg(feature = "i32")]
2747impl Shr<IVec3> for I64Vec3 {
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 I64Vec3 {
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 &I64Vec3 {
2766    type Output = I64Vec3;
2767    #[inline]
2768    fn shr(self, rhs: &IVec3) -> I64Vec3 {
2769        (*self).shr(*rhs)
2770    }
2771}
2772
2773#[cfg(feature = "i32")]
2774impl Shr<IVec3> for &I64Vec3 {
2775    type Output = I64Vec3;
2776    #[inline]
2777    fn shr(self, rhs: IVec3) -> I64Vec3 {
2778        (*self).shr(rhs)
2779    }
2780}
2781
2782#[cfg(feature = "u32")]
2783impl Shl<UVec3> for I64Vec3 {
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 I64Vec3 {
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 &I64Vec3 {
2802    type Output = I64Vec3;
2803    #[inline]
2804    fn shl(self, rhs: &UVec3) -> I64Vec3 {
2805        (*self).shl(*rhs)
2806    }
2807}
2808
2809#[cfg(feature = "u32")]
2810impl Shl<UVec3> for &I64Vec3 {
2811    type Output = I64Vec3;
2812    #[inline]
2813    fn shl(self, rhs: UVec3) -> I64Vec3 {
2814        (*self).shl(rhs)
2815    }
2816}
2817
2818#[cfg(feature = "u32")]
2819impl Shr<UVec3> for I64Vec3 {
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 I64Vec3 {
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 &I64Vec3 {
2838    type Output = I64Vec3;
2839    #[inline]
2840    fn shr(self, rhs: &UVec3) -> I64Vec3 {
2841        (*self).shr(*rhs)
2842    }
2843}
2844
2845#[cfg(feature = "u32")]
2846impl Shr<UVec3> for &I64Vec3 {
2847    type Output = I64Vec3;
2848    #[inline]
2849    fn shr(self, rhs: UVec3) -> I64Vec3 {
2850        (*self).shr(rhs)
2851    }
2852}
2853
2854impl Index<usize> for I64Vec3 {
2855    type Output = i64;
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 I64Vec3 {
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 I64Vec3 {
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 I64Vec3 {
2888    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
2889        fmt.debug_tuple(stringify!(I64Vec3))
2890            .field(&self.x)
2891            .field(&self.y)
2892            .field(&self.z)
2893            .finish()
2894    }
2895}
2896
2897impl From<[i64; 3]> for I64Vec3 {
2898    #[inline]
2899    fn from(a: [i64; 3]) -> Self {
2900        Self::new(a[0], a[1], a[2])
2901    }
2902}
2903
2904impl From<I64Vec3> for [i64; 3] {
2905    #[inline]
2906    fn from(v: I64Vec3) -> Self {
2907        [v.x, v.y, v.z]
2908    }
2909}
2910
2911impl From<(i64, i64, i64)> for I64Vec3 {
2912    #[inline]
2913    fn from(t: (i64, i64, i64)) -> Self {
2914        Self::new(t.0, t.1, t.2)
2915    }
2916}
2917
2918impl From<I64Vec3> for (i64, i64, i64) {
2919    #[inline]
2920    fn from(v: I64Vec3) -> Self {
2921        (v.x, v.y, v.z)
2922    }
2923}
2924
2925impl From<(I64Vec2, i64)> for I64Vec3 {
2926    #[inline]
2927    fn from((v, z): (I64Vec2, i64)) -> Self {
2928        Self::new(v.x, v.y, z)
2929    }
2930}
2931
2932#[cfg(feature = "i8")]
2933impl From<I8Vec3> for I64Vec3 {
2934    #[inline]
2935    fn from(v: I8Vec3) -> Self {
2936        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
2937    }
2938}
2939
2940#[cfg(feature = "u8")]
2941impl From<U8Vec3> for I64Vec3 {
2942    #[inline]
2943    fn from(v: U8Vec3) -> Self {
2944        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
2945    }
2946}
2947
2948#[cfg(feature = "i16")]
2949impl From<I16Vec3> for I64Vec3 {
2950    #[inline]
2951    fn from(v: I16Vec3) -> Self {
2952        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
2953    }
2954}
2955
2956#[cfg(feature = "u16")]
2957impl From<U16Vec3> for I64Vec3 {
2958    #[inline]
2959    fn from(v: U16Vec3) -> Self {
2960        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
2961    }
2962}
2963
2964#[cfg(feature = "i32")]
2965impl From<IVec3> for I64Vec3 {
2966    #[inline]
2967    fn from(v: IVec3) -> Self {
2968        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
2969    }
2970}
2971
2972#[cfg(feature = "u32")]
2973impl From<UVec3> for I64Vec3 {
2974    #[inline]
2975    fn from(v: UVec3) -> Self {
2976        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
2977    }
2978}
2979
2980#[cfg(feature = "u64")]
2981impl TryFrom<U64Vec3> for I64Vec3 {
2982    type Error = core::num::TryFromIntError;
2983
2984    #[inline]
2985    fn try_from(v: U64Vec3) -> Result<Self, Self::Error> {
2986        Ok(Self::new(
2987            i64::try_from(v.x)?,
2988            i64::try_from(v.y)?,
2989            i64::try_from(v.z)?,
2990        ))
2991    }
2992}
2993
2994#[cfg(feature = "isize")]
2995impl TryFrom<ISizeVec3> for I64Vec3 {
2996    type Error = core::num::TryFromIntError;
2997
2998    #[inline]
2999    fn try_from(v: ISizeVec3) -> Result<Self, Self::Error> {
3000        Ok(Self::new(
3001            i64::try_from(v.x)?,
3002            i64::try_from(v.y)?,
3003            i64::try_from(v.z)?,
3004        ))
3005    }
3006}
3007
3008#[cfg(feature = "usize")]
3009impl TryFrom<USizeVec3> for I64Vec3 {
3010    type Error = core::num::TryFromIntError;
3011
3012    #[inline]
3013    fn try_from(v: USizeVec3) -> Result<Self, Self::Error> {
3014        Ok(Self::new(
3015            i64::try_from(v.x)?,
3016            i64::try_from(v.y)?,
3017            i64::try_from(v.z)?,
3018        ))
3019    }
3020}
3021
3022impl From<BVec3> for I64Vec3 {
3023    #[inline]
3024    fn from(v: BVec3) -> Self {
3025        Self::new(i64::from(v.x), i64::from(v.y), i64::from(v.z))
3026    }
3027}
3028
3029impl From<BVec3A> for I64Vec3 {
3030    #[inline]
3031    fn from(v: BVec3A) -> Self {
3032        let bool_array: [bool; 3] = v.into();
3033        Self::new(
3034            i64::from(bool_array[0]),
3035            i64::from(bool_array[1]),
3036            i64::from(bool_array[2]),
3037        )
3038    }
3039}