glam/swizzles/
vec2_impl.rs

1// Generated from swizzle_impl.rs.tera template. Edit the template, not the generated file.
2
3use crate::{Vec2, Vec2Swizzles, Vec3, Vec4};
4
5impl Vec2Swizzles for Vec2 {
6    type Vec3 = Vec3;
7
8    type Vec4 = Vec4;
9
10    #[inline]
11    fn xx(self) -> Vec2 {
12        Vec2 {
13            x: self.x,
14            y: self.x,
15        }
16    }
17
18    #[inline]
19    fn yx(self) -> Vec2 {
20        Vec2 {
21            x: self.y,
22            y: self.x,
23        }
24    }
25
26    #[inline]
27    fn yy(self) -> Vec2 {
28        Vec2 {
29            x: self.y,
30            y: self.y,
31        }
32    }
33
34    #[inline]
35    fn xxx(self) -> Vec3 {
36        Vec3::new(self.x, self.x, self.x)
37    }
38
39    #[inline]
40    fn xxy(self) -> Vec3 {
41        Vec3::new(self.x, self.x, self.y)
42    }
43
44    #[inline]
45    fn xyx(self) -> Vec3 {
46        Vec3::new(self.x, self.y, self.x)
47    }
48
49    #[inline]
50    fn xyy(self) -> Vec3 {
51        Vec3::new(self.x, self.y, self.y)
52    }
53
54    #[inline]
55    fn yxx(self) -> Vec3 {
56        Vec3::new(self.y, self.x, self.x)
57    }
58
59    #[inline]
60    fn yxy(self) -> Vec3 {
61        Vec3::new(self.y, self.x, self.y)
62    }
63
64    #[inline]
65    fn yyx(self) -> Vec3 {
66        Vec3::new(self.y, self.y, self.x)
67    }
68
69    #[inline]
70    fn yyy(self) -> Vec3 {
71        Vec3::new(self.y, self.y, self.y)
72    }
73
74    #[inline]
75    fn xxxx(self) -> Vec4 {
76        Vec4::new(self.x, self.x, self.x, self.x)
77    }
78
79    #[inline]
80    fn xxxy(self) -> Vec4 {
81        Vec4::new(self.x, self.x, self.x, self.y)
82    }
83
84    #[inline]
85    fn xxyx(self) -> Vec4 {
86        Vec4::new(self.x, self.x, self.y, self.x)
87    }
88
89    #[inline]
90    fn xxyy(self) -> Vec4 {
91        Vec4::new(self.x, self.x, self.y, self.y)
92    }
93
94    #[inline]
95    fn xyxx(self) -> Vec4 {
96        Vec4::new(self.x, self.y, self.x, self.x)
97    }
98
99    #[inline]
100    fn xyxy(self) -> Vec4 {
101        Vec4::new(self.x, self.y, self.x, self.y)
102    }
103
104    #[inline]
105    fn xyyx(self) -> Vec4 {
106        Vec4::new(self.x, self.y, self.y, self.x)
107    }
108
109    #[inline]
110    fn xyyy(self) -> Vec4 {
111        Vec4::new(self.x, self.y, self.y, self.y)
112    }
113
114    #[inline]
115    fn yxxx(self) -> Vec4 {
116        Vec4::new(self.y, self.x, self.x, self.x)
117    }
118
119    #[inline]
120    fn yxxy(self) -> Vec4 {
121        Vec4::new(self.y, self.x, self.x, self.y)
122    }
123
124    #[inline]
125    fn yxyx(self) -> Vec4 {
126        Vec4::new(self.y, self.x, self.y, self.x)
127    }
128
129    #[inline]
130    fn yxyy(self) -> Vec4 {
131        Vec4::new(self.y, self.x, self.y, self.y)
132    }
133
134    #[inline]
135    fn yyxx(self) -> Vec4 {
136        Vec4::new(self.y, self.y, self.x, self.x)
137    }
138
139    #[inline]
140    fn yyxy(self) -> Vec4 {
141        Vec4::new(self.y, self.y, self.x, self.y)
142    }
143
144    #[inline]
145    fn yyyx(self) -> Vec4 {
146        Vec4::new(self.y, self.y, self.y, self.x)
147    }
148
149    #[inline]
150    fn yyyy(self) -> Vec4 {
151        Vec4::new(self.y, self.y, self.y, self.y)
152    }
153}