Selaa lähdekoodia

- Fix to Terrain::getVisibleTriangleCount.
- Fix to script camera in gameplay-tests.
- Other minor tweaks to Terrain test.

sgrenier 13 vuotta sitten
vanhempi
sitoutus
41bbc72bcd
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      gameplay/src/TerrainPatch.cpp

+ 5 - 2
gameplay/src/TerrainPatch.cpp

@@ -561,8 +561,11 @@ unsigned int TerrainPatch::getVisibleTriangleCount() const
 
 
     // Does the current camera intersect this patch at all?
     // Does the current camera intersect this patch at all?
     BoundingBox bounds = getBoundingBox(true);
     BoundingBox bounds = getBoundingBox(true);
-    if (!camera->getFrustum().intersects(bounds))
-        return 0;
+    if (_terrain->_flags & Terrain::FRUSTUM_CULLING)
+    {
+        if (!camera->getFrustum().intersects(bounds))
+            return 0;
+    }
 
 
     // Return the triangle count of the LOD level depending on the camera
     // Return the triangle count of the LOD level depending on the camera
     size_t lod = computeLOD(camera, bounds);
     size_t lod = computeLOD(camera, bounds);