add vec2 * mat4 multiplication
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <type_traits>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
@@ -47,6 +48,10 @@ struct vec2 {
|
||||
y *= o;
|
||||
}
|
||||
|
||||
inline vec2<T> operator *(const std::array<float, 16>& matrix) {
|
||||
return { x * matrix[0] + y * matrix[4] + matrix[12], x * matrix[1] + y * matrix[5] + matrix[13] };
|
||||
}
|
||||
|
||||
template <typename O>
|
||||
inline typename std::enable_if<std::is_arithmetic<O>::value, vec2>::type
|
||||
operator-(O o) const {
|
||||
|
||||
Reference in New Issue
Block a user