106 void Init_Random(
float min_center = -1.0f,
float max_center = 1.0f,
float min_extent = 0.5f,
float max_extent = 1.0f);
264 for (
int i=1; i<num; i++) {
265 if (Min.
X > points[i].
X) Min.
X = points[i].
X;
266 if (Min.
Y > points[i].
Y) Min.
Y = points[i].
Y;
267 if (Min.
Z > points[i].
Z) Min.
Z = points[i].
Z;
269 if (Max.
X < points[i].
X) Max.
X = points[i].
X;
270 if (Max.
Y < points[i].
Y) Max.
Y = points[i].
Y;
271 if (Max.
Z < points[i].
Z) Max.
Z = points[i].
Z;
274 Center = (Max + Min) * 0.5f;
275 Extent = (Max - Min) * 0.5f;
323 Center = (max_corner + min_corner) * 0.5f;
324 Extent = (max_corner - min_corner) * 0.5f;
363 if (Min.
X > point.
X) Min.
X = point.
X;
364 if (Min.
Y > point.
Y) Min.
Y = point.
Y;
365 if (Min.
Z > point.
Z) Min.
Z = point.
Z;
367 if (Max.
X < point.
X) Max.
X = point.
X;
368 if (Max.
Y < point.
Y) Max.
Y = point.
Y;
369 if (Max.
Z < point.
Z) Max.
Z = point.
Z;
371 Center = (Max + Min) / 2.0f;
372 Extent = (Max - Min) / 2.0f;
396 Center = (newmax + newmin) * 0.5f;
397 Extent = (newmax - newmin) * 0.5f;
421 Center = (newmax + newmin) * 0.5f;
422 Extent = (newmax - newmin) * 0.5f;
439 float x =
Extent[0] * axis[0];
440 float y =
Extent[1] * axis[1];
441 float z =
Extent[2] * axis[2];
526 assert(points !=
NULL);
529 for (
int i=0; i<num; i++) {
629 assert(max_corner.
X >= min_corner.
X);
630 assert(max_corner.
Y >= min_corner.
Y);
631 assert(max_corner.
Z >= min_corner.
Z);
633 if (min_corner == max_corner)
return;
WWINLINE AABoxClass(const Vector3 ¢er, const Vector3 &extent)
WWINLINE void Init(const Vector3 ¢er, const Vector3 &extent)
void Add_Point(const Vector3 &point)
bool operator!=(const AABoxClass &src)
WWINLINE float Volume(void) const
void Translate(const Vector3 &pos)
void Transform(const Matrix3D &tm)
float Project_To_Axis(const Vector3 &axis) const
void Init_Min_Max(const Vector3 &min, const Vector3 &max)
AABoxClass(const MinMaxAABoxClass &minmaxbox)
WWINLINE AABoxClass(void)
WWINLINE bool Contains(const Vector3 &point) const
bool operator==(const AABoxClass &src)
void Add_Box(const AABoxClass &b)
AABoxClass(Vector3 *points, int num)
void Init_Random(float min_center=-1.0f, float max_center=1.0f, float min_extent=0.5f, float max_extent=1.0f)
static OverlapType Overlap_Test(const AAPlaneClass &plane, const Vector3 &point)
const Vector3 & Get_P1() const
const Vector3 & Get_P0() const
void Transform_Min_Max_AABox(const Vector3 &min, const Vector3 &max, Vector3 *set_min, Vector3 *set_max) const
void Transform_Center_Extent_AABox(const Vector3 ¢er, const Vector3 &extent, Vector3 *set_center, Vector3 *set_extent) const
WWINLINE float Volume(void) const
void Add_Box(const MinMaxAABoxClass &box)
void Add_Point(const Vector3 &point)
WWINLINE MinMaxAABoxClass(void)
WWINLINE void Init(Vector3 *points, int num)
WWINLINE MinMaxAABoxClass(Vector3 *points, int num)
WWINLINE MinMaxAABoxClass(const AABoxClass &that)
void Transform(const Matrix3D &tm)
void Translate(const Vector3 &pos)
WWINLINE MinMaxAABoxClass(const Vector3 &min_corner, const Vector3 &max_corner)
WWINLINE void Update_Max(const Vector3 &a)
WWINLINE void Update_Min(const Vector3 &a)
static WWINLINE float Fabs(float val)