14 #ifndef hifi_SafeLanding_h
15 #define hifi_SafeLanding_h
17 #include <QtCore/QObject>
18 #include <QtCore/QSharedPointer>
22 #include "EntityItem.h"
23 #include "EntityDynamicInterface.h"
25 #include "EntityTreeRenderer.h"
27 class EntityTreeRenderer;
30 class SafeLanding :
public QObject {
32 static constexpr OCTREE_PACKET_SEQUENCE MAX_SEQUENCE = std::numeric_limits<OCTREE_PACKET_SEQUENCE>::max();
33 static constexpr OCTREE_PACKET_SEQUENCE INVALID_SEQUENCE = MAX_SEQUENCE;
35 void startTracking(QSharedPointer<EntityTreeRenderer> entityTreeRenderer);
36 void updateTracking();
39 bool isTracking()
const {
return _trackingEntities; }
40 bool trackingIsComplete()
const;
42 void finishSequence(OCTREE_PACKET_SEQUENCE first, OCTREE_PACKET_SEQUENCE last);
43 void addToSequence(OCTREE_PACKET_SEQUENCE sequenceNumber);
44 float loadingProgressPercentage();
51 bool isEntityPhysicsReady(
const EntityItemPointer& entity);
52 void debugDumpSequenceIDs()
const;
55 using Locker = std::lock_guard<std::mutex>;
56 bool _trackingEntities {
false };
57 QSharedPointer<EntityTreeRenderer> _entityTreeRenderer;
58 using EntityMap = std::map<EntityItemID, EntityItemPointer>;
59 EntityMap _trackedEntities;
61 OCTREE_PACKET_SEQUENCE _sequenceStart { INVALID_SEQUENCE };
62 OCTREE_PACKET_SEQUENCE _sequenceEnd { INVALID_SEQUENCE };
63 int32_t _maxTrackedEntityCount { 0 };
64 int32_t _trackedEntityStabilityCount { 0 };
66 quint64 _startTime { 0 };
68 struct SequenceLessThan {
69 bool operator()(
const OCTREE_PACKET_SEQUENCE& a,
const OCTREE_PACKET_SEQUENCE& b)
const;
72 using SequenceSet = std::set<OCTREE_PACKET_SEQUENCE, SequenceLessThan>;
73 SequenceSet _sequenceNumbers;
75 static CalculateEntityLoadingPriority entityLoadingOperatorElevateCollidables;
76 CalculateEntityLoadingPriority _prevEntityLoadingPriorityOperator {
nullptr };
Abstract ID for editing model items. Used in EntityItem JS API.
Definition: EntityItemID.h:28