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