1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-09 01:07:16 +01:00
SqMod/source/Base/AABB.hpp

325 lines
9.7 KiB
C++
Raw Normal View History

2015-09-30 02:56:11 +02:00
#ifndef _BASE_AABB_HPP_
#define _BASE_AABB_HPP_
// ------------------------------------------------------------------------------------------------
#include "Base/Vector3.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
*
2015-09-30 02:56:11 +02:00
*/
struct AABB
{
/* --------------------------------------------------------------------------------------------
* ...
*/
typedef float Value;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static const AABB NIL;
static const AABB MIN;
static const AABB MAX;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static SQChar Delim;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
Vector3 min, max;
/* --------------------------------------------------------------------------------------------
*
*/
AABB();
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB(Value sv);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB(Value xv, Value yv, Value zv);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB(const Vector3 & vmin, const Vector3 & vmax);
/* --------------------------------------------------------------------------------------------
*
*/
AABB(const AABB & o);
/* --------------------------------------------------------------------------------------------
*
*/
2015-09-30 02:56:11 +02:00
~AABB();
/* --------------------------------------------------------------------------------------------
*
*/
AABB & operator = (const AABB & o);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator = (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator = (const Vector3 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator = (const Vector4 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
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);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator += (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator -= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator *= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator /= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator %= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator ++ ();
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB & operator -- ();
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB operator ++ (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB operator -- (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
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;
/* --------------------------------------------------------------------------------------------
* ...
*/
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;
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB operator + () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB operator - () 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;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator >= (const AABB & b) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Int32 Cmp(const AABB & b) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
CSStr ToString() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
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);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const AABB & b);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector3 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector3 & nmin, const Vector3 & nmax);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector4 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector4 & nmin, const Vector4 & nmax);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(CSStr values, SQChar delim);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Clear()
{
min.Clear();
max.Clear();
}
/* --------------------------------------------------------------------------------------------
* ...
*/
AABB Abs() const;
2015-09-30 02:56:11 +02:00
};
} // Namespace:: SqMod
#endif // _BASE_AABB_HPP_