12 #ifndef hifi_ZoneEntityItem_h
13 #define hifi_ZoneEntityItem_h
15 #include <ComponentMode.h>
16 #include <model-networking/ModelCache.h>
18 #include "KeyLightPropertyGroup.h"
19 #include "AmbientLightPropertyGroup.h"
20 #include "EntityItem.h"
21 #include "EntityTree.h"
22 #include "SkyboxPropertyGroup.h"
23 #include "HazePropertyGroup.h"
24 #include "BloomPropertyGroup.h"
35 virtual EntityItemProperties getProperties(
const EntityPropertyFlags& desiredProperties,
bool allowEmptyDesiredProperties)
const override;
38 virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params)
const override;
40 virtual void appendSubclassData(
OctreePacketData* packetData, EncodeBitstreamParams& params,
41 EntityTreeElementExtraEncodeDataPointer modelTreeElementExtraEncodeData,
42 EntityPropertyFlags& requestedProperties,
43 EntityPropertyFlags& propertyFlags,
44 EntityPropertyFlags& propertiesDidntFit,
46 OctreeElement::AppendState& appendState)
const override;
48 virtual int readEntitySubclassDataFromBuffer(
const unsigned char* data,
int bytesLeftToRead,
49 ReadBitstreamToTreeParams& args,
50 EntityPropertyFlags& propertyFlags,
bool overwriteLocalData,
51 bool& somethingChanged)
override;
55 static bool getZonesArePickable() {
return _zonesArePickable; }
56 static void setZonesArePickable(
bool value) { _zonesArePickable = value; }
58 static bool getDrawZoneBoundaries() {
return _drawZoneBoundaries; }
59 static void setDrawZoneBoundaries(
bool value) { _drawZoneBoundaries = value; }
61 virtual bool isReadyToComputeShape()
const override {
return false; }
62 virtual void setShapeType(ShapeType type)
override;
64 bool shouldBePhysical()
const override {
return false; }
66 QString getCompoundShapeURL()
const;
67 virtual void setCompoundShapeURL(
const QString& url);
69 virtual bool matchesJSONFilters(
const QJsonObject& jsonFilters)
const override;
71 KeyLightPropertyGroup getKeyLightProperties()
const {
return resultWithReadLock<KeyLightPropertyGroup>([&] {
return _keyLightProperties; }); }
72 AmbientLightPropertyGroup getAmbientLightProperties()
const {
return resultWithReadLock<AmbientLightPropertyGroup>([&] {
return _ambientLightProperties; }); }
74 void setHazeMode(
const uint32_t value);
75 uint32_t getHazeMode()
const;
77 void setKeyLightMode(uint32_t value);
78 uint32_t getKeyLightMode()
const;
80 void setAmbientLightMode(uint32_t value);
81 uint32_t getAmbientLightMode()
const;
83 void setSkyboxMode(uint32_t value);
84 uint32_t getSkyboxMode()
const;
86 void setBloomMode(
const uint32_t value);
87 uint32_t getBloomMode()
const;
89 SkyboxPropertyGroup getSkyboxProperties()
const {
return resultWithReadLock<SkyboxPropertyGroup>([&] {
return _skyboxProperties; }); }
91 const HazePropertyGroup& getHazeProperties()
const {
return _hazeProperties; }
92 const BloomPropertyGroup& getBloomProperties()
const {
return _bloomProperties; }
94 bool getFlyingAllowed()
const {
return _flyingAllowed; }
95 void setFlyingAllowed(
bool value) { _flyingAllowed = value; }
96 bool getGhostingAllowed()
const {
return _ghostingAllowed; }
97 void setGhostingAllowed(
bool value) { _ghostingAllowed = value; }
98 QString getFilterURL()
const;
99 void setFilterURL(
const QString url);
101 uint32_t getAvatarPriority()
const {
return _avatarPriority; }
102 void setAvatarPriority(uint32_t value) { _avatarPriority = value; }
104 uint32_t getScreenshare()
const {
return _screenshare; }
105 void setScreenshare(uint32_t value) { _screenshare = value; }
107 void setUserData(
const QString& value)
override;
109 bool keyLightPropertiesChanged()
const {
return _keyLightPropertiesChanged; }
110 bool ambientLightPropertiesChanged()
const {
return _ambientLightPropertiesChanged; }
111 bool skyboxPropertiesChanged()
const {
return _skyboxPropertiesChanged; }
112 bool hazePropertiesChanged()
const {
return _hazePropertiesChanged; }
113 bool bloomPropertiesChanged()
const {
return _bloomPropertiesChanged; }
115 void resetRenderingPropertiesChanged();
117 virtual bool supportsDetailedIntersection()
const override {
return true; }
118 virtual bool findDetailedRayIntersection(
const glm::vec3& origin,
const glm::vec3& direction,
119 const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
float& distance,
120 BoxFace& face, glm::vec3& surfaceNormal,
121 QVariantMap& extraInfo,
bool precisionPicking)
const override;
122 virtual bool findDetailedParabolaIntersection(
const glm::vec3& origin,
const glm::vec3& velocity,
123 const glm::vec3& acceleration,
const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
124 float& parabolicDistance, BoxFace& face, glm::vec3& surfaceNormal,
125 QVariantMap& extraInfo,
bool precisionPicking)
const override;
127 bool contains(
const glm::vec3& point)
const override;
129 virtual void debugDump()
const override;
131 static const ShapeType DEFAULT_SHAPE_TYPE;
132 static const QString DEFAULT_COMPOUND_SHAPE_URL;
133 static const bool DEFAULT_FLYING_ALLOWED;
134 static const bool DEFAULT_GHOSTING_ALLOWED;
135 static const QString DEFAULT_FILTER_URL;
138 KeyLightPropertyGroup _keyLightProperties;
139 AmbientLightPropertyGroup _ambientLightProperties;
141 ShapeType _shapeType { DEFAULT_SHAPE_TYPE };
142 QString _compoundShapeURL;
145 uint32_t _keyLightMode { COMPONENT_MODE_INHERIT };
146 uint32_t _skyboxMode { COMPONENT_MODE_INHERIT };
147 uint32_t _ambientLightMode { COMPONENT_MODE_INHERIT };
149 uint32_t _hazeMode { COMPONENT_MODE_INHERIT };
150 uint32_t _bloomMode { COMPONENT_MODE_INHERIT };
152 SkyboxPropertyGroup _skyboxProperties;
153 HazePropertyGroup _hazeProperties;
154 BloomPropertyGroup _bloomProperties;
156 bool _flyingAllowed { DEFAULT_FLYING_ALLOWED };
157 bool _ghostingAllowed { DEFAULT_GHOSTING_ALLOWED };
158 QString _filterURL { DEFAULT_FILTER_URL };
161 uint32_t _avatarPriority { COMPONENT_MODE_INHERIT };
164 uint32_t _screenshare { COMPONENT_MODE_INHERIT };
167 bool _keyLightPropertiesChanged {
false };
168 bool _ambientLightPropertiesChanged {
false };
169 bool _skyboxPropertiesChanged {
false };
170 bool _hazePropertiesChanged{
false };
171 bool _bloomPropertiesChanged {
false };
173 static bool _drawZoneBoundaries;
174 static bool _zonesArePickable;
176 void fetchCollisionGeometryResource();
177 GeometryResource::Pointer _shapeResource;
Definition: EntityItem.h:82
virtual ShapeType getShapeType() const
return preferred shape type (actual physical shape may differ)
Definition: EntityItem.h:390
Abstract ID for editing model items. Used in EntityItem JS API.
Definition: EntityItemID.h:28
Definition: EntityItemProperties.h:106
Handles packing of the data portion of PacketType_OCTREE_DATA messages.
Definition: OctreePacketData.h:93