v1
Brett 2024-09-20 17:13:09 -04:00
parent b5ea7a1e15
commit 7300f895bb
3 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
include(cmake/color.cmake)
set(BLT_VERSION 0.20.14)
set(BLT_VERSION 0.20.15)
set(BLT_TEST_VERSION 0.0.1)
set(BLT_TARGET BLT)

View File

@ -16,8 +16,8 @@
namespace blt
{
template<typename Writer = blt::logging::logger, typename T, blt::u32 size>
static inline Writer& operator<<(Writer& log, const blt::vec<T, size>& vec)
template<typename T, blt::u32 size, typename CharT, typename Traits>
static inline std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& log, const blt::vec<T, size>& vec)
{
std::string type_string;
const auto tstr = blt::type_string<T>();
@ -45,8 +45,8 @@ namespace blt
return log;
}
template<typename Writer = std::ostream>
inline Writer& operator<<(Writer& out, const mat4x4& v)
template<typename CharT, typename Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& out, const mat4x4& v)
{
out << "Mat4x4(";
out << "{" << v.m00() << ", " << v.m01() << ", " << v.m02() << ", " << v.m03() << "},";

View File

@ -175,6 +175,18 @@ namespace blt
return data[column][row] = value;
};
/**
* Takes a value stored across a row, taking one from each column in the specified row
* @param row the row to extract from. defaults to the first row
*/
constexpr inline vec<T, columns> vec_from_column_row(blt::u32 row = 0)
{
vec<T, columns> ret;
for (blt::u32 j = 0; j < columns; j++)
ret[j] = data[j][row];
return ret;
}
/**
* Assign to this matrix from the row information in each column of a matrix
* Where columns can be assigned directly from each-other, row stored data must be assigned this way