Implement Triangle::NumFaces NumEdges NumVertices CenterPoint Intersects(LineSegment)
This commit is contained in:
@@ -14,6 +14,13 @@ namespace J3ML::Geometry
|
||||
Vector3 V1;
|
||||
Vector3 V2;
|
||||
public:
|
||||
|
||||
public:
|
||||
static int NumFaces() { return 1; }
|
||||
static int NumEdges() { return 3; }
|
||||
static int NumVertices() { return 3; }
|
||||
public:
|
||||
|
||||
float DistanceSq(const Vector3 &point) const;
|
||||
|
||||
/// Returns a new triangle, translated with a direction vector
|
||||
@@ -28,6 +35,10 @@ namespace J3ML::Geometry
|
||||
|
||||
AABB BoundingAABB() const;
|
||||
|
||||
Vector3 Centroid() const;
|
||||
|
||||
Vector3 CenterPoint() const;
|
||||
|
||||
/// Tests if the given object is fully contained inside this triangle.
|
||||
/** @param triangleThickness An epsilon threshold value to use for this test. triangleThicknessSq is the squared version of this parameter.
|
||||
This specifies the maximum distance the given object can lie from the plane defined by this triangle.
|
||||
@@ -37,6 +48,9 @@ namespace J3ML::Geometry
|
||||
bool Contains(const LineSegment& lineSeg, float triangleThickness = 1e-3f) const;
|
||||
bool Contains(const Triangle& triangle, float triangleThickness = 1e-3f) const;
|
||||
|
||||
|
||||
bool Intersects(const LineSegment& lineSegment, float* d = 0, Vector3* intersectionPoint = 0) const;
|
||||
|
||||
/// Project the triangle onto an axis, and returns the min and max value with the axis as a unit
|
||||
Interval ProjectionInterval(const Vector3& axis) const;
|
||||
void ProjectToAxis(const Vector3 &axis, float &dMin, float &dMax) const;
|
||||
|
Reference in New Issue
Block a user