MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / Subvec2D

Class Subvec2D

TSAlgebra.h:190–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189 template <typename type_struct, int count, int index_x, int index_y>
190 class Subvec2D
191 {
192 public:
193
194 typedef typename type_struct::component_type component_type;
195 typedef typename type_struct::vector2D_type vector2D_type;
196
197 component_type data[count];
198
199 Subvec2D& Set(const component_type& x, const component_type& y)
200 {
201 data[index_x] = x;
202 data[index_y] = y;
203 return (*this);
204 }
205
206 void Set(const component_type& x, const component_type& y) volatile
207 {
208 data[index_x] = x;
209 data[index_y] = y;
210 }
211
212 operator typename ConverterVector2D<type_struct, index_x, index_y>::vector2D_type(void)
213 {
214 return (ConverterVector2D<type_struct, index_x, index_y>::Convert(data));
215 }
216
217 operator typename ConverterVector2D<type_struct, index_x, index_y>::const_vector2D_type(void) const
218 {
219 return (ConverterVector2D<type_struct, index_x, index_y>::Convert(data));
220 }
221
222 Subvec2D& operator =(const vector2D_type& value)
223 {
224 data[index_x] = value.x;
225 data[index_y] = value.y;
226 return (*this);
227 }
228
229 void operator =(const vector2D_type& value) volatile
230 {
231 data[index_x] = value.x;
232 data[index_y] = value.y;
233 }
234
235 Subvec2D& operator =(const Subvec2D& value)
236 {
237 data[index_x] = value.data[index_x];
238 data[index_y] = value.data[index_y];
239 return (*this);
240 }
241
242 void operator =(const Subvec2D& value) volatile
243 {
244 data[index_x] = value.data[index_x];
245 data[index_y] = value.data[index_y];
246 }
247

Callers

nothing calls this directly

Calls 1

InverseSqrtFunction · 0.85

Tested by

no test coverage detected