Tweeker Commit (Have Fun Reviewing This)

This commit is contained in:
2024-04-05 12:15:01 -04:00
parent 815e914c7f
commit 0aff68b63e
30 changed files with 2261 additions and 44 deletions

View File

@@ -7,6 +7,15 @@
namespace J3ML::Geometry
{
// TODO: Move to separate math lib, find duplicates!
template <typename T>
void Swap(T &a, T &b)
{
T temp = std::move(a);
a = std::move(b);
b = std::move(temp);
}
using namespace LinearAlgebra;
class Capsule : public Shape
{
@@ -27,5 +36,31 @@ namespace J3ML::Geometry
Vector3 Centroid() const;
Vector3 ExtremePoint(const Vector3& direction);
AABB MinimalEnclosingAABB() const;
void ProjectToAxis(const Vector3 &direction, float &outMin, float &outMax) const;
bool Intersects(const Plane &plane) const;
bool Intersects(const Ray &ray) const;
bool Intersects(const Line &line) const;
bool Intersects(const LineSegment &lineSegment) const;
bool Intersects(const AABB &aabb) const;
bool Intersects(const OBB &obb) const;
bool Intersects(const Sphere &sphere) const;
bool Intersects(const Capsule &capsule) const;
bool Intersects(const Triangle &triangle) const;
bool Intersects(const Polygon &polygon) const;
bool Intersects(const Frustum &frustum) const;
bool Intersects(const Polyhedron &polyhedron) const;
};
}