2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-09-30 02:56:11 +02:00
|
|
|
#include "Base/AABB.hpp"
|
2016-11-13 07:32:04 +01:00
|
|
|
#include "Base/Sphere.hpp"
|
2016-08-24 22:16:53 +02:00
|
|
|
#include "Base/DynArg.hpp"
|
2021-01-30 07:51:39 +01:00
|
|
|
#include "Core/Buffer.hpp"
|
|
|
|
#include "Core/Utility.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-11-15 20:20:57 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
SQMOD_DECL_TYPENAME(Typename, _SC("AABB"))
|
2016-11-15 20:20:57 +01:00
|
|
|
|
2015-09-30 02:56:11 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
const AABB AABB::NIL = AABB(0, 0);
|
2015-09-30 02:56:11 +02:00
|
|
|
const AABB AABB::MIN = AABB(-1, -1, -1, 1, 1, 1);
|
2016-11-13 07:32:04 +01:00
|
|
|
const AABB AABB::MAX = AABB(HUGE_VALF, -HUGE_VALF);
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQChar AABB::Delim = ',';
|
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-03-22 08:16:40 +01:00
|
|
|
AABB::AABB(Value mins, Value maxs) noexcept
|
2016-11-13 07:32:04 +01:00
|
|
|
: min(mins), max(maxs)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
/* ... */
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-03-22 08:16:40 +01:00
|
|
|
AABB::AABB(Value xv, Value yv, Value zv) noexcept
|
2016-11-13 07:32:04 +01:00
|
|
|
: min(xv, yv, zv)
|
|
|
|
, max(xv, yv, zv)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
/* ... */
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-03-22 08:16:40 +01:00
|
|
|
AABB::AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax) noexcept
|
2015-09-30 02:56:11 +02:00
|
|
|
: min(xmin, ymin, zmin), max(xmax, ymax, zmax)
|
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
/* ... */
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-03-22 08:16:40 +01:00
|
|
|
AABB::AABB(const Vector3 & vmin, const Vector3 & vmax) noexcept
|
2015-09-30 02:56:11 +02:00
|
|
|
: min(vmin), max(vmax)
|
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
/* ... */
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator = (const Vector3 & v)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
DefineVector3(v);
|
2015-09-30 02:56:11 +02:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator += (const AABB & b)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min += b.min;
|
|
|
|
max += b.max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator -= (const AABB & b)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min -= b.min;
|
|
|
|
max -= b.max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator *= (const AABB & b)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min *= b.min;
|
|
|
|
max *= b.max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator /= (const AABB & b)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min /= b.min;
|
|
|
|
max /= b.max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator %= (const AABB & b)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min %= b.min;
|
|
|
|
max %= b.max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator += (Value s)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min += s;
|
|
|
|
max += s;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator -= (Value s)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min -= s;
|
|
|
|
max -= s;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator *= (Value s)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min *= s;
|
|
|
|
max *= s;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator /= (Value s)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min /= s;
|
|
|
|
max /= s;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator %= (Value s)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min %= s;
|
|
|
|
max %= s;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator ++ ()
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
++min;
|
|
|
|
++max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB & AABB::operator -- ()
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
--min;
|
|
|
|
--max;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-03-22 08:16:40 +01:00
|
|
|
AABB AABB::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
AABB state(*this);
|
|
|
|
++min;
|
|
|
|
++max;
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-03-22 08:16:40 +01:00
|
|
|
AABB AABB::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
AABB state(*this);
|
|
|
|
--min;
|
|
|
|
--max;
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator + (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return {min + b.min, max + b.max};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator - (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min - b.min, max - b.max};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator * (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min * b.min, max * b.max};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator / (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min / b.min, max / b.max};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator % (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min % b.min, max % b.max};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator + (Value s) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min + s, max + s};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator - (Value s) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min - s, max - s};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator * (Value s) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min * s, max * s};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator / (Value s) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min / s, max / s};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator % (Value s) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min % s, max % s};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator + () const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{min.Abs(), max.Abs()};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
AABB AABB::operator - () const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2020-03-22 08:16:40 +01:00
|
|
|
return AABB{-min, -max};
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool AABB::operator == (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
return (min == b.min) && (max == b.max);
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool AABB::operator != (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-07-29 17:00:10 +02:00
|
|
|
return (min != b.min) || (max != b.max);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool AABB::operator < (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
return (min < b.min) && (max < b.max);
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool AABB::operator > (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
return (min > b.min) && (max > b.max);
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool AABB::operator <= (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
return (min <= b.min) && (max <= b.max);
|
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool AABB::operator >= (const AABB & b) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
return (min >= b.min) && (max >= b.max);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::Cmp(const AABB & o) const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-02-21 06:39:33 +01:00
|
|
|
if (*this == o)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
return 0;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-21 06:39:33 +01:00
|
|
|
else if (*this > o)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
return 1;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
else
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
return -1;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
String AABB::ToString() const
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2021-01-30 07:51:39 +01:00
|
|
|
return fmt::format("{},{},{},{},{},{}", min.x, min.y, min.z, max.x, max.y, max.z);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-02-17 16:23:59 +01:00
|
|
|
void AABB::SetStr(SQChar delim, StackStrF & values)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-16 14:12:19 +01:00
|
|
|
DefineAABB(AABB::GetEx(delim, values));
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::Clear()
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
min.SetVector3Ex(HUGE_VALF, HUGE_VALF, HUGE_VALF);
|
|
|
|
max.SetVector3Ex(-HUGE_VALF, -HUGE_VALF, -HUGE_VALF);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineScalar(Value mins, Value maxs)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
min.SetVector3Ex(mins, mins, mins);
|
|
|
|
max.SetVector3Ex(maxs, maxs, maxs);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineVector3(const Vector3 & point)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
min = max = point;
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineVector3Ex(Value x, Value y, Value z)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
min.SetVector3Ex(x, y, z);
|
|
|
|
max.SetVector3Ex(x, y, z);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineAllVector3(const Vector3 & nmin, const Vector3 & nmax)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
min = nmin;
|
|
|
|
max = nmax;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineAllVector3Ex(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax)
|
|
|
|
{
|
|
|
|
min.SetVector3Ex(xmin, ymin, zmin);
|
|
|
|
max.SetVector3Ex(xmax, ymax, zmax);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void AABB::DefineAABB(const AABB & box)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
min = box.min;
|
|
|
|
max = box.max;
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-24 22:18:27 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineSphere(const Sphere & sphere)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
min = sphere.pos + Vector3(-sphere.rad);
|
|
|
|
max = sphere.pos + Vector3(sphere.rad);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::DefineSphereEx(Value x, Value y, Value z, Value r)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
DefineSphere(Sphere(x, y, z, r));
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-13 07:32:04 +01:00
|
|
|
void AABB::MergeVector3(const Vector3 & point)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2016-11-13 07:32:04 +01:00
|
|
|
MergeVector3Ex(point.x, point.y, point.z);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void AABB::MergeVector3Ex(Value x, Value y, Value z)
|
|
|
|
{
|
|
|
|
if (x < min.x)
|
|
|
|
{
|
|
|
|
min.x = x;
|
|
|
|
}
|
|
|
|
if (y < min.y)
|
|
|
|
{
|
|
|
|
min.y = y;
|
|
|
|
}
|
|
|
|
if (z < min.z)
|
|
|
|
{
|
|
|
|
min.z = z;
|
|
|
|
}
|
|
|
|
if (x > max.x)
|
|
|
|
{
|
|
|
|
max.x = x;
|
|
|
|
}
|
|
|
|
if (y > max.y)
|
|
|
|
{
|
|
|
|
max.y = y;
|
|
|
|
}
|
|
|
|
if (z > max.z)
|
|
|
|
{
|
|
|
|
max.z = z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void AABB::MergeAABB(const AABB & box)
|
|
|
|
{
|
|
|
|
if (box.min.x < min.x)
|
|
|
|
{
|
|
|
|
min.x = box.min.x;
|
|
|
|
}
|
|
|
|
if (box.min.y < min.y)
|
|
|
|
{
|
|
|
|
min.y = box.min.y;
|
|
|
|
}
|
|
|
|
if (box.min.z < min.z)
|
|
|
|
{
|
|
|
|
min.z = box.min.z;
|
|
|
|
}
|
|
|
|
if (box.max.x > max.x)
|
|
|
|
{
|
|
|
|
max.x = box.max.x;
|
|
|
|
}
|
|
|
|
if (box.max.y > max.y)
|
|
|
|
{
|
|
|
|
max.y = box.max.y;
|
|
|
|
}
|
|
|
|
if (box.max.z > max.z)
|
|
|
|
{
|
|
|
|
max.z = box.max.z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void AABB::MergeAABBEx(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax)
|
|
|
|
{
|
|
|
|
if (xmin < min.x)
|
|
|
|
{
|
|
|
|
min.x = xmin;
|
|
|
|
}
|
|
|
|
if (ymin < min.y)
|
|
|
|
{
|
|
|
|
min.y = ymin;
|
|
|
|
}
|
|
|
|
if (zmin < min.z)
|
|
|
|
{
|
|
|
|
min.z = zmin;
|
|
|
|
}
|
|
|
|
if (xmax > max.x)
|
|
|
|
{
|
|
|
|
max.x = xmax;
|
|
|
|
}
|
|
|
|
if (ymax > max.y)
|
|
|
|
{
|
|
|
|
max.y = ymax;
|
|
|
|
}
|
|
|
|
if (zmax > max.z)
|
|
|
|
{
|
|
|
|
max.z = zmax;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void AABB::MergeSphere(const Sphere & sphere)
|
|
|
|
{
|
|
|
|
MergeVector3(sphere.pos + Vector3(sphere.rad));
|
|
|
|
MergeVector3(sphere.pos + Vector3(-sphere.rad));
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void AABB::MergeSphereEx(Value x, Value y, Value z, Value r)
|
|
|
|
{
|
|
|
|
MergeSphere(Sphere(x, y, z, r));
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool AABB::Empty() const
|
|
|
|
{
|
|
|
|
return (min == max);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool AABB::Defined() const
|
|
|
|
{
|
|
|
|
return min.x != HUGE_VALF;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Vector3 AABB::Center() const
|
|
|
|
{
|
|
|
|
return (max + min) * 0.5f;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Vector3 AABB::Size() const
|
|
|
|
{
|
|
|
|
return max - min;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Vector3 AABB::HalfSize() const
|
|
|
|
{
|
|
|
|
return (max - min) * 0.5f;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
AABB::Value AABB::Radius() const
|
|
|
|
{
|
|
|
|
return Size().GetLength() / Value(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
AABB::Value AABB::Volume() const
|
|
|
|
{
|
|
|
|
const Vector3 v = Size();
|
|
|
|
return static_cast< Value >(v.x * v.y * v.z);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
AABB::Value AABB::Area() const
|
|
|
|
{
|
|
|
|
const Vector3 v = Size();
|
|
|
|
return static_cast< Value >(Value(2) * (v.x * v.y + v.x * v.z + v.y * v.z));
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsVector3Inside(const Vector3 & point) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
return (point.x < min.x || point.x > max.x ||
|
|
|
|
point.y < min.y || point.y > max.y ||
|
|
|
|
point.z < min.z || point.z > max.z) ? SQMODI_OUTSIDE : SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsVector3InsideEx(Value x, Value y, Value z) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
return (x < min.x || x > max.x ||
|
|
|
|
y < min.y || y > max.y ||
|
|
|
|
z < min.z || z > max.z) ? SQMODI_OUTSIDE : SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsAABBInside(const AABB & box) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
if (box.max.x < min.x || box.min.x > max.x ||
|
|
|
|
box.max.y < min.y || box.min.y > max.y ||
|
|
|
|
box.max.z < min.z || box.min.z > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_OUTSIDE;
|
|
|
|
}
|
|
|
|
else if (box.min.x < min.x || box.max.x > max.x ||
|
|
|
|
box.min.y < min.y || box.max.y > max.y ||
|
|
|
|
box.min.z < min.z || box.max.z > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_INTERSECTS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsAABBInsideEx(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
if (xmax < min.x || xmin > max.x ||
|
|
|
|
ymax < min.y || ymin > max.y ||
|
|
|
|
zmax < min.z || zmin > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_OUTSIDE;
|
|
|
|
}
|
|
|
|
else if (xmin < min.x || xmax > max.x ||
|
|
|
|
ymin < min.y || ymax > max.y ||
|
|
|
|
zmin < min.z || zmax > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_INTERSECTS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsAABBInsideFast(const AABB & box) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
if (box.max.x < min.x || box.min.x > max.x ||
|
|
|
|
box.max.y < min.y || box.min.y > max.y ||
|
|
|
|
box.max.z < min.z || box.min.z > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_OUTSIDE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsAABBInsideFastEx(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
if (xmax < min.x || xmin > max.x ||
|
|
|
|
ymax < min.y || ymin > max.y ||
|
|
|
|
zmax < min.z || zmin > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_OUTSIDE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsSphereInside(const Sphere & sphere) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
Value dist_squared = 0, temp;
|
|
|
|
const Vector3 & center = sphere.pos;
|
|
|
|
|
|
|
|
if (center.x < min.x)
|
|
|
|
{
|
|
|
|
temp = center.x - min.x;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
else if (center.x > max.x)
|
|
|
|
{
|
|
|
|
temp = center.x - max.x;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
if (center.y < min.y)
|
|
|
|
{
|
|
|
|
temp = center.y - min.y;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
else if (center.y > max.y)
|
|
|
|
{
|
|
|
|
temp = center.y - max.y;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
if (center.z < min.z)
|
|
|
|
{
|
|
|
|
temp = center.z - min.z;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
else if (center.z > max.z)
|
|
|
|
{
|
|
|
|
temp = center.z - max.z;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Value radius = sphere.rad;
|
|
|
|
|
|
|
|
if (dist_squared >= radius * radius)
|
|
|
|
{
|
|
|
|
return SQMODI_OUTSIDE;
|
|
|
|
}
|
|
|
|
else if (center.x - radius < min.x || center.x + radius > max.x || center.y - radius < min.y ||
|
|
|
|
center.y + radius > max.y || center.z - radius < min.z || center.z + radius > max.z)
|
|
|
|
{
|
|
|
|
return SQMODI_INTERSECTS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsSphereInsideEx(Value x, Value y, Value z, Value r) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
return IsSphereInside(Sphere(x, y, z, r));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsSphereInsideFast(const Sphere & sphere) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
Value dist_squared = 0, temp;
|
|
|
|
const Vector3& center = sphere.pos;
|
|
|
|
|
|
|
|
if (center.x < min.x)
|
|
|
|
{
|
|
|
|
temp = center.x - min.x;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
else if (center.x > max.x)
|
|
|
|
{
|
|
|
|
temp = center.x - max.x;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
if (center.y < min.y)
|
|
|
|
{
|
|
|
|
temp = center.y - min.y;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
else if (center.y > max.y)
|
|
|
|
{
|
|
|
|
temp = center.y - max.y;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
if (center.z < min.z)
|
|
|
|
{
|
|
|
|
temp = center.z - min.z;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
else if (center.z > max.z)
|
|
|
|
{
|
|
|
|
temp = center.z - max.z;
|
|
|
|
dist_squared += temp * temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Value radius = sphere.rad;
|
|
|
|
|
|
|
|
if (dist_squared >= radius * radius)
|
|
|
|
{
|
|
|
|
return SQMODI_OUTSIDE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return SQMODI_INSIDE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t AABB::IsSphereInsideFastEx(Value x, Value y, Value z, Value r) const
|
2016-11-13 07:32:04 +01:00
|
|
|
{
|
|
|
|
return IsSphereInsideFast(Sphere(x, y, z, r));
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2020-09-03 19:33:51 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
String AABB::Format(StackStrF & str) const
|
2020-09-03 19:33:51 +02:00
|
|
|
{
|
2021-07-03 13:09:58 +02:00
|
|
|
return fmt::format(fmt::runtime(str.ToStr())
|
2021-01-30 07:51:39 +01:00
|
|
|
, fmt::arg("min_x", min.x)
|
|
|
|
, fmt::arg("min_y", min.y)
|
|
|
|
, fmt::arg("min_z", min.z)
|
|
|
|
, fmt::arg("max_x", max.x)
|
|
|
|
, fmt::arg("max_y", max.y)
|
|
|
|
, fmt::arg("max_z", max.z)
|
|
|
|
);
|
2020-09-03 19:33:51 +02:00
|
|
|
}
|
|
|
|
|
2016-03-21 21:37:58 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-02-17 16:23:59 +01:00
|
|
|
const AABB & AABB::Get(StackStrF & str)
|
2016-03-21 21:37:58 +01:00
|
|
|
{
|
2016-11-16 14:12:19 +01:00
|
|
|
return AABB::GetEx(AABB::Delim, str);
|
2016-03-21 21:37:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-02-17 16:23:59 +01:00
|
|
|
const AABB & AABB::GetEx(SQChar delim, StackStrF & str)
|
2016-03-21 21:37:58 +01:00
|
|
|
{
|
|
|
|
static AABB box;
|
|
|
|
// Clear previous values, if any
|
|
|
|
box.Clear();
|
|
|
|
// Is the specified string empty?
|
2016-11-16 14:12:19 +01:00
|
|
|
if (str.mLen <= 0)
|
2016-03-21 21:37:58 +01:00
|
|
|
{
|
|
|
|
return box; // Return the value as is!
|
|
|
|
}
|
2020-09-03 17:26:24 +02:00
|
|
|
// The format specifications that will be used to scan the string
|
|
|
|
SQChar fs[] = _SC(" %f , %f , %f , %f , %f , %f ");
|
2016-03-21 21:37:58 +01:00
|
|
|
// Assign the specified delimiter
|
|
|
|
fs[4] = delim;
|
|
|
|
fs[9] = delim;
|
|
|
|
fs[14] = delim;
|
|
|
|
fs[19] = delim;
|
|
|
|
fs[24] = delim;
|
|
|
|
// Attempt to extract the component values from the specified string
|
2016-11-16 14:12:19 +01:00
|
|
|
std::sscanf(str.mPtr, fs, &box.min.x, &box.min.y, &box.min.z, &box.max.x, &box.max.y, &box.max.z);
|
2016-03-21 21:37:58 +01:00
|
|
|
// Return the resulted value
|
|
|
|
return box;
|
|
|
|
}
|
|
|
|
|
2015-09-30 02:56:11 +02:00
|
|
|
// ================================================================================================
|
2016-02-20 23:25:00 +01:00
|
|
|
void Register_AABB(HSQUIRRELVM vm)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
typedef AABB::Value Val;
|
|
|
|
|
2016-11-15 20:55:03 +01:00
|
|
|
RootTable(vm).Bind(Typename::Str,
|
|
|
|
Class< AABB >(vm, Typename::Str)
|
2016-05-22 05:20:38 +02:00
|
|
|
// Constructors
|
2015-09-30 02:56:11 +02:00
|
|
|
.Ctor()
|
2016-11-13 07:32:04 +01:00
|
|
|
.Ctor< const AABB & >()
|
2016-02-20 23:25:00 +01:00
|
|
|
.Ctor< Val, Val, Val >()
|
|
|
|
.Ctor< Val, Val, Val, Val, Val, Val >()
|
|
|
|
.Ctor< const Vector3 &, const Vector3 & >()
|
2016-05-22 05:20:38 +02:00
|
|
|
// Member Variables
|
2016-07-17 14:39:59 +02:00
|
|
|
.Var(_SC("min"), &AABB::min)
|
|
|
|
.Var(_SC("max"), &AABB::max)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Var(_SC("Min"), &AABB::min)
|
|
|
|
.Var(_SC("Max"), &AABB::max)
|
2016-06-03 20:26:19 +02:00
|
|
|
// Core Meta-methods
|
2016-08-24 22:16:53 +02:00
|
|
|
.SquirrelFunc(_SC("cmp"), &SqDynArgFwd< SqDynArgCmpFn< AABB >, SQFloat, SQInteger, bool, std::nullptr_t, AABB >)
|
2016-11-15 20:20:57 +01:00
|
|
|
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
|
|
|
.Func(_SC("_tostring"), &AABB::ToString)
|
2016-06-03 20:26:19 +02:00
|
|
|
// Meta-methods
|
2016-08-24 22:16:53 +02:00
|
|
|
.SquirrelFunc(_SC("_add"), &SqDynArgFwd< SqDynArgAddFn< AABB >, SQFloat, SQInteger, bool, std::nullptr_t, AABB >)
|
|
|
|
.SquirrelFunc(_SC("_sub"), &SqDynArgFwd< SqDynArgSubFn< AABB >, SQFloat, SQInteger, bool, std::nullptr_t, AABB >)
|
|
|
|
.SquirrelFunc(_SC("_mul"), &SqDynArgFwd< SqDynArgMulFn< AABB >, SQFloat, SQInteger, bool, std::nullptr_t, AABB >)
|
|
|
|
.SquirrelFunc(_SC("_div"), &SqDynArgFwd< SqDynArgDivFn< AABB >, SQFloat, SQInteger, bool, std::nullptr_t, AABB >)
|
|
|
|
.SquirrelFunc(_SC("_modulo"), &SqDynArgFwd< SqDynArgModFn< AABB >, SQFloat, SQInteger, bool, std::nullptr_t, AABB >)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func< AABB (AABB::*)(void) const >(_SC("_unm"), &AABB::operator -)
|
2016-07-24 22:18:27 +02:00
|
|
|
// Properties
|
2016-11-13 07:32:04 +01:00
|
|
|
.Prop(_SC("Empty"), &AABB::Empty)
|
|
|
|
.Prop(_SC("Defined"), &AABB::Defined)
|
|
|
|
.Prop(_SC("Center"), &AABB::Center)
|
|
|
|
.Prop(_SC("Size"), &AABB::Size)
|
|
|
|
.Prop(_SC("Extent"), &AABB::Size)
|
|
|
|
.Prop(_SC("HalfSize"), &AABB::HalfSize)
|
|
|
|
.Prop(_SC("HalfExtent"), &AABB::HalfSize)
|
|
|
|
.Prop(_SC("Radius"), &AABB::Radius)
|
|
|
|
.Prop(_SC("Volume"), &AABB::Volume)
|
|
|
|
.Prop(_SC("Area"), &AABB::Area)
|
2016-07-24 22:18:27 +02:00
|
|
|
// Member Methods
|
2016-11-16 14:12:19 +01:00
|
|
|
.FmtFunc(_SC("SetStr"), &AABB::SetStr)
|
2016-07-24 22:18:27 +02:00
|
|
|
.Func(_SC("Clear"), &AABB::Clear)
|
2020-09-03 19:33:51 +02:00
|
|
|
.FmtFunc(_SC("Format"), &AABB::Format)
|
2016-11-13 07:32:04 +01:00
|
|
|
.Func(_SC("DefineScalar"), &AABB::DefineScalar)
|
|
|
|
.Func(_SC("DefineVector3"), &AABB::DefineVector3)
|
|
|
|
.Func(_SC("DefineVector3Ex"), &AABB::DefineVector3Ex)
|
|
|
|
.Func(_SC("DefineAllVector3"), &AABB::DefineAllVector3)
|
|
|
|
.Func(_SC("DefineAllVector3Ex"), &AABB::DefineAllVector3Ex)
|
|
|
|
.Func(_SC("DefineAABB"), &AABB::DefineAABB)
|
|
|
|
.Func(_SC("DefineSphere"), &AABB::DefineSphere)
|
|
|
|
.Func(_SC("DefineSphereEx"), &AABB::DefineSphereEx)
|
|
|
|
.Func(_SC("MergeVector3"), &AABB::MergeVector3)
|
|
|
|
.Func(_SC("MergeVector3Ex"), &AABB::MergeVector3Ex)
|
|
|
|
.Func(_SC("MergeAABB"), &AABB::MergeAABB)
|
|
|
|
.Func(_SC("MergeAABBEx"), &AABB::MergeAABBEx)
|
|
|
|
.Func(_SC("MergeSphere"), &AABB::MergeSphere)
|
|
|
|
.Func(_SC("MergeSphereEx"), &AABB::MergeSphereEx)
|
|
|
|
.Func(_SC("IsVector3Inside"), &AABB::IsVector3Inside)
|
|
|
|
.Func(_SC("IsVector3InsideEx"), &AABB::IsVector3InsideEx)
|
|
|
|
.Func(_SC("IsAABBInside"), &AABB::IsAABBInside)
|
|
|
|
.Func(_SC("IsAABBInsideEx"), &AABB::IsAABBInsideEx)
|
|
|
|
.Func(_SC("IsAABBInsideFast"), &AABB::IsAABBInsideFast)
|
|
|
|
.Func(_SC("IsAABBInsideFastEx"), &AABB::IsAABBInsideFastEx)
|
|
|
|
.Func(_SC("IsSphereInside"), &AABB::IsSphereInside)
|
|
|
|
.Func(_SC("IsSphereInsideEx"), &AABB::IsSphereInsideEx)
|
|
|
|
.Func(_SC("IsSphereInsideFast"), &AABB::IsSphereInsideFast)
|
|
|
|
.Func(_SC("IsSphereInsideFastEx"), &AABB::IsSphereInsideFastEx)
|
2016-07-24 20:29:37 +02:00
|
|
|
// Static Functions
|
|
|
|
.StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< AABB >)
|
|
|
|
.StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< AABB >)
|
2016-11-16 14:12:19 +01:00
|
|
|
.StaticFmtFunc(_SC("FromStr"), &AABB::Get)
|
|
|
|
.StaticFmtFunc(_SC("FromStrEx"), &AABB::GetEx)
|
2015-09-30 02:56:11 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|