1
0
forked from josh/j3ml

Implement Geometric Class Definitions

This commit is contained in:
2024-01-25 19:09:48 -05:00
parent 56077b7c86
commit 4152b0d2aa
13 changed files with 87 additions and 85 deletions

View File

@@ -1,8 +1,27 @@
//
// Created by dawsh on 1/25/24.
//
#pragma once
#ifndef J3ML_CAPSULE_H
#define J3ML_CAPSULE_H
#include "LineSegment.h"
#include <J3ML/LinearAlgebra/Vector3.h>
#endif //J3ML_CAPSULE_H
namespace Geometry
{
using namespace LinearAlgebra;
class Capsule
{
// Specifies the two inner points of this capsule
LineSegment l;
// Specifies the radius of this capsule
float r;
Capsule() {}
Capsule(const LineSegment& endPoints, float radius);
Capsule(const Vector3& bottomPt, const Vector3& topPt, float radius);
bool IsDegenerate()const;
float Height() const;
float Diameter() const;
Vector3 Bottom() const;
Vector3 Center() const;
Vector3 Centroid() const;
Vector3 ExtremePoint(const Vector3& direction);
};
}

View File

@@ -1,8 +1,10 @@
//
// Created by dawsh on 1/25/24.
//
#pragma once
#ifndef J3ML_LINESEGMENT_H
#define J3ML_LINESEGMENT_H
#endif //J3ML_LINESEGMENT_H
namespace Geometry
{
class LineSegment
{
Vector3 A;
Vector3 B;
};
}

View File

@@ -1,8 +1,9 @@
//
// Created by dawsh on 1/25/24.
//
#pragma once
#ifndef J3ML_QUADTREE_H
#define J3ML_QUADTREE_H
namespace Geometry
{
class QuadTree
{
#endif //J3ML_QUADTREE_H
};
}

View File

@@ -2,7 +2,15 @@
// Created by dawsh on 1/25/24.
//
#ifndef J3ML_RAY_H
#define J3ML_RAY_H
#pragma once
#endif //J3ML_RAY_H
#include <J3ML/LinearAlgebra/Vector3.h>
namespace Geometry
{
class Ray
{
Vector3 Origin;
Vector3 Direction;
};
}

View File

@@ -1,8 +1,6 @@
//
// Created by dawsh on 1/25/24.
//
#pragma once
#ifndef J3ML_TRIANGLE_H
#define J3ML_TRIANGLE_H
namespace Geometry
{
#endif //J3ML_TRIANGLE_H
}

View File

@@ -1,8 +1,9 @@
//
// Created by dawsh on 1/25/24.
//
#pragma once
#ifndef J3ML_TRIANGLEMESH_H
#define J3ML_TRIANGLEMESH_H
namespace Geometry
{
class TriangleMesh
{
#endif //J3ML_TRIANGLEMESH_H
};
}