Fix rotated box culling bug
This commit is contained in:
parent
e32c299941
commit
d6910a4e01
|
@ -71,12 +71,15 @@ void staticRenderPopulateRooms(struct FrustrumCullingInformation* cullingInfo, M
|
|||
continue;
|
||||
}
|
||||
|
||||
struct Vector3 center;
|
||||
vector3Scale(&rotatedBox.origin, ¢er, 1.0f / SCENE_SCALE);
|
||||
|
||||
renderSceneAdd(
|
||||
renderScene,
|
||||
staticElement->displayList,
|
||||
&staticMatrices[staticElement->transformIndex],
|
||||
staticElement->materialIndex,
|
||||
&rotatedBox.origin,
|
||||
¢er,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ int isRotatedBoxOutsideFrustrum(struct FrustrumCullingInformation* frustrum, str
|
|||
struct Vector3* normal = &frustrum->clippingPlanes[i].normal;
|
||||
|
||||
for (int axis = 0; axis < 3; ++axis) {
|
||||
if (VECTOR3_AS_ARRAY(normal)[axis] > 0.0f) {
|
||||
if (vector3Dot(&rotatedBox->sides[axis], normal) > 0.0f) {
|
||||
vector3Add(&closestPoint, &rotatedBox->sides[axis], &closestPoint);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue