1
0
forked from josh/j3ml
Files
j3ml-fork/include/J3ML/Geometry.h
2024-01-25 14:01:19 -05:00

77 lines
1.8 KiB
C++

#include <J3ML/LinearAlgebra/Vector2.h>
#include <J3ML/LinearAlgebra/Vector3.h>
#pragma once
namespace Geometry {
using Vector2 = LinearAlgebra::Vector2;
using Vector3 = LinearAlgebra::Vector3;
class LineSegment2D
{
Vector2 A;
Vector2 B;
};
class Rectangle; //AABB2D;
class OBB2D;
class Line2D;
class Ray2D;
class Triangle2D;
class Polygon2D;
class Sphere;
class LineSegment
{
Vector3 A;
Vector3 B;
};
struct IntersectionResult2D {};
bool Intersects2D(LineSegment2D seg, Rectangle rect);
IntersectionResult2D GetIntersection2D(LineSegment2D seg, Rectangle rect);
class OBB;
// A 3D axis-aligned bounding box
// This data structure can be used to represent coarse bounds of objects, in situations where detailed triangle-level
// computations can be avoided. In physics systems, bounding boxes are used as an efficient early-out test for geometry
// intersection queries.
// the 'Axis-aligned' part in the name means that the local axes of this bounding box are restricted to align with the
// 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 Capsule;
class Line;
class Ray
{
Vector3 Origin;
Vector3 Direction;
};
class Camera {
public:
Vector3 Position;
Vector3 Front;
Vector3 Right;
Vector3 Up;
};
class Polygon;
class Polyhedron;
class QuadTree;
class OctTree;
class Triangle;
class TriangleMesh;
}