Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 116 vs 117 for /trunk/Source Code/Environment/Water/Water.cpp

Diff revisions: vs.
  @@ -1,7 +1,6 @@
1 1 #include "Headers/Water.h"
2 2
3 3 #include "Managers/Headers/SceneManager.h"
4 - #include "Managers/Headers/CameraManager.h"
5 4 #include "Core/Headers/Application.h"
6 5 #include "Core/Headers/ParamHandler.h"
7 6 #include "Hardware/Video/RenderStateBlock.h"
  @@ -20,11 +19,10 @@
20 19 _shader->unbind();
21 20
22 21 _farPlane = 2.0f * ParamHandler::getInstance().getParam<F32>("zFar");
23 - const vec3<F32>& eyePos = CameraManager::getInstance().getActiveCamera()->getEye();
24 - _plane->setCorner(Quad3D::TOP_LEFT, vec3<F32>(eyePos.x - _farPlane, 0, eyePos.z - _farPlane));
25 - _plane->setCorner(Quad3D::TOP_RIGHT, vec3<F32>(eyePos.x + _farPlane, 0, eyePos.z - _farPlane));
26 - _plane->setCorner(Quad3D::BOTTOM_LEFT, vec3<F32>(eyePos.x - _farPlane, 0, eyePos.z + _farPlane));
27 - _plane->setCorner(Quad3D::BOTTOM_RIGHT, vec3<F32>(eyePos.x + _farPlane, 0, eyePos.z + _farPlane));
22 + _plane->setCorner(Quad3D::TOP_LEFT, vec3<F32>( -_farPlane, 0, -_farPlane));
23 + _plane->setCorner(Quad3D::TOP_RIGHT, vec3<F32>( _farPlane, 0, -_farPlane));
24 + _plane->setCorner(Quad3D::BOTTOM_LEFT, vec3<F32>(-_farPlane, 0, _farPlane));
25 + _plane->setCorner(Quad3D::BOTTOM_RIGHT, vec3<F32>(_farPlane, 0, _farPlane));
28 26 _plane->setDrawState(false);
29 27
30 28
  @@ -75,9 +73,8 @@
75 73 }
76 74
77 75 void WaterPlane::onDraw(){
78 - const vec3<F32>& eyePos = CameraManager::getInstance().getActiveCamera()->getEye();
79 76 BoundingBox& bb = _node->getBoundingBox();
80 - _planeTransform->setPosition(vec3<F32>(eyePos.x,bb.getMax().y,eyePos.z));
77 + _planeTransform->setPosition(vec3<F32>(_eyePos.x,bb.getMax().y,_eyePos.z));
81 78 }
82 79
83 80 void WaterPlane::prepareMaterial(SceneGraphNode const* const sgn){
  @@ -139,9 +136,4 @@
139 136 if(!underwater){
140 137 GFX_DEVICE.setRenderStage(prev);
141 138 }
142 - }
143 -
144 - bool WaterPlane::isCameraUnderWater(){
145 - Camera* cam = CameraManager::getInstance().getActiveCamera();
146 - return (cam->getEye().y < _waterLevel);
147 139 }