aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel Molina <ariel@edis.mx>2015-12-05 18:58:19 -0600
committerAriel Molina R <ariel@edis.mx>2015-12-07 20:55:45 +0000
commitf0c0e00c1bfbd28b05f781070b5a0b6a73caf32d (patch)
treeac2eb6c64a8ad983bd1a185d599b4af218d5a5e9
parent945d1fd3c94febc37fe56af54f2c2facc623c44f (diff)
Correct heightmap values for Turbulence
Turbulence was only taking into account the red component, and it was wrongly using the image sideways. Change-Id: I7f50e44a198993b9ea2ac0a66c1952bf9c7e92fb Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
-rw-r--r--src/particles/qquickturbulence.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/particles/qquickturbulence.cpp b/src/particles/qquickturbulence.cpp
index 11bae1107b..75f8cea8db 100644
--- a/src/particles/qquickturbulence.cpp
+++ b/src/particles/qquickturbulence.cpp
@@ -133,11 +133,11 @@ void QQuickTurbulenceAffector::initializeGrid()
for (int i=0; i<m_gridSize; i++)
for (int j=0; j<m_gridSize; j++)
- m_field[i][j] = qRed(image.pixel(QPoint(i,j)));//Red as proxy for Value
+ m_field[i][j] = qGray(image.pixel(QPoint(i,j)));
for (int i=0; i<m_gridSize; i++){
for (int j=0; j<m_gridSize; j++){
- m_vectorField[i][j].setX(boundsRespectingField(i,j) - boundsRespectingField(i,j-1));
- m_vectorField[i][j].setY(boundsRespectingField(i-1,j) - boundsRespectingField(i,j));
+ m_vectorField[i][j].setX(boundsRespectingField(i-1,j) - boundsRespectingField(i,j));
+ m_vectorField[i][j].setY(boundsRespectingField(i,j) - boundsRespectingField(i,j-1));
}
}
}