From: <es...@us...> - 2010-07-18 08:48:39
|
Revision: 2948 http://ogreaddons.svn.sourceforge.net/ogreaddons/?rev=2948&view=rev Author: esuvs Date: 2010-07-18 08:48:33 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Bit of cleaning up. Modified Paths: -------------- trunk/QtOgreFramework/EngineTest/include/Light.h trunk/QtOgreFramework/EngineTest/media/scripts/update.js trunk/QtOgreFramework/EngineTest/source/EngineTestGameLogic.cpp trunk/QtOgreFramework/EngineTest/source/Light.cpp Modified: trunk/QtOgreFramework/EngineTest/include/Light.h =================================================================== --- trunk/QtOgreFramework/EngineTest/include/Light.h 2010-07-18 07:40:13 UTC (rev 2947) +++ trunk/QtOgreFramework/EngineTest/include/Light.h 2010-07-18 08:48:33 UTC (rev 2948) @@ -17,10 +17,10 @@ Q_PROPERTY(QColor colour READ getColour WRITE setColour) public slots: - QVector3D getPosition(void) const; + const QVector3D& getPosition(void) const; void setPosition(const QVector3D& pos); - QColor getColour(void) const; + const QColor& getColour(void) const; void setColour(const QColor& col); private: QVector3D m_vecPosition; Modified: trunk/QtOgreFramework/EngineTest/media/scripts/update.js =================================================================== --- trunk/QtOgreFramework/EngineTest/media/scripts/update.js 2010-07-18 07:40:13 UTC (rev 2947) +++ trunk/QtOgreFramework/EngineTest/media/scripts/update.js 2010-07-18 08:48:33 UTC (rev 2948) @@ -53,12 +53,12 @@ if(mouse.isPressed(Qt.RightButton)) { mouseDelta = mouse.computeDelta(); - camera.yaw(new OgreRadian(-mouseDelta.x * 0.01)); + camera.yaw(new OgreRadian(-mouseDelta.x() * 0.01)); } if(mouse.isPressed(Qt.RightButton)) { mouseDelta = mouse.computeDelta(); - camera.pitch(new OgreRadian(-mouseDelta.y * 0.01)); + camera.pitch(new OgreRadian(-mouseDelta.y() * 0.01)); } wheelDelta = mouse.getWheelDelta(); //print('wheelDelta = ', wheelDelta); Modified: trunk/QtOgreFramework/EngineTest/source/EngineTestGameLogic.cpp =================================================================== --- trunk/QtOgreFramework/EngineTest/source/EngineTestGameLogic.cpp 2010-07-18 07:40:13 UTC (rev 2947) +++ trunk/QtOgreFramework/EngineTest/source/EngineTestGameLogic.cpp 2010-07-18 08:48:33 UTC (rev 2948) @@ -21,20 +21,6 @@ using namespace QtOgre; -QScriptValue toScriptValueQPoint(QScriptEngine *engine, const QPoint &s) -{ - QScriptValue obj = engine->newObject(); - obj.setProperty("x", s.x()); - obj.setProperty("y", s.y()); - return obj; -} - -void fromScriptValueQPoint(const QScriptValue &obj, QPoint &s) -{ - s.setX(obj.property("x").toInt32()); - s.setY(obj.property("y").toInt32()); -} - EngineTestGameLogic::EngineTestGameLogic(void) :GameLogic() ,m_bRunScript(true) @@ -343,8 +329,6 @@ QScriptValue objectStoreScriptValue = scriptEngine->newQObject(&mObjectStore); scriptEngine->globalObject().setProperty("objectStore", objectStoreScriptValue); - qScriptRegisterMetaType(scriptEngine, toScriptValueQPoint, fromScriptValueQPoint); - OgreVector3Class *vecClass = new OgreVector3Class(scriptEngine); scriptEngine->globalObject().setProperty("OgreVector3", vecClass->constructor()); Modified: trunk/QtOgreFramework/EngineTest/source/Light.cpp =================================================================== --- trunk/QtOgreFramework/EngineTest/source/Light.cpp 2010-07-18 07:40:13 UTC (rev 2947) +++ trunk/QtOgreFramework/EngineTest/source/Light.cpp 2010-07-18 08:48:33 UTC (rev 2948) @@ -5,7 +5,7 @@ { } -QVector3D Light::getPosition(void) const +const QVector3D& Light::getPosition(void) const { return m_vecPosition; } @@ -15,7 +15,7 @@ m_vecPosition = pos; } -QColor Light::getColour(void) const +const QColor& Light::getColour(void) const { return m_colColour; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |