diff --git a/include/threepp/core/EventDispatcher.hpp b/include/threepp/core/EventDispatcher.hpp index c8b8f8da5..1b5069aef 100644 --- a/include/threepp/core/EventDispatcher.hpp +++ b/include/threepp/core/EventDispatcher.hpp @@ -3,7 +3,6 @@ #ifndef THREEPP_EVENTDISPATCHER_HPP #define THREEPP_EVENTDISPATCHER_HPP -#include #include #include #include diff --git a/include/threepp/core/InterleavedBufferAttribute.hpp b/include/threepp/core/InterleavedBufferAttribute.hpp index 17b2f251a..7362f5d65 100644 --- a/include/threepp/core/InterleavedBufferAttribute.hpp +++ b/include/threepp/core/InterleavedBufferAttribute.hpp @@ -8,7 +8,6 @@ #include "threepp/core/BufferAttribute.hpp" #include "threepp/core/InterleavedBuffer.hpp" -#include "threepp/math/Matrix4.hpp" namespace threepp { diff --git a/include/threepp/core/Raycaster.hpp b/include/threepp/core/Raycaster.hpp index 5712d4bfc..2ba7bf854 100644 --- a/include/threepp/core/Raycaster.hpp +++ b/include/threepp/core/Raycaster.hpp @@ -9,7 +9,6 @@ #include "threepp/math/Vector2.hpp" #include -#include #include namespace threepp { diff --git a/include/threepp/extras/ShapeUtils.hpp b/include/threepp/extras/ShapeUtils.hpp index ac856cc0e..2d5fc6ee3 100644 --- a/include/threepp/extras/ShapeUtils.hpp +++ b/include/threepp/extras/ShapeUtils.hpp @@ -5,7 +5,6 @@ #include "threepp/math/Vector2.hpp" -#include #include namespace threepp::shapeutils { diff --git a/include/threepp/extras/core/Path.hpp b/include/threepp/extras/core/Path.hpp index 61053f0c1..d40d004e5 100644 --- a/include/threepp/extras/core/Path.hpp +++ b/include/threepp/extras/core/Path.hpp @@ -5,8 +5,6 @@ #include "threepp/extras/core/CurvePath.hpp" -#include - namespace threepp { class Path: public CurvePath { diff --git a/include/threepp/extras/curves/CubicBezierCurve3.hpp b/include/threepp/extras/curves/CubicBezierCurve3.hpp index af755a434..32bb58cee 100644 --- a/include/threepp/extras/curves/CubicBezierCurve3.hpp +++ b/include/threepp/extras/curves/CubicBezierCurve3.hpp @@ -5,7 +5,6 @@ #include "threepp/extras/core/Curve.hpp" - namespace threepp { class CubicBezierCurve3: public Curve3 { diff --git a/include/threepp/geometries/BoxGeometry.hpp b/include/threepp/geometries/BoxGeometry.hpp index 1eeba7ccc..31a535664 100644 --- a/include/threepp/geometries/BoxGeometry.hpp +++ b/include/threepp/geometries/BoxGeometry.hpp @@ -5,7 +5,6 @@ #include "threepp/core/BufferGeometry.hpp" - namespace threepp { class BoxGeometry: public BufferGeometry { diff --git a/include/threepp/geometries/EdgesGeometry.hpp b/include/threepp/geometries/EdgesGeometry.hpp index 9f0420ea5..be4b1bcd2 100644 --- a/include/threepp/geometries/EdgesGeometry.hpp +++ b/include/threepp/geometries/EdgesGeometry.hpp @@ -3,7 +3,7 @@ #ifndef THREEPP_EDGESGEOMETRY_HPP #define THREEPP_EDGESGEOMETRY_HPP -#include +#include "threepp/core/BufferGeometry.hpp" namespace threepp { diff --git a/include/threepp/geometries/ExtrudeGeometry.hpp b/include/threepp/geometries/ExtrudeGeometry.hpp index f04e2a621..00dac03cc 100644 --- a/include/threepp/geometries/ExtrudeGeometry.hpp +++ b/include/threepp/geometries/ExtrudeGeometry.hpp @@ -6,7 +6,6 @@ #include "threepp/core/BufferGeometry.hpp" #include "threepp/extras/core/Curve.hpp" - namespace threepp { class Shape; diff --git a/include/threepp/helpers/SkeletonHelper.hpp b/include/threepp/helpers/SkeletonHelper.hpp index 491517214..f4bc53fb1 100644 --- a/include/threepp/helpers/SkeletonHelper.hpp +++ b/include/threepp/helpers/SkeletonHelper.hpp @@ -6,7 +6,6 @@ #include "threepp/objects/LineSegments.hpp" #include "threepp/objects/Skeleton.hpp" - namespace threepp { class SkeletonHelper: public LineSegments { diff --git a/include/threepp/materials/MeshBasicMaterial.hpp b/include/threepp/materials/MeshBasicMaterial.hpp index f60b1c21e..fcaa1f199 100644 --- a/include/threepp/materials/MeshBasicMaterial.hpp +++ b/include/threepp/materials/MeshBasicMaterial.hpp @@ -6,11 +6,6 @@ #include "threepp/materials/Material.hpp" #include "threepp/materials/interfaces.hpp" -#include "threepp/math/Color.hpp" -#include "threepp/textures/Texture.hpp" - -#include - namespace threepp { class MeshBasicMaterial diff --git a/include/threepp/materials/interfaces.hpp b/include/threepp/materials/interfaces.hpp index f78601965..42d708283 100644 --- a/include/threepp/materials/interfaces.hpp +++ b/include/threepp/materials/interfaces.hpp @@ -2,8 +2,6 @@ #ifndef THREEPP_INTERFACES_HPP #define THREEPP_INTERFACES_HPP -#include - #include "threepp/materials/Material.hpp" #include "threepp/textures/Texture.hpp" diff --git a/include/threepp/math/Box3.hpp b/include/threepp/math/Box3.hpp index f7f35a575..60ebe40f0 100644 --- a/include/threepp/math/Box3.hpp +++ b/include/threepp/math/Box3.hpp @@ -6,8 +6,6 @@ #include "threepp/math/Vector3.hpp" #include "threepp/math/infinity.hpp" -#include - namespace threepp { class Triangle; diff --git a/include/threepp/math/Color.hpp b/include/threepp/math/Color.hpp index cab85b042..c1911de8c 100644 --- a/include/threepp/math/Color.hpp +++ b/include/threepp/math/Color.hpp @@ -2,7 +2,6 @@ #ifndef THREEPP_COLOR_HPP #define THREEPP_COLOR_HPP -#include #include namespace threepp { diff --git a/include/threepp/math/Vector2.hpp b/include/threepp/math/Vector2.hpp index e420b1e19..465589b85 100644 --- a/include/threepp/math/Vector2.hpp +++ b/include/threepp/math/Vector2.hpp @@ -4,7 +4,6 @@ #define THREEPP_VECTOR2_HPP #include -#include namespace threepp { diff --git a/include/threepp/math/Vector3.hpp b/include/threepp/math/Vector3.hpp index a4007a50a..c65363b06 100644 --- a/include/threepp/math/Vector3.hpp +++ b/include/threepp/math/Vector3.hpp @@ -303,7 +303,7 @@ namespace threepp { // Implementing get function template template - inline auto get(const Vector3& p) { + auto get(const Vector3& p) { if constexpr (N == 0) return p.x; else if constexpr (N == 1) return p.y; diff --git a/include/threepp/math/Vector4.hpp b/include/threepp/math/Vector4.hpp index c387d4c82..ecc8fd24f 100644 --- a/include/threepp/math/Vector4.hpp +++ b/include/threepp/math/Vector4.hpp @@ -108,11 +108,14 @@ namespace threepp { // Implementing get function template template - inline auto get(const Vector4& p) { + auto get(const Vector4& p) { if constexpr (N == 0) return p.x; - else if constexpr (N == 1) return p.y; - else if constexpr (N == 2) return p.z; - else if constexpr (N == 3) return p.w; + else if constexpr (N == 1) + return p.y; + else if constexpr (N == 2) + return p.z; + else if constexpr (N == 3) + return p.w; } }// namespace threepp diff --git a/include/threepp/objects/LOD.hpp b/include/threepp/objects/LOD.hpp index 8546016d7..7bad4b265 100644 --- a/include/threepp/objects/LOD.hpp +++ b/include/threepp/objects/LOD.hpp @@ -5,7 +5,6 @@ #include "threepp/core/Object3D.hpp" -#include namespace threepp { diff --git a/include/threepp/objects/Line.hpp b/include/threepp/objects/Line.hpp index 42d673f2c..f651e7e59 100644 --- a/include/threepp/objects/Line.hpp +++ b/include/threepp/objects/Line.hpp @@ -9,7 +9,6 @@ #include "threepp/objects/ObjectWithMaterials.hpp" #include -#include #include namespace threepp { diff --git a/include/threepp/objects/ObjectWithMaterials.hpp b/include/threepp/objects/ObjectWithMaterials.hpp index 34451b39a..f65051150 100644 --- a/include/threepp/objects/ObjectWithMaterials.hpp +++ b/include/threepp/objects/ObjectWithMaterials.hpp @@ -5,7 +5,6 @@ #include "threepp/core/Object3D.hpp" #include "threepp/materials/Material.hpp" - #include namespace threepp { diff --git a/include/threepp/objects/Reflector.hpp b/include/threepp/objects/Reflector.hpp index 23869abe3..2202b653b 100644 --- a/include/threepp/objects/Reflector.hpp +++ b/include/threepp/objects/Reflector.hpp @@ -3,8 +3,6 @@ #ifndef THREEPP_REFLECTOR_HPP #define THREEPP_REFLECTOR_HPP -#include - #include "threepp/core/Shader.hpp" #include "threepp/objects/Mesh.hpp" diff --git a/include/threepp/objects/Water.hpp b/include/threepp/objects/Water.hpp index c81d1bf9d..f0757d9a1 100644 --- a/include/threepp/objects/Water.hpp +++ b/include/threepp/objects/Water.hpp @@ -3,8 +3,6 @@ #ifndef THREEPP_WATER_HPP #define THREEPP_WATER_HPP -#include - #include "threepp/objects/Mesh.hpp" namespace threepp { diff --git a/include/threepp/textures/Texture.hpp b/include/threepp/textures/Texture.hpp index 197a589ee..74b86ee48 100644 --- a/include/threepp/textures/Texture.hpp +++ b/include/threepp/textures/Texture.hpp @@ -12,7 +12,7 @@ #include "threepp/textures/Image.hpp" -#include +#include #include namespace threepp { diff --git a/include/threepp/utils/TaskManager.hpp b/include/threepp/utils/TaskManager.hpp index b7a2658f6..0b5bc6096 100644 --- a/include/threepp/utils/TaskManager.hpp +++ b/include/threepp/utils/TaskManager.hpp @@ -5,7 +5,6 @@ #include #include - namespace threepp { class TaskManager { diff --git a/src/threepp/canvas/Canvas.cpp b/src/threepp/canvas/Canvas.cpp index f28278ba5..a30e8babf 100644 --- a/src/threepp/canvas/Canvas.cpp +++ b/src/threepp/canvas/Canvas.cpp @@ -346,7 +346,7 @@ struct Canvas::Impl { static void drop_callback(GLFWwindow* w, int count, const char** paths) { - auto p = static_cast(glfwGetWindowUserPointer(w)); + auto p = static_cast(glfwGetWindowUserPointer(w)); std::vector v; for (int i = 0; i < count; ++i) { @@ -510,10 +510,10 @@ Canvas::Parameters& Canvas::Parameters::resizable(bool flag) { Canvas::Parameters& Canvas::Parameters::favicon(const std::filesystem::path& path) { - if (std::filesystem::exists(path)) { + if (exists(path)) { favicon_ = path; } else { - std::cerr << "Invalid favicon path: " << std::filesystem::absolute(path) << std::endl; + std::cerr << "Invalid favicon path: " << absolute(path) << std::endl; } return *this; diff --git a/src/threepp/geometries/ShapeGeometry.cpp b/src/threepp/geometries/ShapeGeometry.cpp index 753c1bba7..fe5a9145e 100644 --- a/src/threepp/geometries/ShapeGeometry.cpp +++ b/src/threepp/geometries/ShapeGeometry.cpp @@ -3,6 +3,7 @@ #include "threepp/extras/ShapeUtils.hpp" #include +#include using namespace threepp; diff --git a/src/threepp/loaders/MTLLoader.cpp b/src/threepp/loaders/MTLLoader.cpp index a7a58de54..0ac42bb14 100644 --- a/src/threepp/loaders/MTLLoader.cpp +++ b/src/threepp/loaders/MTLLoader.cpp @@ -7,6 +7,7 @@ #include "threepp/utils/StringUtils.hpp" #include +#include #include using namespace threepp; diff --git a/src/threepp/math/Triangle.cpp b/src/threepp/math/Triangle.cpp index 64465dd34..88155df1b 100644 --- a/src/threepp/math/Triangle.cpp +++ b/src/threepp/math/Triangle.cpp @@ -2,6 +2,7 @@ #include "threepp/math/Triangle.hpp" #include +#include using namespace threepp; @@ -20,6 +21,7 @@ const Vector3& Triangle::a() const { return a_; } + const Vector3& Triangle::b() const { return b_; @@ -128,27 +130,27 @@ void Triangle::getMidpoint(Vector3& target) { void Triangle::getNormal(Vector3& target) { - return Triangle::getNormal(this->a_, this->b_, this->c_, target); + return getNormal(this->a_, this->b_, this->c_, target); } void Triangle::getBarycoord(Vector3& point, Vector3& target) { - return Triangle::getBarycoord(point, this->a_, this->b_, this->c_, target); + return getBarycoord(point, this->a_, this->b_, this->c_, target); } void Triangle::getUV(const Vector3& point, const Vector2& uv1, const Vector2& uv2, const Vector2& uv3, Vector2& target) { - return Triangle::getUV(point, this->a_, this->b_, this->c_, uv1, uv2, uv3, target); + return getUV(point, this->a_, this->b_, this->c_, uv1, uv2, uv3, target); } bool Triangle::containsPoint(const Vector3& point) { - return Triangle::containsPoint(point, this->a_, this->b_, this->c_); + return containsPoint(point, this->a_, this->b_, this->c_); } bool Triangle::isFrontFacing(const Vector3& direction) { - return Triangle::isFrontFacing(this->a_, this->b_, this->c_, direction); + return isFrontFacing(this->a_, this->b_, this->c_, direction); } void Triangle::closestPointToPoint(const Vector3& p, Vector3& target) { diff --git a/tests/core/EventDispatcher_test.cpp b/tests/core/EventDispatcher_test.cpp index 14faf949e..f2544520d 100644 --- a/tests/core/EventDispatcher_test.cpp +++ b/tests/core/EventDispatcher_test.cpp @@ -4,6 +4,8 @@ #include +#include + using namespace threepp; namespace {