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

Class Subvec4D

TSAlgebra.h:640–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638 template <typename type_struct, int index_x, int index_y, int index_z, int index_w>
639 struct ConverterVector4D
640 {
641 typedef typename type_struct::component_type component_type;
642 typedef typename type_struct::vector4D_type vector4D_type;
643 typedef typename type_struct::vector4D_type const_vector4D_type;
644
645 static vector4D_type Convert(component_type *data)
646 {
647 return (vector4D_type(data[index_x], data[index_y], data[index_z], data[index_w]));
648 }
649
650 static const_vector4D_type Convert(const component_type *data)
651 {
652 return (const_vector4D_type(data[index_x], data[index_y], data[index_z], data[index_w]));
653 }
654 };
655
656 template <typename type_struct>
657 struct ConverterVector4D<type_struct, 0, 1, 2, 3>
658 {
659 typedef typename type_struct::component_type component_type;
660 typedef typename type_struct::vector4D_type& vector4D_type;
661 typedef const typename type_struct::vector4D_type& const_vector4D_type;
662
663 static vector4D_type Convert(component_type *data)
664 {
665 return (reinterpret_cast<vector4D_type>(data[0]));
666 }
667
668 static const_vector4D_type Convert(const component_type *data)
669 {
670 return (reinterpret_cast<const_vector4D_type>(data[0]));
671 }
672 };
673
674 template <typename type_struct>
675 struct ConverterVector4D<type_struct, 4, 5, 6, 7>
676 {
677 typedef typename type_struct::component_type component_type;
678 typedef typename type_struct::vector4D_type& vector4D_type;
679 typedef const typename type_struct::vector4D_type& const_vector4D_type;
680
681 static vector4D_type Convert(component_type *data)
682 {
683 return (reinterpret_cast<vector4D_type>(data[4]));
684 }
685
686 static const_vector4D_type Convert(const component_type *data)
687 {
688 return (reinterpret_cast<const_vector4D_type>(data[4]));
689 }
690 };
691
692 template <typename type_struct>
693 struct ConverterVector4D<type_struct, 8, 9, 10, 11>
694 {
695 typedef typename type_struct::component_type component_type;
696 typedef typename type_struct::vector4D_type& vector4D_type;
697 typedef const typename type_struct::vector4D_type& const_vector4D_type;

Callers

nothing calls this directly

Calls 1

InverseSqrtFunction · 0.85

Tested by

no test coverage detected