From deee1598923eca51e78d9ca3613e2ae8f06b095c Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 19 Apr 2019 08:37:39 -0700 Subject: [PATCH] unravel physics-vs-entities lib dependencies part 1 --- libraries/entities/src/EntityItem.h | 3 ++- libraries/entities/src/SimulationOwner.h | 3 +++ libraries/physics/src/EntityMotionState.h | 1 + libraries/physics/src/ObjectActionTractor.cpp | 3 ++- libraries/physics/src/ObjectActionTravelOriented.cpp | 4 +++- libraries/physics/src/ObjectDynamic.h | 2 ++ libraries/physics/src/ObjectMotionState.h | 2 +- libraries/{entities => shared}/src/SimulationFlags.h | 11 +++++++++++ 8 files changed, 25 insertions(+), 4 deletions(-) rename libraries/{entities => shared}/src/SimulationFlags.h (79%) diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h index dc3c467ca1..303b12cffd 100644 --- a/libraries/entities/src/EntityItem.h +++ b/libraries/entities/src/EntityItem.h @@ -23,6 +23,7 @@ #include // for OctreeElement::AppendState #include #include +#include #include #include #include @@ -33,11 +34,11 @@ #include "EntityPropertyFlags.h" #include "EntityTypes.h" #include "SimulationOwner.h" -#include "SimulationFlags.h" #include "EntityDynamicInterface.h" #include "GrabPropertyGroup.h" class EntitySimulation; +using EntitySimulationPointer = std::shared_ptr; class EntityTreeElement; class EntityTreeElementExtraEncodeData; class EntityDynamicInterface; diff --git a/libraries/entities/src/SimulationOwner.h b/libraries/entities/src/SimulationOwner.h index f574234354..6f37066e47 100644 --- a/libraries/entities/src/SimulationOwner.h +++ b/libraries/entities/src/SimulationOwner.h @@ -89,6 +89,8 @@ // (14) When an entity's ownership priority drops to YIELD (=1, below VOLUNTEER) other participants may // bid for it immediately at VOLUNTEER. // +/* These declarations temporarily moved to SimulationFlags.h while we unravel some spaghetti dependencies. + * The intent is to move them back here once the dust settles. const uint8_t YIELD_SIMULATION_PRIORITY = 1; const uint8_t VOLUNTEER_SIMULATION_PRIORITY = YIELD_SIMULATION_PRIORITY + 1; const uint8_t RECRUIT_SIMULATION_PRIORITY = VOLUNTEER_SIMULATION_PRIORITY + 1; @@ -101,6 +103,7 @@ const uint8_t SCRIPT_POKE_SIMULATION_PRIORITY = SCRIPT_GRAB_SIMULATION_PRIORITY // which really just means: things that collide with it will be bid at a priority level one lower const uint8_t PERSONAL_SIMULATION_PRIORITY = SCRIPT_GRAB_SIMULATION_PRIORITY; const uint8_t AVATAR_ENTITY_SIMULATION_PRIORITY = PERSONAL_SIMULATION_PRIORITY; +*/ class SimulationOwner { diff --git a/libraries/physics/src/EntityMotionState.h b/libraries/physics/src/EntityMotionState.h index ddf384dc77..6e1ea66685 100644 --- a/libraries/physics/src/EntityMotionState.h +++ b/libraries/physics/src/EntityMotionState.h @@ -12,6 +12,7 @@ #ifndef hifi_EntityMotionState_h #define hifi_EntityMotionState_h +#include #include #include #include diff --git a/libraries/physics/src/ObjectActionTractor.cpp b/libraries/physics/src/ObjectActionTractor.cpp index c7681e217c..b53c2e137a 100644 --- a/libraries/physics/src/ObjectActionTractor.cpp +++ b/libraries/physics/src/ObjectActionTractor.cpp @@ -11,7 +11,8 @@ #include "ObjectActionTractor.h" -#include "QVariantGLM.h" +#include +#include #include "PhysicsLogging.h" diff --git a/libraries/physics/src/ObjectActionTravelOriented.cpp b/libraries/physics/src/ObjectActionTravelOriented.cpp index bd32ed13ff..b27ec40ae4 100644 --- a/libraries/physics/src/ObjectActionTravelOriented.cpp +++ b/libraries/physics/src/ObjectActionTravelOriented.cpp @@ -13,7 +13,9 @@ #include -#include "QVariantGLM.h" +#include +#include + #include "PhysicsLogging.h" const uint16_t ObjectActionTravelOriented::actionVersion = 1; diff --git a/libraries/physics/src/ObjectDynamic.h b/libraries/physics/src/ObjectDynamic.h index f41d6cd51d..49fa615b88 100644 --- a/libraries/physics/src/ObjectDynamic.h +++ b/libraries/physics/src/ObjectDynamic.h @@ -17,7 +17,9 @@ #include +#include #include +#include #include "ObjectMotionState.h" #include "BulletUtil.h" diff --git a/libraries/physics/src/ObjectMotionState.h b/libraries/physics/src/ObjectMotionState.h index fe175a2c7d..a53215753e 100644 --- a/libraries/physics/src/ObjectMotionState.h +++ b/libraries/physics/src/ObjectMotionState.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include "ContactInfo.h" #include "ShapeManager.h" diff --git a/libraries/entities/src/SimulationFlags.h b/libraries/shared/src/SimulationFlags.h similarity index 79% rename from libraries/entities/src/SimulationFlags.h rename to libraries/shared/src/SimulationFlags.h index c45b333b29..af8c0e5fce 100644 --- a/libraries/entities/src/SimulationFlags.h +++ b/libraries/shared/src/SimulationFlags.h @@ -12,6 +12,17 @@ #ifndef hifi_SimulationFlags_h #define hifi_SimulationFlags_h +const uint8_t YIELD_SIMULATION_PRIORITY = 1; +const uint8_t VOLUNTEER_SIMULATION_PRIORITY = YIELD_SIMULATION_PRIORITY + 1; +const uint8_t RECRUIT_SIMULATION_PRIORITY = VOLUNTEER_SIMULATION_PRIORITY + 1; + +const uint8_t SCRIPT_GRAB_SIMULATION_PRIORITY = 128; +const uint8_t SCRIPT_POKE_SIMULATION_PRIORITY = SCRIPT_GRAB_SIMULATION_PRIORITY - 1; + +const uint8_t PERSONAL_SIMULATION_PRIORITY = SCRIPT_GRAB_SIMULATION_PRIORITY; +const uint8_t AVATAR_ENTITY_SIMULATION_PRIORITY = PERSONAL_SIMULATION_PRIORITY; + + namespace Simulation { const uint32_t DIRTY_POSITION = 0x0001; const uint32_t DIRTY_ROTATION = 0x0002;