Fixed windows errors
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
#include <J3ML/Geometry/Polyhedron.hpp>
|
||||
#include <J3ML/Geometry/QuadTree.hpp>
|
||||
#include <J3ML/Geometry/Ray.hpp>
|
||||
#include <J3ML/Geometry/Shape.hpp>
|
||||
#include <J3ML/Geometry/Sphere.hpp>
|
||||
#include <J3ML/Geometry/Triangle.hpp>
|
||||
#include <J3ML/Geometry/Triangle2D.hpp>
|
||||
|
@@ -14,12 +14,9 @@
|
||||
#include <format>
|
||||
#include <optional>
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/Geometry/Shape.hpp>
|
||||
|
||||
#include "Polygon.hpp"
|
||||
#include "Sphere.hpp"
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Algorithm/RNG.hpp>
|
||||
|
||||
|
||||
@@ -44,7 +41,7 @@ namespace J3ML::Geometry
|
||||
/// axes of the world space coordinate system. This makes computation involving AABB's very fast, since AABB's cannot
|
||||
/// be arbitrarily oriented in the space with respect to each other.
|
||||
/// If you need to represent a box in 3D space with arbitrary orientation, see the class OBB. */
|
||||
class AABB : public Shape {
|
||||
class AABB {
|
||||
public:
|
||||
/// Specifies the minimum extent of this AABB in the world space x, y and z axes.
|
||||
Vector3 minPoint;
|
||||
|
@@ -12,14 +12,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/LinearAlgebra/Vector2.hpp>
|
||||
#include "Shape.hpp"
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
using LinearAlgebra::Vector2;
|
||||
// CaveGame AABB
|
||||
class AABB2D : public Shape2D
|
||||
class AABB2D
|
||||
{
|
||||
public:
|
||||
|
||||
|
@@ -11,16 +11,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/Geometry/Shape.hpp>
|
||||
#include <J3ML/Geometry/Circle.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/Geometry/LineSegment.hpp>
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
|
||||
/// A 3D cylinder with spherical ends.
|
||||
class Capsule : public Shape
|
||||
class Capsule
|
||||
{
|
||||
public:
|
||||
/// Specifies the two inner points of this capsule
|
||||
|
@@ -11,8 +11,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
|
||||
namespace J3ML
|
||||
{
|
||||
|
@@ -4,25 +4,25 @@
|
||||
// Forward declarations for classes that include each other
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
class Shape;
|
||||
class AABB2D;
|
||||
class AABB;
|
||||
class Capsule;
|
||||
class Frustum;
|
||||
class LineSegment;
|
||||
class LineSegment2D;
|
||||
class Line;
|
||||
class OBB;
|
||||
class OBB2D;
|
||||
class Plane;
|
||||
class Polygon;
|
||||
class Polyhedron;
|
||||
template<typename T> class QuadTree;
|
||||
class Ray;
|
||||
class Shape;
|
||||
class Sphere;
|
||||
class Circle;
|
||||
class Triangle;
|
||||
class Triangle2D;
|
||||
class TriangleMesh;
|
||||
|
||||
template <int N> class PBVolume;
|
||||
|
||||
}
|
@@ -3,9 +3,7 @@
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include "Plane.hpp"
|
||||
#include "Shape.hpp"
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
|
||||
namespace J3ML::Geometry
|
||||
@@ -78,7 +76,7 @@ namespace J3ML::Geometry
|
||||
/// @see FrustumType
|
||||
/// @see FrustumProjectiveSpace
|
||||
/// @see FrustumHandedness
|
||||
class Frustum : public Shape {
|
||||
class Frustum {
|
||||
public: // Members
|
||||
|
||||
/// Specifies whether this frustum is a perspective or an orthographic frustum.
|
||||
|
@@ -1,14 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/LinearAlgebra/Vector3.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
|
||||
using LinearAlgebra::Vector3;
|
||||
|
||||
/// A line segment in 3D space is a finite line with a start and end point.
|
||||
class LineSegment
|
||||
{
|
||||
|
@@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/Geometry/AABB.hpp>
|
||||
#include <J3ML/Geometry/Polyhedron.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
|
||||
|
||||
namespace J3ML::Geometry {
|
||||
@@ -11,7 +10,7 @@ namespace J3ML::Geometry {
|
||||
// with respect to the global world coordinate system. This allows OBBs to more tightly bound objects than AABBs do,
|
||||
// which always align with the world space axes. This flexibility has the drawback that the geometry tests and operations
|
||||
// involving OBBs are more costly, and representing an OBB in memory takes more space (15 floats vs 6 floats)
|
||||
class OBB : public Shape
|
||||
class OBB
|
||||
{
|
||||
public:
|
||||
// The center position of this OBB
|
||||
|
@@ -11,13 +11,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <J3ML/Geometry/AABB.hpp>
|
||||
#include <J3ML/Geometry/Polyhedron.hpp>
|
||||
#include <J3ML/Geometry/Plane.hpp>
|
||||
#include <J3ML/Geometry/Sphere.hpp>
|
||||
|
||||
#include "Sphere.hpp"
|
||||
#include "Sphere.hpp"
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
|
@@ -1,12 +1,10 @@
|
||||
#pragma once
|
||||
#include <J3ML/LinearAlgebra/Vector3.hpp>
|
||||
#include "Shape.hpp"
|
||||
#include "Ray.hpp"
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
using J3ML::LinearAlgebra::Vector3;
|
||||
|
||||
class Plane
|
||||
{
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <vector>
|
||||
#include "Shape.hpp"
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
|
||||
namespace J3ML::Geometry {
|
||||
|
||||
class Polygon : public Shape
|
||||
class Polygon
|
||||
{
|
||||
public:
|
||||
std::vector<Vector3> vertices;
|
||||
|
@@ -1,14 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/Geometry/Shape.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <J3ML/LinearAlgebra/Vector3.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
using namespace J3ML::LinearAlgebra;
|
||||
|
||||
// Represents a three-dimensional closed geometric solid defined by flat polygonal faces.
|
||||
class Polyhedron
|
||||
|
@@ -2,14 +2,13 @@
|
||||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <J3ML/LinearAlgebra/Vector2.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
#include <J3ML/Geometry/AABB2D.hpp>
|
||||
|
||||
namespace J3ML::Geometry {
|
||||
|
||||
|
||||
using LinearAlgebra::Vector2;
|
||||
|
||||
template<typename T>
|
||||
class QuadTree {
|
||||
/// A fixed split rule for all QuadTrees: A QuadTree leaf node is only ever split if the leaf contains at least this many objects.
|
||||
@@ -366,4 +365,4 @@ namespace J3ML::Geometry {
|
||||
leaf->objects.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,11 +10,12 @@
|
||||
/// @edit 2024-07-06
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/LinearAlgebra/Vector3.hpp>
|
||||
#include <format>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <vector>
|
||||
#include "TriangleMesh.hpp"
|
||||
#include "Frustum.hpp"
|
||||
#include "OBB.hpp"
|
||||
#include <ostream>
|
||||
#include <iosfwd>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
@@ -29,8 +30,8 @@ namespace J3ML::Geometry
|
||||
Vector3 Intersection;
|
||||
Vector3 SurfaceNormal;
|
||||
bool Hit;
|
||||
Shape* Target;
|
||||
static RaycastResult NoHit() { return {Vector3::NaN, Vector3::NaN, false, nullptr};}
|
||||
//Shape* Target;
|
||||
static RaycastResult NoHit() { return {Vector3::NaN, Vector3::NaN, false};}
|
||||
};
|
||||
|
||||
/// A ray in 3D space is a line that starts from an origin point and extends to infinity in one direction
|
||||
@@ -151,17 +152,12 @@ namespace J3ML::Geometry
|
||||
// Returns a RaycastResult structure containing the first object the ray collides with,
|
||||
// the surface intersection point,
|
||||
// and the surface normal at the point of intersection.
|
||||
RaycastResult Cast(std::vector<Shape> shapes, float maxDistance = 99999999);
|
||||
// RaycastResult Cast(std::vector<Shape> shapes, float maxDistance = 99999999);
|
||||
|
||||
void ProjectToAxis(const Vector3 &direction, float &outMin, float &outMax) const;
|
||||
|
||||
[[nodiscard]] std::string ToString() const {
|
||||
return std::format("Ray(origin:[{}], direction:[{}])", Origin.ToString(), Direction.ToString());
|
||||
}
|
||||
[[nodiscard]] std::string ToString() const;
|
||||
};
|
||||
|
||||
inline std::ostream& operator << (std::ostream& o, const Ray& ray) {
|
||||
o << ray.ToString();
|
||||
return o;
|
||||
}
|
||||
}
|
||||
std::ostream& operator << (std::ostream& o, const Ray& ray);
|
||||
}
|
||||
|
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
class GeometricPrimitive
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
class Shape
|
||||
{
|
||||
public:
|
||||
virtual ~Shape() = default; //Polymorphic for dynamic_cast.
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
class Shape2D
|
||||
{
|
||||
public:
|
||||
virtual ~Shape2D() = default;
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
}
|
@@ -12,17 +12,12 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <J3ML/Geometry.hpp>
|
||||
#include <J3ML/LinearAlgebra/Matrix3x3.hpp>
|
||||
#include <J3ML/LinearAlgebra/Matrix4x4.hpp>
|
||||
#include <J3ML/Geometry/LineSegment.hpp>
|
||||
#include <J3ML/Geometry/TriangleMesh.hpp>
|
||||
#include <J3ML/Geometry/Shape.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
using J3ML::LinearAlgebra::Matrix3x3;
|
||||
using J3ML::LinearAlgebra::Matrix4x4;
|
||||
|
||||
// A mathematical representation of a 3-dimensional sphere
|
||||
class Sphere
|
||||
@@ -119,8 +114,8 @@ namespace J3ML::Geometry
|
||||
[[nodiscard]] bool Contains(const Vector3& point, float epsilon) const;
|
||||
|
||||
[[nodiscard]] bool Contains(const LineSegment& lineseg) const;
|
||||
TriangleMesh GenerateUVSphere() const {}
|
||||
TriangleMesh GenerateIcososphere() const {}
|
||||
TriangleMesh GenerateUVSphere() const;
|
||||
TriangleMesh GenerateIcososphere() const;
|
||||
|
||||
void ProjectToAxis(const Vector3 &direction, float &outMin, float &outMax) const;
|
||||
};
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "J3ML/LinearAlgebra/Vector3.hpp"
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <cfloat>
|
||||
|
||||
|
@@ -1,12 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/Geometry/Common.hpp>
|
||||
#include "J3ML/J3ML.hpp"
|
||||
|
||||
|
||||
using namespace J3ML::LinearAlgebra;
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
#include <J3ML/Geometry/Forward.hpp>
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
|
@@ -14,8 +14,7 @@
|
||||
|
||||
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
|
||||
#include <J3ML/LinearAlgebra.hpp>
|
||||
|
||||
namespace J3ML::LinearAlgebra {
|
||||
class Matrix2x2 {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/LinearAlgebra/Forward.hpp>
|
||||
#include <J3ML/Algorithm/RNG.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/LinearAlgebra/Forward.hpp>
|
||||
#include <J3ML/Algorithm/RNG.hpp>
|
||||
#include <cmath>
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <cstddef>
|
||||
#include <cmath>
|
||||
|
||||
#include <J3ML/LinearAlgebra/Common.hpp>
|
||||
#include <J3ML/LinearAlgebra/Forward.hpp>
|
||||
|
||||
namespace J3ML::LinearAlgebra {
|
||||
|
||||
|
Reference in New Issue
Block a user