MCPcopy Create free account
hub / github.com/MyGUI/mygui / updateCamera

Method updateCamera

UnitTests/UnitTest_Layers/DemoKeeper.cpp:201–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199 }
200
201 void DemoKeeper::updateCamera(int _x, int _y)
202 {
203#ifdef MYGUI_OGRE_PLATFORM
204 static float gAngleH = 0;
205 static float gAngleV = -30;
206
207 gAngleH += (float)_x * -0.1f;
208
209 Ogre::Quaternion quatH(Ogre::Radian(Ogre::Degree(gAngleH)), Ogre::Vector3::UNIT_Y);
210 Ogre::Quaternion quatV(Ogre::Radian(Ogre::Degree(gAngleV)), Ogre::Vector3::UNIT_X);
211 quatH = quatH * quatV;
212
213 Ogre::Vector3 vec(0, 0, 70);
214 vec = quatH * vec;
215
216 vec.y += 30;
217
218 getCameraNode()->setPosition(vec);
219 getCameraNode()->setOrientation(quatH);
220#endif
221 }
222
223} // namespace demo
224

Callers

nothing calls this directly

Calls 1

setPositionMethod · 0.45

Tested by

no test coverage detected