length function

main
Brett 2025-03-25 19:30:35 -04:00
parent 8922a9e78c
commit 9a05c86b02
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20) cmake_minimum_required(VERSION 3.20)
include(cmake/color.cmake) include(cmake/color.cmake)
set(BLT_VERSION 5.2.28) set(BLT_VERSION 5.2.29)
set(BLT_TARGET BLT) set(BLT_TARGET BLT)

View File

@ -55,6 +55,11 @@ namespace blt
return m_max; return m_max;
} }
[[nodiscard]] T length() const
{
return m_max - m_min;
}
private: private:
T m_min, m_max; T m_min, m_max;
}; };
@ -78,7 +83,7 @@ namespace blt
{ {
vec<T, Axis> size; vec<T, Axis> size;
for (u32 i = 0; i < Axis; i++) for (u32 i = 0; i < Axis; i++)
size[i] = m_axes[i].max() - m_axes[i].min(); size[i] = m_axes[i].length();
return size; return size;
} }