diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-07-22 17:45:59 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-28 11:27:26 +0200 |
commit | e57189d3bbac058a3ddea567a6e487be65cdde5a (patch) | |
tree | f3019565789a11704b6644f3c7ab912fe9343efe /src/declarative/particles/qsgfollowemitter.cpp | |
parent | 0511dfc0b8851baf84df73780e770f1025261068 (diff) |
Add some more properties to JS particle type
Adds the current position, velocity and acceleration.
While we're at it, renaming the velocity vars from sx,sy to vx,vy
Change-Id: I87f582169c7873c45a6fd453052b25c4dc940f3e
Reviewed-on: http://codereview.qt.nokia.com/2021
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/particles/qsgfollowemitter.cpp')
-rw-r--r-- | src/declarative/particles/qsgfollowemitter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/particles/qsgfollowemitter.cpp b/src/declarative/particles/qsgfollowemitter.cpp index ff9f83df14..0d4e7f73fd 100644 --- a/src/declarative/particles/qsgfollowemitter.cpp +++ b/src/declarative/particles/qsgfollowemitter.cpp @@ -220,12 +220,12 @@ void QSGFollowEmitter::emitWindow(int timeStamp) qreal sizeOffset = d->size/2;//TODO: Current size? As an option //TODO: Set variations //Subtract offset, because PS expects this in emitter coordinates - QRectF boundsRect(d->x - offset.x() + d->sx * followT + d->ax * followT2 - m_emitterXVariation/2, - d->y - offset.y() + d->sy * followT + d->ay * followT2 - m_emitterYVariation/2, + QRectF boundsRect(d->x - offset.x() + d->vx * followT + d->ax * followT2 - m_emitterXVariation/2, + d->y - offset.y() + d->vy * followT + d->ay * followT2 - m_emitterYVariation/2, m_emitterXVariation, m_emitterYVariation); - // QRectF boundsRect(d->x + d->sx * followT + d->ax * followT2 + offset.x() - sizeOffset, - // d->y + d->sy * followT + d->ay * followT2 + offset.y() - sizeOffset, + // QRectF boundsRect(d->x + d->vx * followT + d->ax * followT2 + offset.x() - sizeOffset, + // d->y + d->vy * followT + d->ay * followT2 + offset.y() - sizeOffset, // sizeOffset*2, // sizeOffset*2); @@ -236,8 +236,8 @@ void QSGFollowEmitter::emitWindow(int timeStamp) // Particle speed const QPointF &speed = m_speed->sample(newPos); - datum->sx = speed.x(); - datum->sy = speed.y(); + datum->vx = speed.x(); + datum->vy = speed.y(); // Particle acceleration const QPointF &accel = m_acceleration->sample(newPos); |