diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-07-20 13:46:52 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-28 11:27:26 +0200 |
commit | 0511dfc0b8851baf84df73780e770f1025261068 (patch) | |
tree | 65a9acb210ff5197c2c3f11edac594a124bfc206 /src/declarative/particles/qsgparticlesystem.cpp | |
parent | 8fda8d16df9744b69a97020e3aae1ad40ff1f538 (diff) |
Initial CustomEmitter and CustomAffector implementation
Currently basic and can't access all properties.
Change-Id: I66efc235112cffcf1a3ca5cc69099a5d09ec7691
Reviewed-on: http://codereview.qt.nokia.com/1950
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/particles/qsgparticlesystem.cpp')
-rw-r--r-- | src/declarative/particles/qsgparticlesystem.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp index f25172dbda..6f4a6171c2 100644 --- a/src/declarative/particles/qsgparticlesystem.cpp +++ b/src/declarative/particles/qsgparticlesystem.cpp @@ -46,8 +46,10 @@ #include "qsgparticlepainter_p.h" #include "qsgspriteengine_p.h" #include "qsgsprite_p.h" +#include "qsgv8particledata_p.h" #include "qsgfollowemitter_p.h"//###For auto-follow on states, perhaps should be in emitter? +#include <private/qdeclarativeengine_p.h> #include <cmath> #include <QDebug> @@ -114,7 +116,7 @@ void QSGParticleDataHeap::grow() //###Consider automatic growth vs resize() call m_data.resize(1 << ++m_size); } -void QSGParticleDataHeap::insert(QSGParticleData* data) +void QSGParticleDataHeap::insert(QSGParticleData* data)//TODO: Optimize 0 lifespan (or already dead) case { int time = roundedTime(data->t + data->lifeSpan); if (m_lookups.contains(time)){ @@ -296,6 +298,7 @@ QSGParticleData::QSGParticleData(QSGParticleSystem* sys) , system(sys) , index(0) , systemIndex(-1) + , v8Datum(0) { x = 0; y = 0; @@ -359,6 +362,12 @@ void QSGParticleData::clone(const QSGParticleData& other) modelIndex = other.modelIndex; } +QDeclarativeV8Handle QSGParticleData::v8Value() +{ + if (!v8Datum) + v8Datum = new QSGV8ParticleData(QDeclarativeEnginePrivate::getV8Engine(qmlEngine(system)), this); + return v8Datum->v8Value(); +} //sets the x accleration without affecting the instantaneous x velocity or position void QSGParticleData::setInstantaneousAX(qreal ax) { |