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/Scenes/CubeScene/CubeScene.cpp

Diff revisions: vs.
  @@ -1,8 +1,9 @@
1 1 #include "Headers/CubeScene.h"
2 - #include "Managers/Headers/CameraManager.h"
2 +
3 + #include "Geometry/Shapes/Headers/Predefined/Quad3D.h"
4 + #include "Rendering/Camera/Headers/Camera.h"
3 5 #include "Core/Headers/Application.h"
4 6 #include "GUI/Headers/GUI.h"
5 - #include "Geometry/Shapes/Headers/Predefined/Quad3D.h"
6 7
7 8 void CubeScene::render(){
8 9
  @@ -22,7 +23,7 @@
22 23 _deferredShader->UniformTexture("tImage2",2);
23 24 _deferredShader->UniformTexture("lightTexture",3);
24 25 _deferredShader->Uniform("lightCount",(I32)LightManager::getInstance().getLights().size());
25 - _deferredShader->Uniform("cameraPosition",CameraManager::getInstance().getActiveCamera()->getEye());
26 + _deferredShader->Uniform("cameraPosition",_camera->getEye());
26 27
27 28 _GFX.renderModel(_renderQuad);
28 29
  @@ -142,17 +143,10 @@
142 143 void CubeScene::processInput(){
143 144 Scene::processInput();
144 145
145 - Camera* cam = CameraManager::getInstance().getActiveCamera();
146 -
147 - moveFB = Application::getInstance().moveFB;
148 - moveLR = Application::getInstance().moveLR;
149 - angleLR = Application::getInstance().angleLR;
150 - angleUD = Application::getInstance().angleUD;
151 -
152 - if(angleLR) cam->RotateX(angleLR * Framerate::getInstance().getSpeedfactor());
153 - if(angleUD) cam->RotateY(angleUD * Framerate::getInstance().getSpeedfactor());
154 - if(moveFB) cam->PlayerMoveForward(moveFB * (Framerate::getInstance().getSpeedfactor()/5));
155 - if(moveLR) cam->PlayerMoveStrafe(moveLR * (Framerate::getInstance().getSpeedfactor()/5));
146 + if(_angleLR) _camera->RotateX(_angleLR * Framerate::getInstance().getSpeedfactor());
147 + if(_angleUD) _camera->RotateY(_angleUD * Framerate::getInstance().getSpeedfactor());
148 + if(_moveFB) _camera->MoveForward(_moveFB * (Framerate::getInstance().getSpeedfactor()/5));
149 + if(_moveLR) _camera->MoveStrafe(_moveLR * (Framerate::getInstance().getSpeedfactor()/5));
156 150
157 151 }
158 152
  @@ -169,8 +163,6 @@
169 163
170 164 bool CubeScene::loadResources(bool continueOnErrors){
171 165
172 - angleLR=0.0f,angleUD=0.0f,moveFB=0.0f,moveLR=0.0f;
173 -
174 166 _deferredBuffer = _GFX.newFBO();
175 167 _lightTexture = _GFX.newPBO();
176 168 //30 lights? >:)
  @@ -265,16 +257,16 @@
265 257 switch(key.key)
266 258 {
267 259 case OIS::KC_W:
268 - Application::getInstance().moveFB = 0.75f;
260 + _moveFB = 0.75f;
269 261 break;
270 262 case OIS::KC_A:
271 - Application::getInstance().moveLR = 0.75f;
263 + _moveLR = 0.75f;
272 264 break;
273 265 case OIS::KC_S:
274 - Application::getInstance().moveFB = -0.75f;
266 + _moveFB = -0.75f;
275 267 break;
276 268 case OIS::KC_D:
277 - Application::getInstance().moveLR = -0.75f;
269 + _moveLR = -0.75f;
278 270 break;
279 271 case OIS::KC_T:{
280 272 F32 width = Application::getInstance().getWindowDimensions().width;
  @@ -304,11 +296,11 @@
304 296 {
305 297 case OIS::KC_W:
306 298 case OIS::KC_S:
307 - Application::getInstance().moveFB = 0;
299 + _moveFB = 0;
308 300 break;
309 301 case OIS::KC_A:
310 302 case OIS::KC_D:
311 - Application::getInstance().moveLR = 0;
303 + _moveLR = 0;
312 304 break;
313 305 default:
314 306 break;