Skip to content

Commit

Permalink
Renames and more structured include to alleviate build-time issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Sep 13, 2023
1 parent a1717fd commit 6bc06f4
Show file tree
Hide file tree
Showing 128 changed files with 1,695 additions and 1,297 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ add_library(LangulusMath ${LANGULUS_LIBRARY_TYPE}
)

target_include_directories(LangulusMath
PUBLIC source
PUBLIC include
$<TARGET_PROPERTY:LangulusLogger,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:LangulusRTTI,INTERFACE_INCLUDE_DIRECTORIES>
$<$<BOOL:${LANGULUS_FEATURE_MANAGED_MEMORY}>:$<TARGET_PROPERTY:LangulusFractalloc,INTERFACE_INCLUDE_DIRECTORIES>>
Expand Down
38 changes: 19 additions & 19 deletions source/Math/Angles.hpp → include/Math/Angle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "Numbers/TAngle.hpp"
#include "../../source/Numbers/TAngle.inl"


namespace Langulus::Math
{

/// Register angle types
inline void RegisterAngles() {
(void)MetaOf<Degrees>();
(void)MetaOf<Radians>();

(void)MetaOf<Yawdf>();
(void)MetaOf<Yawdd>();
(void)MetaOf<Yawrf>();
(void)MetaOf<Yawrd>();

(void)MetaOf<Pitchdf>();
(void)MetaOf<Pitchdd>();
(void)MetaOf<Pitchrf>();
(void)MetaOf<Pitchrd>();

(void)MetaOf<Rolldf>();
(void)MetaOf<Rolldd>();
(void)MetaOf<Rollrf>();
(void)MetaOf<Rollrd>();
(void) MetaOf<Degrees>();
(void) MetaOf<Radians>();
(void) MetaOf<Yawdf>();
(void) MetaOf<Yawdd>();
(void) MetaOf<Yawrf>();
(void) MetaOf<Yawrd>();
(void) MetaOf<Pitchdf>();
(void) MetaOf<Pitchdd>();
(void) MetaOf<Pitchrf>();
(void) MetaOf<Pitchrd>();
(void) MetaOf<Rolldf>();
(void) MetaOf<Rolldd>();
(void) MetaOf<Rollrf>();
(void) MetaOf<Rollrd>();
}

} // namespace Langulus::Math
} // namespace Langulus::Math
2 changes: 1 addition & 1 deletion source/Math/Ranges.hpp → include/Math/Blend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "Ranges/TRange.hpp"
#include "../../source/Blend.hpp"
32 changes: 16 additions & 16 deletions source/Math/Colors.hpp → include/Math/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "Colors/TColor.hpp"
#include "Vectors.hpp"
#include "../../source/Colors/TColor.inl"


namespace Langulus::Math
{
Expand All @@ -31,20 +31,20 @@ namespace Langulus

using ::Langulus::Math::RGBA;

constexpr RGBA White {255, 255, 255, 255};
constexpr RGBA Black {0, 0, 0, 255};
constexpr RGBA Grey {127, 127, 127, 255};
constexpr RGBA Red {255, 0, 0, 255};
constexpr RGBA Green {0, 255, 0, 255};
constexpr RGBA DarkGreen {0, 128, 0, 255};
constexpr RGBA Blue {0, 0, 255, 255};
constexpr RGBA DarkBlue {0, 0, 128, 255};
constexpr RGBA Cyan {128, 128, 255, 255};
constexpr RGBA DarkCyan {80, 80, 128, 255};
constexpr RGBA Orange {128, 128, 0, 255};
constexpr RGBA Yellow {255, 255, 0, 255};
constexpr RGBA Purple {255, 0, 255, 255};
constexpr RGBA DarkPurple {128, 0, 128, 255};
constexpr RGBA White { 255, 255, 255, 255 };
constexpr RGBA Black { 0, 0, 0, 255 };
constexpr RGBA Grey { 127, 127, 127, 255 };
constexpr RGBA Red { 255, 0, 0, 255 };
constexpr RGBA Green { 0, 255, 0, 255 };
constexpr RGBA DarkGreen { 0, 128, 0, 255 };
constexpr RGBA Blue { 0, 0, 255, 255 };
constexpr RGBA DarkBlue { 0, 0, 128, 255 };
constexpr RGBA Cyan { 128, 128, 255, 255 };
constexpr RGBA DarkCyan { 80, 80, 128, 255 };
constexpr RGBA Orange { 128, 128, 0, 255 };
constexpr RGBA Yellow { 255, 255, 0, 255 };
constexpr RGBA Purple { 255, 0, 255, 255 };
constexpr RGBA DarkPurple { 128, 0, 128, 255 };

} // namespace Langulus::Colors

Expand Down
78 changes: 78 additions & 0 deletions include/Math/Config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../source/Common.hpp"

#include "../../source/Verbs/Add.inl"
#include "../../source/Verbs/Cerp.inl"
#include "../../source/Verbs/Exponent.inl"
#include "../../source/Verbs/Lerp.inl"
#include "../../source/Verbs/Modulate.inl"
#include "../../source/Verbs/Multiply.inl"
#include "../../source/Verbs/Randomize.inl"
#include "../../source/Verbs/Move.inl"


namespace Langulus::Math
{

using RTTI::MetaVerb;

/// Register traits
inline void RegisterTraits() {
(void)MetaOf<Traits::X>();
(void)MetaOf<Traits::Y>();
(void)MetaOf<Traits::Z>();
(void)MetaOf<Traits::W>();

(void)MetaOf<Traits::U>();
(void)MetaOf<Traits::V>();
(void)MetaOf<Traits::S>();
(void)MetaOf<Traits::T>();

(void)MetaOf<Traits::R>();
(void)MetaOf<Traits::G>();
(void)MetaOf<Traits::B>();
(void)MetaOf<Traits::A>();
(void)MetaOf<Traits::D>();

(void)MetaOf<Traits::Transform>();
(void)MetaOf<Traits::View>();
(void)MetaOf<Traits::Projection>();
(void)MetaOf<Traits::Solid>();
(void)MetaOf<Traits::Pickable>();
(void)MetaOf<Traits::Signed>();
(void)MetaOf<Traits::Bilateral>();
(void)MetaOf<Traits::Static>();
(void)MetaOf<Traits::Boundness>();
(void)MetaOf<Traits::Relative>();
(void)MetaOf<Traits::Place>();
(void)MetaOf<Traits::Size>();
(void)MetaOf<Traits::Aim>();
(void)MetaOf<Traits::Velocity>();
(void)MetaOf<Traits::Acceleration>();
(void)MetaOf<Traits::Sampler>();
(void)MetaOf<Traits::Level>();
(void)MetaOf<Traits::Interpolator>();
(void)MetaOf<Traits::Perspective>();
}

/// Register verbs
inline void RegisterVerbs() {
(void)MetaVerb::Of<Verbs::Exponent>();
(void)MetaVerb::Of<Verbs::Multiply>();
(void)MetaVerb::Of<Verbs::Modulate>();
(void)MetaVerb::Of<Verbs::Randomize>();
(void)MetaVerb::Of<Verbs::Add>();
(void)MetaVerb::Of<Verbs::Lerp>();
(void)MetaVerb::Of<Verbs::Cerp>();
(void)MetaVerb::Of<Verbs::Move>();
}

} // namespace Langulus::Math
2 changes: 1 addition & 1 deletion source/Math/Quaternions.hpp → include/Math/Gradient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "Quaternions/TQuaternion.hpp"
#include "../../source/TGradient.hpp"
2 changes: 1 addition & 1 deletion source/Math/Matrices.hpp → include/Math/LOD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "Matrices/TMatrix.hpp"
#include "../../source/LOD.inl"
3 changes: 1 addition & 2 deletions source/Math/Randomness.hpp → include/Math/Level.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "Randomness/MersenneTwister.hpp"
#include "Randomness/Hashes.hpp"
#include "../../source/Numbers/Level.inl"
10 changes: 10 additions & 0 deletions include/Math/Mapping.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../source/Mapping.hpp"
10 changes: 10 additions & 0 deletions include/Math/Matrix.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../source/Matrices/TMatrix.inl"
40 changes: 40 additions & 0 deletions include/Math/Normal.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../source/Vectors/TVector.inl"
#include "../../source/Vectors/TNormal.hpp"


namespace Langulus::Math
{
namespace Inner
{
/// Combines S and T... to form a normal type
/// @tparam S - size of the vector
template<Count S>
struct NormalTypeGenerator {
template<class... T>
static void Register(TTypeList<T...>&&) {
(((void)MetaOf<TNormal<TVector<T, S>>>()), ...);
}
};
} // namespace Langulus::Math::Inner

/// Register all normal types
inline void RegisterNormals() {
using RealTypes = TTypeList<
Float, Double
>;

Inner::NormalTypeGenerator<2>::Register(RealTypes {});
Inner::NormalTypeGenerator<3>::Register(RealTypes {});
Inner::NormalTypeGenerator<4>::Register(RealTypes {});
}

} // namespace Langulus::Math
10 changes: 10 additions & 0 deletions include/Math/Number.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../source/Numbers/TNumber.inl"
64 changes: 64 additions & 0 deletions include/Math/Primitive.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../source/Primitives/TBox.hpp"
#include "../../source/Primitives/TCone.hpp"
#include "../../source/Primitives/TCylinder.hpp"
#include "../../source/Primitives/TFrustum.hpp"
#include "../../source/Primitives/TLine.hpp"
#include "../../source/Primitives/TPlane.hpp"
#include "../../source/Primitives/TPoint.hpp"
#include "../../source/Primitives/TPolygon.hpp"
#include "../../source/Primitives/TRay.hpp"
#include "../../source/Primitives/TSphere.hpp"
#include "../../source/Primitives/TTriangle.hpp"
#include "../../source/Primitives/TTorus.hpp"

namespace Langulus::Math
{

/// Register primitives
inline void RegisterPrimitives() {
(void) MetaOf<Box2>();
(void) MetaOf<Box3>();
(void) MetaOf<BoxRounded2>();
(void) MetaOf<BoxRounded3>();

(void) MetaOf<Cylinder3>();
(void) MetaOf<CylinderCapped3>();

(void) MetaOf<Frustum2>();
(void) MetaOf<Frustum3>();

(void) MetaOf<Line2>();
(void) MetaOf<Line3>();
(void) MetaOf<LineLoop2>();
(void) MetaOf<LineLoop3>();
(void) MetaOf<LineStrip2>();
(void) MetaOf<LineStrip3>();

(void) MetaOf<Point1>();
(void) MetaOf<Point2>();
(void) MetaOf<Point3>();

(void) MetaOf<Polygon2>();
(void) MetaOf<Polygon3>();

(void) MetaOf<Ray2>();
(void) MetaOf<Ray3>();

(void) MetaOf<Triangle2>();
(void) MetaOf<Triangle3>();
(void) MetaOf<TriangleStrip2>();
(void) MetaOf<TriangleStrip3>();
(void) MetaOf<TriangleFan2>();
(void) MetaOf<TriangleFan3>();
}

} // namespace Langulus::Math
10 changes: 10 additions & 0 deletions include/Math/Primitives/Box.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../../source/Primitives/TBox.inl"
10 changes: 10 additions & 0 deletions include/Math/Primitives/Cylinder.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../../source/Primitives/TCylinder.inl"
10 changes: 10 additions & 0 deletions include/Math/Primitives/Frustum.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../../source/Primitives/TFrustum.inl"
10 changes: 10 additions & 0 deletions include/Math/Primitives/Line.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
///
/// Langulus::Math
/// Copyright (c) 2014 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// Distributed under GNU General Public License v3+
/// See LICENSE file, or https://www.gnu.org/licenses
///
#pragma once
#include "../../../source/Primitives/TLine.inl"
Loading

0 comments on commit 6bc06f4

Please sign in to comment.