1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// swizzle characters: ['x', 'y']
use super::*;
impl Vec2 {
  /// Swizzle: obtains the `xx` combination
  pub fn xx(self) -> Self {
    Self {
      x: self.x,
      y: self.x,
    }
  }
  /// Swizzle: obtains the `xy` combination
  pub fn xy(self) -> Self {
    Self {
      x: self.x,
      y: self.y,
    }
  }
  /// Swizzle: obtains the `yx` combination
  pub fn yx(self) -> Self {
    Self {
      x: self.y,
      y: self.x,
    }
  }
  /// Swizzle: obtains the `yy` combination
  pub fn yy(self) -> Self {
    Self {
      x: self.y,
      y: self.y,
    }
  }
}