summaryrefslogtreecommitdiffstats
path: root/src/core/math
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-12-26 23:17:56 +0500
committeruntodesu <kirill@untode.su>2025-12-26 23:17:56 +0500
commit0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e (patch)
tree90ddefa28b40b6384dd9618bb7573704de2733a9 /src/core/math
parent6bb4233d5b2a1688e63c947542e92ec5d5a857a6 (diff)
downloadvoxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.tar.bz2
voxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.zip
Add include guards and header comments to sources
Diffstat (limited to 'src/core/math')
-rw-r--r--src/core/math/aabb.hh9
-rw-r--r--src/core/math/angles.hh9
-rw-r--r--src/core/math/concepts.hh9
-rw-r--r--src/core/math/constexpr.hh9
-rw-r--r--src/core/math/crc64.cc5
-rw-r--r--src/core/math/crc64.hh9
-rw-r--r--src/core/math/vectors.hh13
7 files changed, 59 insertions, 4 deletions
diff --git a/src/core/math/aabb.hh b/src/core/math/aabb.hh
index f3eb7bd..79f814a 100644
--- a/src/core/math/aabb.hh
+++ b/src/core/math/aabb.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: aabb.hh
+// Description: Axis-aligned bounding box
+
+#ifndef CORE_MATH_AABB_HH
+#define CORE_MATH_AABB_HH
#pragma once
#include "core/math/concepts.hh"
@@ -109,3 +116,5 @@ constexpr math::AABB<T> math::AABB<T>::push(const vector_type& vector) const
result.max = max + vector;
return result;
}
+
+#endif
diff --git a/src/core/math/angles.hh b/src/core/math/angles.hh
index 174f320..b339323 100644
--- a/src/core/math/angles.hh
+++ b/src/core/math/angles.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: angles.hh
+// Description: Angle utilities
+
+#ifndef CORE_MATH_ANGLES_HH
+#define CORE_MATH_ANGLES_HH
#pragma once
#include "core/math/constexpr.hh"
@@ -101,3 +108,5 @@ inline void math::vectors(const glm::fvec3& angles, glm::fvec3* forward, glm::fv
up->z = nsv.x * ncv.y * pcv.z + psv.y * psv.z;
}
}
+
+#endif
diff --git a/src/core/math/concepts.hh b/src/core/math/concepts.hh
index 6ad5cb7..5d1ef7d 100644
--- a/src/core/math/concepts.hh
+++ b/src/core/math/concepts.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: concepts.hh
+// Description: C++20 concepts that should be in standard library but are not
+
+#ifndef CORE_MATH_CONCEPTS_HH
+#define CORE_MATH_CONCEPTS_HH
#pragma once
namespace math
@@ -9,3 +16,5 @@ concept signed_arithmetic = std::is_arithmetic_v<type> && std::is_signed_v<type>
template<typename type>
concept unsigned_arithmetic = std::is_arithmetic_v<type> && std::is_unsigned_v<type>;
} // namespace math
+
+#endif
diff --git a/src/core/math/constexpr.hh b/src/core/math/constexpr.hh
index 4158803..7aba4d2 100644
--- a/src/core/math/constexpr.hh
+++ b/src/core/math/constexpr.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: constexpr.hh
+// Description: Compile-time expressions
+
+#ifndef CORE_MATH_CONSTEXPR_HH
+#define CORE_MATH_CONSTEXPR_HH
#pragma once
#include "core/math/concepts.hh"
@@ -70,3 +77,5 @@ constexpr scalar math::radians(const scalar x)
{
return static_cast<scalar>(static_cast<double>(x) * M_PI / 180.0);
}
+
+#endif
diff --git a/src/core/math/crc64.cc b/src/core/math/crc64.cc
index 99a4b20..ce1e1db 100644
--- a/src/core/math/crc64.cc
+++ b/src/core/math/crc64.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: crc64.cc
+// Description: Client-server synchronized CRC64
+
#include "core/pch.hh"
#include "core/math/crc64.hh"
diff --git a/src/core/math/crc64.hh b/src/core/math/crc64.hh
index 3ece0df..f593dc9 100644
--- a/src/core/math/crc64.hh
+++ b/src/core/math/crc64.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: crc64.hh
+// Description: Client-server synchronized CRC64
+
+#ifndef CORE_MATH_CRC64_HH
+#define CORE_MATH_CRC64_HH
#pragma once
namespace math
@@ -7,3 +14,5 @@ std::uint64_t crc64(const std::vector<std::byte>& buffer, std::uint64_t combine
std::uint64_t crc64(const std::string& buffer, std::uint64_t combine = UINT64_C(0));
std::uint64_t crc64(std::string_view buffer, std::uint64_t combine = UINT64_C(0));
} // namespace math
+
+#endif
diff --git a/src/core/math/vectors.hh b/src/core/math/vectors.hh
index bc11dd0..2934bb6 100644
--- a/src/core/math/vectors.hh
+++ b/src/core/math/vectors.hh
@@ -1,11 +1,14 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: vectors.hh
+// Description: because NO ONE would POSSIBLY need integer-based distance calculations in a VOXEL game
+
+#ifndef CORE_MATH_VECTORS_HH
+#define CORE_MATH_VECTORS_HH
#pragma once
#include "core/math/concepts.hh"
-// core/vectors.hh - because NO ONE would POSSIBLY
-// need integer-based distance calculations in a
-// game about voxels. That would be INSANE! :D
-
namespace math
{
template<math::arithmetic T>
@@ -41,3 +44,5 @@ constexpr static inline const T math::distance2(const glm::vec<3, T>& vector_a,
{
return math::length2(vector_a - vector_b);
}
+
+#endif