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

Class Subvec3D

TSAlgebra.h:415–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 template <typename type_struct>
414 struct ConverterVector3D<type_struct, 3, 4, 5>
415 {
416 typedef typename type_struct::component_type component_type;
417 typedef typename type_struct::vector3D_type& vector3D_type;
418 typedef const typename type_struct::vector3D_type& const_vector3D_type;
419
420 static vector3D_type Convert(component_type *data)
421 {
422 return (reinterpret_cast<vector3D_type>(data[3]));
423 }
424
425 static const_vector3D_type Convert(const component_type *data)
426 {
427 return (reinterpret_cast<const_vector3D_type>(data[3]));
428 }
429 };
430
431 template <typename type_struct>
432 struct ConverterVector3D<type_struct, 6, 7, 8>
433 {
434 typedef typename type_struct::component_type component_type;
435 typedef typename type_struct::vector3D_type& vector3D_type;
436 typedef const typename type_struct::vector3D_type& const_vector3D_type;
437
438 static vector3D_type Convert(component_type *data)
439 {
440 return (reinterpret_cast<vector3D_type>(data[6]));
441 }
442
443 static const_vector3D_type Convert(const component_type *data)
444 {
445 return (reinterpret_cast<const_vector3D_type>(data[6]));
446 }
447 };
448
449
450 template <typename type_struct, bool anti, int count, int index_x, int index_y, int index_z>
451 class Subvec3D
452 {
453 public:
454
455 typedef typename type_struct::component_type component_type;
456 typedef typename type_struct::vector3D_type vector3D_type;
457
458 component_type data[count];
459
460 Subvec3D& Set(const component_type& x, const component_type& y, const component_type& z)
461 {
462 data[index_x] = x;
463 data[index_y] = y;
464 data[index_z] = z;
465 return (*this);
466 }
467
468 void Set(const component_type& x, const component_type& y, const component_type& z) volatile
469 {
470 data[index_x] = x;
471 data[index_y] = y;
472 data[index_z] = z;

Callers

nothing calls this directly

Calls 1

InverseSqrtFunction · 0.85

Tested by

no test coverage detected