From 12169a700195f23d5ebce54d0edb79bee4f8b0e1 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Mon, 13 May 2024 21:31:05 -0400 Subject: [PATCH] matrix functions for vec2 operations, defaults are logically assumed. --- CMakeLists.txt | 2 +- include/blt/math/matrix.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbfe301..68ad50d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.17.6) +set(BLT_VERSION 0.17.7) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/math/matrix.h b/include/blt/math/matrix.h index 526adbb..62fbf53 100644 --- a/include/blt/math/matrix.h +++ b/include/blt/math/matrix.h @@ -137,6 +137,9 @@ namespace blt inline mat4x4& translate(const vec3& vec) { return translate(vec[0], vec[1], vec[2]); } + inline mat4x4& translate(const vec2& vec) + { return translate(vec[0], vec[1], 0); } + inline mat4x4& scale(float x, float y, float z) { mat4x4 scale_mat{}; @@ -156,6 +159,9 @@ namespace blt inline mat4x4& scale(const vec3& vec) { return scale(vec[0], vec[1], vec[2]); } + inline mat4x4& scale(const vec2& vec) + { return scale(vec[0], vec[1], 1.0f); } + // angle in radians inline mat4x4& rotateX(float angle) {