Overte C++ Documentation
SimpleEntitySimulation.h
1 //
2 // SimpleEntitySimulation.h
3 // libraries/entities/src
4 //
5 // Created by Andrew Meadows on 2014.11.24
6 // Copyright 2014 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_SimpleEntitySimulation_h
13 #define hifi_SimpleEntitySimulation_h
14 
15 #include "EntitySimulation.h"
16 
18 using SimpleEntitySimulationPointer = std::shared_ptr<SimpleEntitySimulation>;
19 
20 
22 
23 class SimpleEntitySimulation : public EntitySimulation {
24 public:
25  SimpleEntitySimulation() : EntitySimulation() { }
26  ~SimpleEntitySimulation() { clearEntities(); }
27 
28  void clearOwnership(const QUuid& ownerID);
29  void clearEntities() override;
30  void updateEntities() override;
31 
32 protected:
33  void addEntityToInternalLists(EntityItemPointer entity) override;
34  void removeEntityFromInternalLists(EntityItemPointer entity) override;
35  void processChangedEntity(const EntityItemPointer& entity) override;
36 
37  void sortEntitiesThatMoved() override;
38 
39  void expireStaleOwnerships(uint64_t now);
40  void stopOwnerlessEntities(uint64_t now);
41 
42  SetOfEntities _entitiesWithSimulationOwner;
43  SetOfEntities _entitiesThatNeedSimulationOwner;
44  uint64_t _nextOwnerlessExpiry { 0 };
45  uint64_t _nextStaleOwnershipExpiry { (uint64_t)(-1) };
46 };
47 
48 #endif // hifi_SimpleEntitySimulation_h
provides simple velocity + gravity extrapolation of EntityItem's
Definition: SimpleEntitySimulation.h:23