Several files renamed to match new consistency-style of preferring .hpp over .h to indicate C++ Headers
This commit is contained in:
54
include/J3ML/Geometry/AABB2D.hpp
Normal file
54
include/J3ML/Geometry/AABB2D.hpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <J3ML/LinearAlgebra/Vector2.h>
|
||||
#include "Shape.h"
|
||||
|
||||
namespace J3ML::Geometry
|
||||
{
|
||||
using LinearAlgebra::Vector2;
|
||||
// CaveGame AABB
|
||||
class AABB2D : public Shape2D
|
||||
{
|
||||
public:
|
||||
|
||||
Vector2 minPoint;
|
||||
Vector2 maxPoint;
|
||||
AABB2D() {}
|
||||
AABB2D(const Vector2& min, const Vector2& max):
|
||||
minPoint(min), maxPoint(max)
|
||||
{}
|
||||
|
||||
float Width() const;
|
||||
float Height() const;
|
||||
|
||||
float DistanceSq(const Vector2& pt) const;
|
||||
|
||||
void SetNegativeInfinity();
|
||||
|
||||
void Enclose(const Vector2& point);
|
||||
|
||||
bool Intersects(const AABB2D& rhs) const;
|
||||
|
||||
bool Contains(const AABB2D& rhs) const;
|
||||
|
||||
bool Contains(const Vector2& pt) const;
|
||||
|
||||
bool Contains(int x, int y) const;
|
||||
|
||||
bool IsDegenerate() const;
|
||||
|
||||
bool HasNegativeVolume() const;
|
||||
|
||||
bool IsFinite() const;
|
||||
|
||||
Vector2 PosInside(const Vector2 &normalizedPos) const;
|
||||
|
||||
Vector2 ToNormalizedLocalSpace(const Vector2 &pt) const;
|
||||
|
||||
|
||||
AABB2D operator+(const Vector2& pt) const;
|
||||
|
||||
AABB2D operator-(const Vector2& pt) const;
|
||||
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user