fix missing template parameters in new vector
parent
e1ace0d64d
commit
1d7775a742
|
@ -83,7 +83,7 @@ namespace blt {
|
|||
inline mat4x4& scale(const vec4& vec) { return scale(vec[0], vec[1], vec[2]); }
|
||||
inline mat4x4& scale(const vec3& vec) { return scale(vec[0], vec[1], vec[2]); }
|
||||
|
||||
mat4x4&& transpose() {
|
||||
[[nodiscard]] mat4x4 transpose() const {
|
||||
mat4x4 copy{*this};
|
||||
|
||||
for (int i = 0; i < 4; i++){
|
||||
|
@ -92,7 +92,7 @@ namespace blt {
|
|||
}
|
||||
}
|
||||
|
||||
return std::move(copy);
|
||||
return copy;
|
||||
}
|
||||
|
||||
[[nodiscard]] inline float m(int row, int column) const { return data.single[row + column * 4]; };
|
||||
|
|
|
@ -64,7 +64,7 @@ struct vec {
|
|||
T negativeCopy[size];
|
||||
for (int i = 0; i < size; i++)
|
||||
negativeCopy[i] = -elements[i];
|
||||
return vec<size>{negativeCopy};
|
||||
return vec<T, size>{negativeCopy};
|
||||
}
|
||||
|
||||
inline vec<T, size>& operator+=(const vec<T, size>& other) {
|
||||
|
@ -114,12 +114,12 @@ struct vec {
|
|||
}
|
||||
};
|
||||
|
||||
template<unsigned long size>
|
||||
inline vec<size> operator+(const vec<size>& left, const vec<size>& right) {
|
||||
template<typename T, unsigned long size>
|
||||
inline vec<T, size> operator+(const vec<T, size>& left, const vec<T, size>& right) {
|
||||
float initializer[size];
|
||||
for (int i = 0; i < size; i++)
|
||||
initializer[i] = left[i] + right[i];
|
||||
return vec<size>{initializer};
|
||||
return vec<T, size>{initializer};
|
||||
}
|
||||
|
||||
template<typename T, unsigned long size>
|
||||
|
|
Loading…
Reference in New Issue