9 float max_val = FLT_MAX;
13 for (
uint i = 0; i < uNumVertices; ++i) {
14 if (
pVertices[i].vWorldPosition.x <= test_val)
15 temp_val = test_val -
pVertices[i].vWorldPosition.x;
17 temp_val =
pVertices[i].vWorldPosition.x - test_val;
19 if (temp_val < max_val) {
29 float max_val = FLT_MAX;
33 for (
uint i = 0; i < uNumVertices; ++i) {
34 if (
pVertices[i].vWorldPosition.y <= test_val)
35 temp_val = test_val -
pVertices[i].vWorldPosition.y;
37 temp_val =
pVertices[i].vWorldPosition.y - test_val;
39 if (temp_val < max_val) {
49 float max_val = FLT_MAX;
53 for (
uint i = 0; i < uNumVertices; ++i) {
54 if (
pVertices[i].vWorldPosition.z <= test_val)
55 temp_val = test_val -
pVertices[i].vWorldPosition.z;
57 temp_val =
pVertices[i].vWorldPosition.z - test_val;
59 if (temp_val < max_val) {
76 memcpy(&pOutLimits[0],
78 pLimits[0].vWorldPosition.x)],
80 memcpy(&pOutLimits[2],
82 pLimits[2].vWorldPosition.x)],
84 memcpy(&pOutLimits[1],
86 pLimits[1].vWorldPosition.y)],
88 memcpy(&pOutLimits[3],
90 pLimits[3].vWorldPosition.y)],
93 memcpy(&pOutLimits[0],
95 pLimits[0].vWorldPosition.x)],
97 memcpy(&pOutLimits[2],
99 pLimits[2].vWorldPosition.x)],
101 memcpy(&pOutLimits[1],
103 pLimits[1].vWorldPosition.z)],
105 memcpy(&pOutLimits[3],
107 pLimits[3].vWorldPosition.z)],
110 memcpy(&pOutLimits[0],
112 pLimits[0].vWorldPosition.y)],
114 memcpy(&pOutLimits[2],
116 pLimits[2].vWorldPosition.y)],
118 memcpy(&pOutLimits[1],
120 pLimits[1].vWorldPosition.z)],
122 memcpy(&pOutLimits[3],
124 pLimits[3].vWorldPosition.z)],
165 float x_min = v46[0].x;
168 float x_max = v46[0].x;
171 float y_min = v46[0].y;
174 float y_max = v46[0].y;
178 if (v46[i].
x < x_min) {
180 x_min_idx = v46[i].c;
182 if (v46[i].
x > x_max) {
184 x_max_idx = v46[i].c;
187 if (v46[i].
y < y_min) {
189 y_min_idx = v46[i].c;
191 if (v46[i].
y > y_max) {
193 y_max_idx = v46[i].c;
198 v1.vWorldPosition.x =
200 v1.vWorldPosition.y =
202 v1.vWorldPosition.z =
207 v2.vWorldPosition.x =
209 v2.vWorldPosition.y =
211 v2.vWorldPosition.z =
216 v3.vWorldPosition.x =
218 v3.vWorldPosition.y =
220 v3.vWorldPosition.z =
236 unsigned int uNumVertices,
297 Error(
"Invalid polygon type (%u)", pFace->
uPolygonType);
333 var_8 = face_center_z -
353 if (a1.
x != 1.0f) a3 /= a1.
y;
622 face_center_y - a3 * a1.
y + var_8 * var_28;
624 face_center_z - a3 * a1.
z + var_8 * var_24;
629 face_center_y - a3 * a1.
y - var_8 * var_28;
631 face_center_z - a3 * a1.
z - var_8 * var_24;
636 face_center_y + a3 * a1.
y - var_8 * var_28;
638 face_center_z + a3 * a1.
z - var_8 * var_24;
643 face_center_y + a3 * a1.
y + var_8 * var_28;
645 face_center_z + a3 * a1.
z + var_8 * var_24;
650 a3 = face_center_x + a3 * a1.
x;
660 if (fabs(_dp) < 1e-6
f) {
669 if (
engine->config->debug_portal_outlines) {
715 if (
engine->config->debug_portal_outlines)
740 return _49C720(pOutBounding, a5);
756 return _49C720(pOutBounding, pPortalDataFrustum) != 0;
770 if (
FindFaceNormal(&pFaceBounding[0], &pFaceBounding[1], &pRayStart,
771 &pPortalDataFrustum[0]) &&
773 &pPortalDataFrustum[1]) &&
775 &pPortalDataFrustum[2]) &&
777 &pPortalDataFrustum[3]))
800 float sqr_mag = pRay2.
x * pRay2.
x + pRay2.
y * pRay2.
y + pRay2.
z * pRay2.
z;
801 if (fabsf(sqr_mag) > 1e-6
f) {
802 float inv_mag = 1.0f / sqrtf(sqr_mag);
808 pPortalDataFrustum->
x = pRay2.
x;
809 pPortalDataFrustum->
y = pRay2.
y;
810 pPortalDataFrustum->
z = pRay2.
z;
811 pPortalDataFrustum->
dot = pRayStart->
z * pRay2.
z +
812 pRayStart->
y * pRay2.
y +
813 pRayStart->
x * pRay2.
x;
833 float sqr_mag =
v2.x *
v2.x +
v2.y *
v2.y +
v2.z *
v2.z;
834 if (fabsf(sqr_mag) > 1e-6
f) {
836 float inv_mag = 1.0f / sqrtf(sqr_mag);