1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-12 07:47:12 +01:00
SqMod/source/Base/AABB.hpp

118 lines
5.8 KiB
C++
Raw Normal View History

2015-09-30 03:56:11 +03:00
#ifndef _BASE_AABB_HPP_
#define _BASE_AABB_HPP_
// ------------------------------------------------------------------------------------------------
#include "Config.hpp"
#include "Base/Vector3.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* ...
*/
struct AABB
{
// --------------------------------------------------------------------------------------------
typedef SQFloat Value;
// --------------------------------------------------------------------------------------------
static const AABB NIL;
static const AABB MIN;
static const AABB MAX;
// --------------------------------------------------------------------------------------------
static SQChar Delim;
// --------------------------------------------------------------------------------------------
Vector3 min, max;
// --------------------------------------------------------------------------------------------
AABB();
AABB(Value s);
AABB(Value x, Value y, Value z);
AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB(const Vector3 & b);
AABB(const Vector3 & vmin, const Vector3 & vmax);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB(const Vector4 & b);
AABB(const Vector4 & vmin, const Vector4 & vmax);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB(const SQChar * values, SQChar delim);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB(const AABB & b);
AABB(AABB && b);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
~AABB();
// --------------------------------------------------------------------------------------------
AABB & operator = (const AABB & b);
AABB & operator = (AABB && b);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB & operator = (Value s);
AABB & operator = (const Vector3 & v);
AABB & operator = (const Vector4 & v);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB & operator += (const AABB & b);
AABB & operator -= (const AABB & b);
AABB & operator *= (const AABB & b);
AABB & operator /= (const AABB & b);
AABB & operator %= (const AABB & b);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB & operator += (Value s);
AABB & operator -= (Value s);
AABB & operator *= (Value s);
AABB & operator /= (Value s);
AABB & operator %= (Value s);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB & operator ++ ();
AABB & operator -- ();
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB operator ++ (int);
AABB operator -- (int);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB operator + (const AABB & b) const;
AABB operator - (const AABB & b) const;
AABB operator * (const AABB & b) const;
AABB operator / (const AABB & b) const;
AABB operator % (const AABB & b) const;
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB operator + (Value s) const;
AABB operator - (Value s) const;
AABB operator * (Value s) const;
AABB operator / (Value s) const;
AABB operator % (Value s) const;
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB operator + () const;
AABB operator - () const;
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
bool operator == (const AABB & b) const;
bool operator != (const AABB & b) const;
bool operator < (const AABB & b) const;
bool operator > (const AABB & b) const;
bool operator <= (const AABB & b) const;
bool operator >= (const AABB & b) const;
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
SQInteger Cmp(const AABB & b) const;
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
const SQChar * ToString() const;
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
void Set(Value ns);
void Set(Value nx, Value ny, Value nz);
void Set(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
void Set(const AABB & b);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
void Set(const Vector3 & v);
void Set(const Vector3 & nmin, const Vector3 & nmax);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
void Set(const Vector4 & v);
void Set(const Vector4 & nmin, const Vector4 & nmax);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
void Set(const SQChar * values, SQChar delim);
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
void Clear() { min.Clear(); max.Clear(); }
2015-09-30 03:56:11 +03:00
// --------------------------------------------------------------------------------------------
AABB Abs() const;
2015-09-30 03:56:11 +03:00
};
} // Namespace:: SqMod
#endif // _BASE_AABB_HPP_