Пример #1
0
void EntitySimulation::updateEntities() {
    quint64 now = usecTimestampNow();

    // these methods may accumulate entries in _entitiesToBeDeleted
    expireMortalEntities(now);
    callUpdateOnEntitiesThatNeedIt(now);
    moveSimpleKinematics(now);
    updateEntitiesInternal(now);
    sortEntitiesThatMoved();
}
Пример #2
0
void EntitySimulation::updateEntities() {
    QMutexLocker lock(&_mutex);
    quint64 now = usecTimestampNow();

    // these methods may accumulate entries in _entitiesToBeDeleted
    expireMortalEntities(now);
    callUpdateOnEntitiesThatNeedIt(now);
    moveSimpleKinematics(now);
    updateEntitiesInternal(now);
    PerformanceTimer perfTimer("sortingEntities");
    sortEntitiesThatMoved();
}
Пример #3
0
void EntitySimulation::updateEntities(QSet<EntityItem*>& entitiesToDelete) {
    quint64 now = usecTimestampNow();

    // these methods may accumulate entries in _entitiesToBeDeleted
    expireMortalEntities(now);
    callUpdateOnEntitiesThatNeedIt(now);
    updateEntitiesInternal(now);
    sortEntitiesThatMoved();

    // at this point we harvest _entitiesToBeDeleted
    entitiesToDelete.unite(_entitiesToDelete);
    _entitiesToDelete.clear();
}