3 #ifdef WITH_CXX_GUARDEDALLOC
22 {{{0, 0}, {0, 1}, {1, 1}}, {{0, 2}, {0, 3}, {1, 3}}, {{2, 2}, {2, 3}, {3, 3}}},
24 {{{0, 4}, {0, 5}, {1, 5}}, {{0, 6}, {0, 7}, {1, 7}}, {{2, 6}, {2, 7}, {3, 7}}},
26 {{{4, 4}, {4, 5}, {5, 5}}, {{4, 6}, {4, 7}, {5, 7}}, {{6, 6}, {6, 7}, {7, 7}}}};
57 res[0] =
a[1] *
b[2] -
a[2] *
b[1];
58 res[1] =
a[2] *
b[0] -
a[0] *
b[2];
59 res[2] =
a[0] *
b[1] -
a[1] *
b[0];
62 static void crossProduct(
double res[3],
const double a[3],
const double b[3])
64 res[0] =
a[1] *
b[2] -
a[2] *
b[1];
65 res[1] =
a[2] *
b[0] -
a[0] *
b[2];
66 res[2] =
a[0] *
b[1] -
a[1] *
b[0];
74 return a[0] *
b[0] +
a[1] *
b[1] +
a[2] *
b[2];
79 double mag =
a[0] *
a[0] +
a[1] *
a[1] +
a[2] *
a[2];
113 for (
int i = 0; i < 3; i++) {
114 for (
int j = 0; j < 3; j++)
115 tri_edges[i][j] = tri[(i + 1) % 3][j] - tri[i][j];
123 for (
int i = 0; i < 3; i++) {
124 for (
int j = 0; j < 3; j++) {
147 double dedge1[] = {(
double)tri[1][0] - (
double)tri[0][0],
148 (
double)tri[1][1] - (
double)tri[0][1],
149 (
double)tri[1][2] - (
double)tri[0][2]};
150 double dedge2[] = {(
double)tri[2][0] - (
double)tri[1][0],
151 (
double)tri[2][1] - (
double)tri[1][1],
152 (
double)tri[2][2] - (
double)tri[1][2]};
157 for (i = 0; i < 3; i++) {
158 for (
int j = 0; j < 3; j++) {
161 cubeedge[i][i] =
cube[1][i] -
cube[0][i];
165 for (
int axis = 0; axis <
NUM_AXES; axis++) {
172 for (i = 0; i < 3; i++)
178 for (i = 1; i < 8; i++) {
193 for (
int axis = 0; axis <
NUM_AXES; axis++) {
201 for (i = 1; i < 3; i++) {
221 for (
int i = 0; i <
NUM_AXES; i++) {
224 for (
int j = 0; j < 3; j++)
235 int bmask[3][2] = {{0, 0}, {0, 0}, {0, 0}};
236 unsigned char boxmask = 0;
239 for (i = 0; i < 3; i++) {
246 if (mid < inherit->tri_proj[i][1]) {
253 for (i = 0; i < 2; i++) {
254 for (j = 0; j < 2; j++) {
255 for (k = 0; k < 2; k++) {
256 boxmask |= ((bmask[0][i] & bmask[1][j] & bmask[2][k]) << ct);
271 for (
int i = 0; i <
NUM_AXES; i++) {
282 for (
int i = 0; i <
NUM_AXES; i++) {
297 if (proj0 >
inherit->
tri_proj[i][1] || proj1 < inherit->tri_proj[i][0]) {
307 for (
int i = 0; i <
NUM_AXES; i++) {
313 if (proj0 >
inherit->
tri_proj[i][1] || proj1 < inherit->tri_proj[i][0]) {
318 if (proj1 >
inherit->
tri_proj[i][1] || proj0 < inherit->tri_proj[i][0]) {
341 alpha = (
double)((proj2 - proj0)) / (
double)d;
343 if (alpha < 0 || alpha > 1)
typedef double(DMatrix)[4][4]
Read Guarded memory(de)allocation.
const int centmap[3][3][3][2]
static int64_t dotProduct(const int64_t a[3], const int64_t b[3])
static void create_projection_axes(int64_t axes[NUM_AXES][3], const int64_t tri[3][3])
static void crossProduct(int64_t res[3], const int64_t a[3], const int64_t b[3])
static void normalize(double a[3])
int isIntersecting() const
int isIntersectingPrimary(int edgeInd) const
CubeProjection cubeProj[NUM_AXES]
Projections of the cube vertices.
unsigned char getBoxMask()
TriangleProjection * inherit
Inheritable portion.
float getIntersectionPrimary(int edgeInd) const
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
int64_t tri_proj[NUM_AXES][2]
Projections of triangle (min and max)
double norm[3]
Normal of the triangle.
int index
Index of polygon.