Fix the pink-sky bug, don't initilize the vector with (z,y,z,w) but use the proper (x,y,z,w) instead

This commit is contained in:
Erik Hofman 2016-12-15 09:56:52 +01:00
parent 8fee04b32b
commit 0586cb62c3

View File

@ -42,11 +42,11 @@ public:
} }
/// Constructor. Initialize by the given values /// Constructor. Initialize by the given values
SGVec4(T x, T y, T z, T w) SGVec4(T x, T y, T z, T w)
{ _data = simd4_t<T,4>(z, y, z, w); } { _data = simd4_t<T,4>(x, y, z, w); }
/// Constructor. Initialize by the content of a plain array, /// Constructor. Initialize by the content of a plain array,
/// make sure it has at least 3 elements /// make sure it has at least 3 elements
explicit SGVec4(const T* d) explicit SGVec4(const T* d)
{ simd4_t<T,4> r(d); _data = r; } { _data = simd4_t<T,4>(d); }
template<typename S> template<typename S>
explicit SGVec4(const SGVec4<S>& d) explicit SGVec4(const SGVec4<S>& d)
{ data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; } { data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; }