From 9a05c86b02c9c45c2b384c531007416148ec4b56 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Tue, 25 Mar 2025 19:30:35 -0400 Subject: [PATCH] length function --- CMakeLists.txt | 2 +- include/blt/math/aabb.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41318a2..a994628 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 5.2.28) +set(BLT_VERSION 5.2.29) set(BLT_TARGET BLT) diff --git a/include/blt/math/aabb.h b/include/blt/math/aabb.h index 4fdc0a3..e0c94c4 100644 --- a/include/blt/math/aabb.h +++ b/include/blt/math/aabb.h @@ -55,6 +55,11 @@ namespace blt return m_max; } + [[nodiscard]] T length() const + { + return m_max - m_min; + } + private: T m_min, m_max; }; @@ -78,7 +83,7 @@ namespace blt { vec size; 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; }