Commit 547bc815 authored by Dirk Wilden's avatar Dirk Wilden

changed storage of the matrix scripting type

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6459 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 71b49769
......@@ -57,7 +57,7 @@ QString prototypeMatrix4x4::toString() const {
for ( uint i = 0 ; i < 4 ; ++i ) {
for ( uint j = 0 ; j < 4 ; ++j ) {
result = result + thisObject().property(QString::number(j) + QString::number(i)).toString() + " ";
result = result + thisObject().property(QString::number(i) + QString::number(j)).toString() + " ";
}
//Dont add a newline at the end of the Matrix
......
......@@ -52,7 +52,7 @@ QScriptValue toScriptValueMatrix4x4(QScriptEngine *engine, const Matrix4x4 &s)
QScriptValue obj = engine->newObject();
for ( uint i = 0 ; i < 4 ; ++i )
for ( uint j = 0 ; j < 4 ; ++j )
obj.setProperty(QString::number(j) + QString::number(i),QScriptValue(engine, s(j,i)) );
obj.setProperty(QString::number(i) + QString::number(j),QScriptValue(engine, s(i,j)) );
return obj;
}
......@@ -60,7 +60,7 @@ void fromScriptValueMatrix4x4(const QScriptValue &obj, Matrix4x4 &s)
{
for ( uint i = 0 ; i < 4 ; ++i )
for ( uint j = 0 ; j < 4 ; ++j )
s(j,i) = obj.property(QString::number(j) + QString::number(i)).toNumber();
s(i,j) = obj.property(QString::number(i) + QString::number(j)).toNumber();
}
QScriptValue createMatrix4x4(QScriptContext *context, QScriptEngine *engine)
......@@ -74,7 +74,7 @@ QScriptValue createMatrix4x4(QScriptContext *context, QScriptEngine *engine)
if (context->argumentCount() == 16) {
for ( uint i = 0 ; i < 4 ; ++i )
for ( uint j = 0 ; j < 4 ; ++j )
s(j,i) = context->argument(i*4+j).toNumber();
s(i,j) = context->argument(i*4+j).toNumber();
} else {
for ( uint i = 0 ; i < 4 ; ++i )
for ( uint j = 0 ; j < 4 ; ++j )
......@@ -92,7 +92,7 @@ QScriptValue Matrix4x4ToString(QScriptContext *context, QScriptEngine *engine)
for ( uint j = 0 ; j < 4 ; ++j ) {
if ( i == 3 && j == 3 )
break;
result = result + context->thisObject().property(QString::number(j) + QString::number(i)).toString() + " , ";
result = result + context->thisObject().property(QString::number(i) + QString::number(j)).toString() + " , ";
}
result = result + context->thisObject().property("33").toString() + " ) ";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment