8 #ifndef __UT_BoundingBox_h__
9 #define __UT_BoundingBox_h__
37 T axmax,
T aymax,
T azmax)
39 setBounds(axmin, aymin, azmin, axmax, aymax, azmax);
45 vals[0][0] = lowerbound[0];
46 vals[0][1] = upperbound[0];
47 vals[1][0] = lowerbound[1];
48 vals[1][1] = upperbound[1];
49 vals[2][0] = lowerbound[2];
50 vals[2][1] = upperbound[2];
88 return vals[0][0] == bbox.
vals[0][0] &&
97 return !(*
this == bbox);
157 T x_max,
T y_max,
T z_max)
180 for (
int i = 0; i < 6; ++i)
185 for (
int i = 0; i < 6; ++i)
313 template <
typename MATRIX>
315 template <
typename MATRIX>
331 vals[1][1] - vals[1][0],
332 vals[2][1] - vals[2][0]); }
336 return vals[axis][1] -
vals[axis][0];
378 {
return (
vals[axis][0] +
vals[axis][1])*0.5; }
413 T tmin=-1E17f,
T tmax=1E17f)
const;
429 template <
typename MATRIX>
431 const MATRIX &transform_matrix)
const;
455 std::ostream &operator<<(std::ostream &os, const UT_BoundingBoxT<T> &box)
467 static T computeDelta(
T bmin,
T bmax,
T val);
468 static T computeDelta(
T amin,
T amax,
T bmin,
T bmax);
470 template <
typename Y>
static Y getMinMantissa(
Y val,
int bits);
472 static T computeMaxDelta(
T bmin,
T bmax,
T val);
474 static T computeOverlapDelta(
T amin,
T amax,
T bmin,
T bmax);
484 template <
typename T>
493 template <
typename T>
497 return vals[0][0] <= vals[0][1] &&
498 vals[1][0] <= vals[1][1] &&
499 vals[2][0] <= vals[2][1];
502 template <
typename T>
508 const T minv = -maxv;
517 template <
typename T>
529 template <
typename T>
541 template <
typename T>
545 vals[0][0] =
SYSmin(vals[0][0], pt.
x());
546 vals[0][1] =
SYSmax(vals[0][1], pt.
x());
547 vals[1][0] =
SYSmin(vals[1][0], pt.
y());
548 vals[1][1] =
SYSmax(vals[1][1], pt.
y());
549 vals[2][0] =
SYSmin(vals[2][0], pt.
z());
550 vals[2][1] =
SYSmax(vals[2][1], pt.
z());
553 template <
typename T>
557 vals[0][0] =
SYSmin(vals[0][0], x);
558 vals[0][1] =
SYSmax(vals[0][1], x);
559 vals[1][0] =
SYSmin(vals[1][0], y);
560 vals[1][1] =
SYSmax(vals[1][1], y);
561 vals[2][0] =
SYSmin(vals[2][0], z);
562 vals[2][1] =
SYSmax(vals[2][1], z);
565 template <
typename T>
569 vals[0][0] =
SYSmin(vals[0][0], box(0, 0));
570 vals[0][1] =
SYSmax(vals[0][1], box(0, 1));
571 vals[1][0] =
SYSmin(vals[1][0], box(1, 0));
572 vals[1][1] =
SYSmax(vals[1][1], box(1, 1));
573 vals[2][0] =
SYSmin(vals[2][0], box(2, 0));
574 vals[2][1] =
SYSmax(vals[2][1], box(2, 1));
577 template <
typename T>
585 d = absolute + vals[0][1]*relative - vals[0][0]*relative;
586 vals[0][0] -= d; vals[0][1] += d;
587 d = absolute + vals[1][1]*relative - vals[1][0]*relative;
588 vals[1][0] -= d; vals[1][1] += d;
589 d = absolute + vals[2][1]*relative - vals[2][0]*relative;
590 vals[2][0] -= d; vals[2][1] += d;
593 template <
typename T>
597 vals[0][0] -= dltx; vals[0][1] += dltx;
598 vals[1][0] -= dlty; vals[1][1] += dlty;
599 vals[2][0] -= dltz; vals[2][1] += dltz;
602 template <
typename T>
606 if (vals[0][0] > pt.
x() || vals[0][1] < pt.
x())
return 0;
607 if (vals[1][0] > pt.
y() || vals[1][1] < pt.
y())
return 0;
608 if (vals[2][0] > pt.
z() || vals[2][1] < pt.
z())
return 0;
612 template <
typename T>
616 if (vals[0][0] > pt.
x() || vals[0][1] < pt.
x())
return 0;
617 if (vals[1][0] > pt.
y() || vals[1][1] < pt.
y())
return 0;
618 if (vals[2][0] > pt.
z() || vals[2][1] < pt.
z())
return 0;
622 template <
typename T>
626 if (vals[0][0] > x || vals[0][1] < x)
return 0;
627 if (vals[1][0] > y || vals[1][1] < y)
return 0;
628 if (vals[2][0] > z || vals[2][1] < z)
return 0;
632 template <
typename T>
636 if (vals[0][0] < box.
vals[0][0] || vals[0][1] > box.
vals[0][1])
return 0;
637 if (vals[1][0] < box.
vals[1][0] || vals[1][1] > box.
vals[1][1])
return 0;
638 if (vals[2][0] < box.
vals[2][0] || vals[2][1] > box.
vals[2][1])
return 0;
642 template <
typename T>
646 if (vals[0][0] > box.
vals[0][1] || vals[0][1] < box.
vals[0][0])
return 0;
647 if (vals[1][0] > box.
vals[1][1] || vals[1][1] < box.
vals[1][0])
return 0;
648 if (vals[2][0] > box.
vals[2][1] || vals[2][1] < box.
vals[2][0])
return 0;
652 template <
typename T>
659 vals[0][0] =
SYSmax(vals[0][0], box(0, 0));
660 vals[0][1] =
SYSmin(vals[0][1], box(0, 1));
661 vals[1][0] =
SYSmax(vals[1][0], box(1, 0));
662 vals[1][1] =
SYSmin(vals[1][1], box(1, 1));
663 vals[2][0] =
SYSmax(vals[2][0], box(2, 0));
664 vals[2][1] =
SYSmin(vals[2][1], box(2, 1));
668 #define UT_TESTMAX tmax = t1 < tmax ? t1 : tmax;
669 #define UT_TESTMIN tmin = t1 > tmin ? t1 : tmin;
671 #define UT_FASTBOX(idx) \
672 positive = (idir(idx) > 0.0); \
673 t1 = (vals[idx][ positive] - v0(idx))*idir(idx); UT_TESTMAX \
674 t1 = (vals[idx][!positive] - v0(idx))*idir(idx); UT_TESTMIN \
677 template <
typename T>
700 template <
typename T>
711 dist =
SYSmax(SYSsqrt(dist) - getRadius(), 0.0);
715 template <
typename T>
723 template <
typename T>
728 vals[0][0] = min.
x(); vals[0][1] = max.
x();
729 vals[1][0] = min.
y(); vals[1][1] = max.
y();
730 vals[2][0] = min.
z(); vals[2][1] = max.
z();
733 template <
typename T>
737 vals[0][0] = vals[0][1] = pt.
x();
738 vals[1][0] = vals[1][1] = pt.
y();
739 vals[2][0] = vals[2][1] = pt.
z();
742 template <
typename T>
746 vals[0][0] = box(0, 0);
747 vals[0][1] = box(0, 1);
748 vals[1][0] = box(1, 0);
749 vals[1][1] = box(1, 1);
750 vals[2][0] = box(2, 0);
751 vals[2][1] = box(2, 1);
754 template <
typename T>
759 vals[0][0] =
SYSmin(vals[0][0], min.
x());
760 vals[0][1] =
SYSmax(vals[0][1], max.
x());
761 vals[1][0] =
SYSmin(vals[1][0], min.
y());
762 vals[1][1] =
SYSmax(vals[1][1], max.
y());
763 vals[2][0] =
SYSmin(vals[2][0], min.
z());
764 vals[2][1] =
SYSmax(vals[2][1], max.
z());
767 template <
typename T>
771 vals[0][0] =
SYSmin(vals[0][0], pt.
x());
772 vals[0][1] =
SYSmax(vals[0][1], pt.
x());
773 vals[1][0] =
SYSmin(vals[1][0], pt.
y());
774 vals[1][1] =
SYSmax(vals[1][1], pt.
y());
775 vals[2][0] =
SYSmin(vals[2][0], pt.
z());
776 vals[2][1] =
SYSmax(vals[2][1], pt.
z());
782 template <
typename T>
783 template <
typename Y>
788 typedef typename FPRealUnion::uint_type UInt;
790 static const int exponent_bits = FPRealUnion::EXPONENT_BITS;
791 static const int mantissa_bits = FPRealUnion::MANTISSA_BITS;
795 tmp.uval >>= mantissa_bits;
796 tmp.uval &= ((UInt(1) << exponent_bits) - UInt(1));
797 tmp.uval -= mantissa_bits - bits;
798 tmp.uval <<= mantissa_bits;
802 template <
typename T>
810 for (i = 0; i < 3; i++)
812 val =
SYSmax(getMinMantissa(vals[i][0], bits),
813 getMinMantissa(vals[i][1], bits), min);
825 UT_ASSERT(!
"enlargeFloats is no-op for int64");
829 template <
typename T>
833 vals[0][0] =
SYSmax(vals[0][0], box(0, 0));
834 vals[0][1] =
SYSmin(vals[0][1], box(0, 1));
835 vals[1][0] =
SYSmax(vals[1][0], box(1, 0));
836 vals[1][1] =
SYSmin(vals[1][1], box(1, 1));
837 vals[2][0] =
SYSmax(vals[2][0], box(2, 0));
838 vals[2][1] =
SYSmin(vals[2][1], box(2, 1));
841 template <
typename T>
842 template <
typename MATRIX>
851 template <
typename T>
852 template <
typename MATRIX>
867 template <
typename T>
871 vals[0][0] += delta.
x();
872 vals[0][1] += delta.
x();
873 vals[1][0] += delta.
y();
874 vals[1][1] += delta.
y();
875 vals[2][0] += delta.
z();
876 vals[2][1] += delta.
z();
879 #define UT_TESTMAX(face) if (t < tmax) { \
880 if (t < tmin) return 0; \
884 #define UT_TESTMIN(face) if (t > tmin) { \
885 if (t > tmax) return 0; \
889 #define UT_FASTBOX(face) \
890 ray = 1.0 / d(face); \
891 positive = (ray > 0.0); \
892 t = (vals[face][ positive] - o(face))*ray; UT_TESTMAX(face) \
893 t = (vals[face][1-positive] - o(face))*ray; UT_TESTMIN(face) \
896 template <
typename T>
904 int positive, foundmin, foundmax;
920 if(foundmin == 0) nml->
assign(1.0, 0.0, 0.0);
921 else if(foundmin == 1) nml->
assign(0.0, 1.0, 0.0);
922 else nml->
assign(0.0, 0.0, 1.0);
925 if(distance) *distance = tmin;
928 else if (foundmax != -1)
935 if(foundmax == 0) nml->
assign(1.0, 0.0, 0.0);
936 else if(foundmax == 1) nml->
assign(0.0, 1.0, 0.0);
937 else nml->
assign(0.0, 0.0, 1.0);
940 if(distance) *distance = tmax;
950 #define UT_TESTMAX if(t < tmax) { if(t < tmin) return 0; tmax = t; }
951 #define UT_TESTMIN if(t > tmin) { if(t > tmax) return 0; tmin = t; }
953 #define UT_FASTBOX(face) \
954 ray = 1.0 / d(face); \
955 positive = (ray > 0.0); \
956 t = (vals[face][ positive] - o(face))*ray; UT_TESTMAX \
957 t = (vals[face][1-positive] - o(face))*ray; UT_TESTMIN \
960 template <
typename T>
964 T &tmin, T &tmax)
const
984 template <
typename T>
988 T radius, T mint, T maxt)
const
1011 template <
typename T>
1015 T t = vals[0][1] - vals[0][0];
1016 T d = vals[1][1] - vals[1][0];
1019 d = vals[2][1] - vals[2][0];
1024 template <
typename T>
1028 T t = vals[0][1] - vals[0][0];
1029 T d = vals[1][1] - vals[1][0];
1032 if (t < d) { t = d; axis = 1; }
1033 d = vals[2][1] - vals[2][0];
1034 if (t < d) { t = d; axis = 2; }
1038 template <
typename T>
1042 return (val > bmax) ? val - bmax :
SYSmin(val - bmin,
T(0));
1045 template <
typename T>
1051 delta.
x() = computeDelta(vals[0][0], vals[0][1], p.
x());
1052 delta.
y() = computeDelta(vals[1][0], vals[1][1], p.
y());
1053 delta.
z() = computeDelta(vals[2][0], vals[2][1], p.
z());
1058 template <
typename T>
1064 d1 =
SYSmax(bmin - amax,
T(0));
1065 d2 =
SYSmax(amin - bmax,
T(0));
1066 return d1 > d2 ? d1 : -d2;
1069 template <
typename T>
1075 delta.
x() = computeDelta(
1076 vals[0][0], vals[0][1], box.
vals[0][0], box.
vals[0][1]);
1077 delta.
y() = computeDelta(
1078 vals[1][0], vals[1][1], box.
vals[1][0], box.
vals[1][1]);
1079 delta.
z() = computeDelta(
1080 vals[2][0], vals[2][1], box.
vals[2][0], box.
vals[2][1]);
1085 template <
typename T>
1095 template <
typename T>
1101 delta.
x() = computeMaxDelta(vals[0][0], vals[0][1], p.
x());
1102 delta.
y() = computeMaxDelta(vals[1][0], vals[1][1], p.
y());
1103 delta.
z() = computeMaxDelta(vals[2][0], vals[2][1], p.
z());
1108 template <
typename T>
1118 return ((d1 < 0) != (d2 < 0)) ? 0 : (
SYSabs(d1) <
SYSabs(d2) ? d1 : d2);
1121 template <
typename T>
1127 delta.
x() = computeOverlapDelta(
1128 vals[0][0], vals[0][1], box.
vals[0][0], box.
vals[0][1]);
1129 delta.
y() = computeOverlapDelta(
1130 vals[1][0], vals[1][1], box.
vals[1][0], box.
vals[1][1]);
1131 delta.
z() = computeOverlapDelta(
1132 vals[2][0], vals[2][1], box.
vals[2][0], box.
vals[2][1]);
1137 template <
typename T>
1143 if (pt.
x() < vals[0][0]) code |= 1;
1144 else if (pt.
x() > vals[0][1]) code |= 2;
1145 if (pt.
y() < vals[1][0]) code |= 4;
1146 else if (pt.
y() > vals[1][1]) code |= 8;
1147 if (pt.
z() < vals[2][0]) code |= 16;
1148 else if (pt.
z() > vals[2][1]) code |= 32;
1153 template <
typename T>
1159 xlen = sizeX(); ylen = sizeY(); zlen = sizeZ();
1160 return 2*(xlen*ylen+ylen*zlen+zlen*xlen);
1163 template <
typename T>
1167 vals[0][0] += vec[0];
1168 vals[1][0] += vec[1];
1169 vals[2][0] += vec[2];
1172 template <
typename T>
1176 vals[0][1] += vec[0];
1177 vals[1][1] += vec[1];
1178 vals[2][1] += vec[2];
1181 template <
typename T>
1186 vals[0][0] *= scale[0]; vals[0][1] *= scale[0];
1187 vals[1][0] *= scale[1]; vals[1][1] *= scale[1];
1188 vals[2][0] *= scale[2]; vals[2][1] *= scale[2];
1189 vals[0][0] += offset[0]; vals[0][1] += offset[0];
1190 vals[1][0] += offset[1]; vals[1][1] += offset[1];
1191 vals[2][0] += offset[2]; vals[2][1] += offset[2];
1194 template <
typename T>
1198 return sizeX() > sizeY() ? (sizeX() > sizeZ() ? 0 : 2) :
1199 sizeY() > sizeZ() ? 1 : 2;
1202 template <
typename T>
1206 return sizeX() < sizeY() ? (sizeX() < sizeZ() ? 0 : 2) :
1207 sizeY() < sizeZ() ? 1 : 2;
1210 template <
typename T>
1214 ptarray[0].assign(vals[0][0], vals[1][0], vals[2][0]);
1215 ptarray[1].assign(vals[0][0], vals[1][0], vals[2][1]);
1216 ptarray[2].assign(vals[0][0], vals[1][1], vals[2][0]);
1217 ptarray[3].assign(vals[0][0], vals[1][1], vals[2][1]);
1218 ptarray[4].assign(vals[0][1], vals[1][0], vals[2][0]);
1219 ptarray[5].assign(vals[0][1], vals[1][0], vals[2][1]);
1220 ptarray[6].assign(vals[0][1], vals[1][1], vals[2][0]);
1221 ptarray[7].assign(vals[0][1], vals[1][1], vals[2][1]);
1224 template <
typename T>
1228 ptarray[0].assign(vals[0][0], vals[1][0], vals[2][0], 1.0);
1229 ptarray[1].assign(vals[0][0], vals[1][0], vals[2][1], 1.0);
1230 ptarray[2].assign(vals[0][0], vals[1][1], vals[2][0], 1.0);
1231 ptarray[3].assign(vals[0][0], vals[1][1], vals[2][1], 1.0);
1232 ptarray[4].assign(vals[0][1], vals[1][0], vals[2][0], 1.0);
1233 ptarray[5].assign(vals[0][1], vals[1][0], vals[2][1], 1.0);
1234 ptarray[6].assign(vals[0][1], vals[1][1], vals[2][0], 1.0);
1235 ptarray[7].assign(vals[0][1], vals[1][1], vals[2][1], 1.0);
1238 template <
typename T>
1239 template <
typename MATRIX>
1243 const MATRIX &transform_matrix)
const
1245 ptarray[0].assign(vals[0][0], vals[1][0], vals[2][0]);
1246 ptarray[1].assign(vals[0][0], vals[1][0], vals[2][1]);
1247 ptarray[2].assign(vals[0][0], vals[1][1], vals[2][0]);
1248 ptarray[3].assign(vals[0][0], vals[1][1], vals[2][1]);
1249 ptarray[4].assign(vals[0][1], vals[1][0], vals[2][0]);
1250 ptarray[5].assign(vals[0][1], vals[1][0], vals[2][1]);
1251 ptarray[6].assign(vals[0][1], vals[1][1], vals[2][0]);
1252 ptarray[7].assign(vals[0][1], vals[1][1], vals[2][1]);
1254 if ( transform_matrix.isIdentity() )
1257 ptarray[0] *= transform_matrix;
1258 ptarray[1] *= transform_matrix;
1259 ptarray[2] *= transform_matrix;
1260 ptarray[3] *= transform_matrix;
1261 ptarray[4] *= transform_matrix;
1262 ptarray[5] *= transform_matrix;
1263 ptarray[6] *= transform_matrix;
1264 ptarray[7] *= transform_matrix;
int intersectRay(const UT_Vector3T< T > &org, const UT_Vector3T< T > &dir, T tmax=1E17F, T *distance=0, UT_Vector3T< T > *nml=0) const
GA_API const UT_StringHolder dist
GLenum GLuint GLenum GLsizei const GLchar * buf
bool operator==(const UT_BoundingBoxT< T > &bbox) const
int intersects(const UT_BoundingBoxT< T > &box) const
SYS_FORCE_INLINE bool hasVolume() const
GLenum GLuint GLsizei bufsize
UT_Vector3T< T > maxDistDelta(const UT_Vector3T< T > &p) const
Returns the maximum delta vector from the bounding box to the point.
T minDist2(const UT_Vector3T< T > &p) const
SYS_FORCE_INLINE void makeInvalid()
Axis-aligned bounding box (AABB).
UT_API void dump(const char *msg=0) const
Dump the bounding box to stderr. The msg is printed before the bounds.
void transform(const MATRIX &mat)
constexpr SYS_FORCE_INLINE T & y() noexcept
T approxLineDist2(const UT_Vector3T< T > &v0, const UT_Vector3T< T > &dir) const
GLdouble GLdouble GLdouble z
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_Vector3T< T > maxvec() const
GLboolean GLboolean GLboolean GLboolean a
UT_Vector3T< T > minDistDelta(const UT_Vector3T< T > &p) const
JSON reader class which handles parsing of JSON or bJSON files.
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void setBounds(T x_min, T y_min, T z_min, T x_max, T y_max, T z_max)
Class which writes ASCII or binary JSON streams.
GLfloat GLfloat GLfloat v2
void addToMin(const UT_Vector3T< T > &vec)
unsigned long long uint64
SYS_FORCE_INLINE bool isInvalidFast() const
T sizeAxis(int axis) const
void translate(const UT_Vector3T< T > &delta)
Adds the given translate to each component of the bounding box.
constexpr SYS_FORCE_INLINE T & x() noexcept
T segmentPointDist2(const UT_Vector3T< T > &pos, const UT_Vector3T< T > &pt1, const UT_Vector3T< T > &pt2)
void addToMax(const UT_Vector3T< T > &vec)
void initBounds(const fpreal64 *v)
Initialize zero-sized bounds at the location of the point given by v.
UT_BoundingBoxT & operator=(const UT_BoundingBoxT< S > &bbox)
int intersectRange(const UT_Vector3T< T > &org, const UT_Vector3T< T > &dir, T &min, T &max) const
SYS_FORCE_INLINE void expandBounds(T relative, T absolute)
T maxDist2(const UT_Vector3T< T > &p) const
Returns maximum distance between point and bounding box squared.
UT_API bool save(UT_JSONWriter &w) const
GA_API const UT_StringHolder scale
T & operator()(unsigned m, unsigned n)
void setSerialized(const fpreal64 floats[6])
bool operator!=(const UT_BoundingBoxT< T > &bbox) const
void getBBoxPoints(UT_Vector3T< T >(&ptarray)[8]) const
UT_Vector3T< T > center() const
UT_API void outTo(std::ostream &os) const
UT_BoundingBoxT(const UT_Vector3T< T > &lowerbound, const UT_Vector3T< T > &upperbound)
constexpr SYS_FORCE_INLINE T & z() noexcept
int intersectTube(const UT_Vector3T< T > &org, const UT_Vector3T< T > &dir, T radius, T tmin=-1E17f, T tmax=1E17f) const
UT_API bool triangleIntersects(const UT_Vector3T< T > &v0, const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2) const
void enlargeBounds(const fpreal32 *v)
Enlarge the existing bounds to encompass the point given in v.
UT_API size_t format(char *buf, size_t bufsize, const UT_BoundingBoxT< T > &v)
UT_API bool load(UT_JSONParser &p)
int computeIntersection(const UT_BoundingBoxT< T > &box)
T minDist2(const UT_BoundingBoxT< T > &box) const
Minimum disance between two bboxes squared.
T sizeMax() const
Return the size of the largest dimension.
GLboolean GLboolean GLboolean b
UT_Vector3T< T > minDistToMaxOverlap(const UT_BoundingBoxT< T > &box) const
void enlargeBounds(const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
GA_API const UT_StringHolder transform
uint64 hash() const
Compute UT_BoundingBox hash.
UT_Vector3T< T > size() const
const T * getSerialized() const
void setSerialized(const fpreal32 floats[6])
void assign(T xx=0.0f, T yy=0.0f, T zz=0.0f)
Set the values of the vector components.
UT_API void dumpGeo(FILE *fp) const
Dump the bounding box geometry to a draw file.
T getRadius() const
Returns the radius of a sphere that would fully enclose the box.
void enlargeBounds(const fpreal64 *v)
Enlarge the existing bounds to encompass the point given in v.
T operator()(unsigned m, unsigned n) const
SYS_FORCE_INLINE bool isValid() const
Check whether the bounding box contains at least one point.
UT_Vector3T< T > minvec() const
void splitRight(UT_BoundingBoxT< T > &box, int axis, T split)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void initMaxBounds()
Initialize the box to the largest size.
SYS_FORCE_INLINE void initBounds()
Class to store JSON objects as C++ objects.
void splitLeft(UT_BoundingBoxT< T > &box, int axis, T split)
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects(const Box< Vec3< T >> &b, const Line3< T > &r, Vec3< T > &ip) IMATH_NOEXCEPT
int isInside(const UT_Vector3T< T > &pt) const
UT_BoundingBoxT(T axmin, T aymin, T azmin, T axmax, T aymax, T azmax)
GLubyte GLubyte GLubyte GLubyte w
friend std::size_t hash_value(const this_type &t)
Compute UT_BoundingBox hash.
void OIIO_UTIL_API split(string_view str, std::vector< string_view > &result, string_view sep=string_view(), int maxsplit=-1)
void enlargeFloats(int bits=1, T min=1e-5)
SIM_API const UT_StringHolder distance
UT_BoundingBoxT(const UT_BoundingBoxT< S > &bbox)
constexpr SYS_FORCE_INLINE T & y() noexcept
void initBounds(const fpreal32 *v)
Initialize zero-sized bounds at the location of the point given by v.
static bool SYSisEqual(int64 a, int64 b, int64)
int isLineInside(const UT_Vector3T< T > &v0, const UT_Vector3T< T > &idir) const
T centerAxis(int axis) const
void clipBounds(const UT_BoundingBoxT< T > &box)
Find the intersections of two bounding boxes.
void scaleOffset(const UT_Vector3T< T > &scale, const UT_Vector3T< T > &offset)
Scale then offset a bounding box.
bool isEqual(const UT_BoundingBoxT< T > &bbox, T tol=SYS_FTOLERANCE_R) const
constexpr SYS_FORCE_INLINE T & x() noexcept
int getOutCode(const UT_Vector3T< T > &pt) const
Finds the out code of the point relative to this box: