summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/water.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-10-20 23:06:56 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-10-20 23:06:56 +0200
commit688315ab76145a32d0aebf826fbbb7fc9ce24443 (patch)
treea7d4e37fae1517a2b2eaf09a78219583caf97aa3 /src/graphics/engine/water.cpp
parent728e7e405dd56afb4da03fd63df378d5f984ed73 (diff)
downloadcolobot-688315ab76145a32d0aebf826fbbb7fc9ce24443.tar.gz
colobot-688315ab76145a32d0aebf826fbbb7fc9ce24443.tar.bz2
colobot-688315ab76145a32d0aebf826fbbb7fc9ce24443.zip
ComputeSphereVisibility and fixes in CEngine TODOs
- view frustum culling with ComputeSphereVisibility - game should run faster now - resolved/removed most TODOs from CEngine - fixed OpenGL tests
Diffstat (limited to 'src/graphics/engine/water.cpp')
-rw-r--r--src/graphics/engine/water.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/graphics/engine/water.cpp b/src/graphics/engine/water.cpp
index 18811eb..6c822b3 100644
--- a/src/graphics/engine/water.cpp
+++ b/src/graphics/engine/water.cpp
@@ -386,9 +386,11 @@ void CWater::DrawSurf()
Math::Vector p = pos;
p.x += size*(m_lines[i].len-1);
float radius = sqrtf(powf(size, 2.0f)+powf(size*m_lines[i].len, 2.0f));
- if ( Math::Distance(p, eye) > deep+radius ) continue;
+ if (Math::Distance(p, eye) > deep + radius)
+ continue;
- // TODO: ComputeSphereVisibility
+ if (device->ComputeSphereVisibility(p, radius) != Gfx::FRUSTUM_PLANE_ALL)
+ continue;
int vertexIndex = 0;