Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 167 vs 168 for /trunk/Source Code/Scenes/CubeScene/CubeScene.cpp

Diff revisions: vs.
  @@ -55,17 +55,16 @@
55 55 }
56 56
57 57 void CubeScene::processInput(){
58 - if(state()->_angleLR) renderState()->getCamera()->RotateX(state()->_angleLR);
59 - if(state()->_angleUD) renderState()->getCamera()->RotateY(state()->_angleUD);
60 - if(state()->_moveFB) renderState()->getCamera()->MoveForward(state()->_moveFB /5);
61 - if(state()->_moveLR) renderState()->getCamera()->MoveStrafe(state()->_moveLR /5);
58 + if(state()._angleLR) renderState().getCamera().rotateYaw(state()._angleLR);
59 + if(state()._angleUD) renderState().getCamera().rotatePitch(state()._angleUD);
60 + if(state()._moveFB) renderState().getCamera().moveForward(state()._moveFB);
61 + if(state()._moveLR) renderState().getCamera().moveStrafe(state()._moveLR);
62 62 }
63 63
64 - bool CubeScene::load(const std::string& name){
64 + bool CubeScene::load(const std::string& name, CameraManager* const cameraMgr){
65 65 GFX_DEVICE.setRenderer(New DeferredShadingRenderer());
66 - ///Load scene resources
67 - SCENE_LOAD(name,true,true);
68 - return loadState;
66 + //Load scene resources
67 + return SCENE_LOAD(name,cameraMgr,true,true);
69 68 }
70 69
71 70 bool CubeScene::loadResources(bool continueOnErrors){
  @@ -94,25 +93,13 @@
94 93 void CubeScene::onKeyDown(const OIS::KeyEvent& key)
95 94 {
96 95 Scene::onKeyDown(key);
97 - switch(key.key)
98 - {
99 - case OIS::KC_W:
100 - state()->_moveFB = 0.75f;
101 - break;
102 - case OIS::KC_A:
103 - state()->_moveLR = 0.75f;
104 - break;
105 - case OIS::KC_S:
106 - state()->_moveFB = -0.75f;
107 - break;
108 - case OIS::KC_D:
109 - state()->_moveLR = -0.75f;
110 - break;
111 - case OIS::KC_T:
112 - _GFX.getRenderer()->toggleDebugView();
113 - break;
114 - default:
115 - break;
96 + switch(key.key) {
97 + default: break;
98 + case OIS::KC_W: state()._moveFB = 1; break;
99 + case OIS::KC_A: state()._moveLR = -1; break;
100 + case OIS::KC_S: state()._moveFB = -1; break;
101 + case OIS::KC_D: state()._moveLR = 1; break;
102 + case OIS::KC_T: _GFX.getRenderer()->toggleDebugView(); break;
116 103 }
117 104 }
118 105
  @@ -122,14 +109,9 @@
122 109 switch(key.key)
123 110 {
124 111 case OIS::KC_W:
125 - case OIS::KC_S:
126 - state()->_moveFB = 0;
127 - break;
112 + case OIS::KC_S: state()._moveFB = 0; break;
128 113 case OIS::KC_A:
129 - case OIS::KC_D:
130 - state()->_moveLR = 0;
131 - break;
132 - default:
133 - break;
114 + case OIS::KC_D: state()._moveLR = 0; break;
115 + default: break;
134 116 }
135 117 }