| 84 | |
| 85 | template <class T> |
| 86 | static IMATH_NAMESPACE::Vec4<T> |
| 87 | Vec4Array_max(const FixedArray<IMATH_NAMESPACE::Vec4<T> > &a) |
| 88 | { |
| 89 | Vec4<T> tmp(Vec4<T>(0)); |
| 90 | size_t len = a.len(); |
| 91 | if (len > 0) |
| 92 | tmp = a[0]; |
| 93 | for (size_t i=1; i < len; ++i) |
| 94 | { |
| 95 | if (a[i].x > tmp.x) |
| 96 | tmp.x = a[i].x; |
| 97 | if (a[i].y > tmp.y) |
| 98 | tmp.y = a[i].y; |
| 99 | if (a[i].z > tmp.z) |
| 100 | tmp.z = a[i].z; |
| 101 | if (a[i].w > tmp.w) |
| 102 | tmp.w = a[i].w; |
| 103 | } |
| 104 | return tmp; |
| 105 | } |
| 106 | |
| 107 | |
| 108 | // Trick to register methods for float-only-based vectors |