if(m_node == 0)
return;
}
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal time = timeStamp / 1000.;
m_material->timestamp = time;
if(m_node == 0)
return;
}
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal time = timeStamp / 1000.;
m_material->timestamp = time;
void ModelParticle::prepareNextFrame()
{
- uint timeStamp = m_system->systemSync(this);
+ qint64 timeStamp = m_system->systemSync(this);
qreal curT = timeStamp/1000.0;
qreal dt = curT - m_lastT;
m_lastT = curT;
#define PARTICLESYSTEM_H
#include <QSGItem>
-#include <QTime>
+#include <QElapsedTimer>
#include <QVector>
#include <QHash>
#include <QPointer>
public://but only really for related class usage. Perhaps we should all be friends?
void emitParticle(ParticleData* p);
ParticleData* newDatum(int groupId);
- uint systemSync(ParticleType* p);
- QTime m_timestamp;
+ qint64 systemSync(ParticleType* p);
+ QElapsedTimer m_timestamp;
QVector<ParticleData*> m_data;
QSet<ParticleData*> m_needsReset;
QHash<QString, int> m_groupIds;
QHash<int, GroupData*> m_groupData;//id, size, start
- uint m_timeInt;
+ qint64 m_timeInt;
bool m_initialized;
void registerParticleType(ParticleType* p);
QList<QPointer<ParticleAffector> > m_affectors;
QList<QPointer<ParticleType> > m_particles;
QList<QPointer<ParticleType> > m_syncList;
- int m_startTime;
+ qint64 m_startTime;
int m_nextGroupId;
bool m_overwrite;
};