27 lines
723 B
C++
27 lines
723 B
C++
#pragma once
|
|
|
|
#include "LineSegment.h"
|
|
#include <J3ML/LinearAlgebra/Vector3.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);
|
|
};
|
|
} |