From a5a135c2bada77b0c7daff7163227a24ec47884e Mon Sep 17 00:00:00 2001 From: Nissim Hadar Date: Fri, 27 Oct 2017 15:39:14 -0700 Subject: [PATCH] Fixes for 8672-8674. --- libraries/entities/src/EntityPropertyFlags.h | 36 +++---- libraries/entities/src/HazePropertyGroup.cpp | 1 + libraries/entities/src/ZoneEntityItem.cpp | 100 ------------------- libraries/entities/src/ZoneEntityItem.h | 41 -------- libraries/model/src/model/Stage.h | 22 ++-- 5 files changed, 30 insertions(+), 170 deletions(-) diff --git a/libraries/entities/src/EntityPropertyFlags.h b/libraries/entities/src/EntityPropertyFlags.h index c20b362b04..f0f22b0091 100644 --- a/libraries/entities/src/EntityPropertyFlags.h +++ b/libraries/entities/src/EntityPropertyFlags.h @@ -202,6 +202,24 @@ enum EntityPropertyList { PROP_ENTITY_INSTANCE_NUMBER, PROP_CERTIFICATE_ID, + PROP_HAZE_MODE, + + PROP_HAZE_RANGE, + PROP_HAZE_COLOR, + PROP_HAZE_GLARE_COLOR, + PROP_HAZE_ENABLE_GLARE, + PROP_HAZE_GLARE_ANGLE, + + PROP_HAZE_ALTITUDE_EFFECT, + PROP_HAZE_CEILING, + PROP_HAZE_BASE_REF, + + PROP_HAZE_BACKGROUND_BLEND, + + PROP_HAZE_ATTENUATE_KEYLIGHT, + PROP_HAZE_KEYLIGHT_RANGE, + PROP_HAZE_KEYLIGHT_ALTITUDE, + //////////////////////////////////////////////////////////////////////////////////////////////////// // ATTENTION: add new properties to end of list just ABOVE this line PROP_AFTER_LAST_ITEM, @@ -234,24 +252,6 @@ enum EntityPropertyList { PROP_STAGE_AUTOMATIC_HOURDAY = PROP_ANIMATION_FRAME_INDEX, PROP_BACKGROUND_MODE = PROP_MODEL_URL, - PROP_HAZE_MODE = PROP_COLOR, - - PROP_HAZE_RANGE = PROP_INTENSITY, - PROP_HAZE_COLOR = PROP_CUTOFF, - PROP_HAZE_GLARE_COLOR = PROP_EXPONENT, - PROP_HAZE_ENABLE_GLARE = PROP_IS_SPOTLIGHT, - PROP_HAZE_GLARE_ANGLE = PROP_DIFFUSE_COLOR, - - PROP_HAZE_ALTITUDE_EFFECT = PROP_AMBIENT_COLOR_UNUSED, - PROP_HAZE_CEILING = PROP_SPECULAR_COLOR_UNUSED, - PROP_HAZE_BASE_REF = PROP_LINEAR_ATTENUATION_UNUSED, - - PROP_HAZE_BACKGROUND_BLEND = PROP_QUADRATIC_ATTENUATION_UNUSED, - - PROP_HAZE_ATTENUATE_KEYLIGHT = PROP_ANIMATION_FRAME_INDEX, - PROP_HAZE_KEYLIGHT_RANGE = PROP_MODEL_URL, - PROP_HAZE_KEYLIGHT_ALTITUDE = PROP_ANIMATION_URL, - PROP_SKYBOX_COLOR = PROP_ANIMATION_URL, PROP_SKYBOX_URL = PROP_ANIMATION_FPS, PROP_KEYLIGHT_AMBIENT_URL = PROP_ANIMATION_PLAYING, diff --git a/libraries/entities/src/HazePropertyGroup.cpp b/libraries/entities/src/HazePropertyGroup.cpp index 3cc3e69960..f137fca5ce 100644 --- a/libraries/entities/src/HazePropertyGroup.cpp +++ b/libraries/entities/src/HazePropertyGroup.cpp @@ -293,6 +293,7 @@ EntityPropertyFlags HazePropertyGroup::getEntityProperties(EncodeBitstreamParams requestedProperties += PROP_HAZE_ENABLE_GLARE; requestedProperties += PROP_HAZE_GLARE_ANGLE; + requestedProperties += PROP_HAZE_ALTITUDE_EFFECT; requestedProperties += PROP_HAZE_CEILING; requestedProperties += PROP_HAZE_BASE_REF; diff --git a/libraries/entities/src/ZoneEntityItem.cpp b/libraries/entities/src/ZoneEntityItem.cpp index 588c1f9386..8b3d22daaf 100644 --- a/libraries/entities/src/ZoneEntityItem.cpp +++ b/libraries/entities/src/ZoneEntityItem.cpp @@ -330,103 +330,3 @@ void ZoneEntityItem::setHazeMode(const uint32_t value) { uint32_t ZoneEntityItem::getHazeMode() const { return _hazeMode; } - -void ZoneEntityItem::setHazeRange(const float hazeRange) { - _hazeRange = hazeRange; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeRange() const { - return _hazeRange; -} - -void ZoneEntityItem::setHazeColor(const xColor hazeColor) { - _hazeColor = hazeColor; - _hazePropertiesChanged = true; -} - -xColor ZoneEntityItem::getHazeColor() const { - return _hazeColor; -} - -void ZoneEntityItem::setHazeGlareColor(const xColor hazeGlareColor) { - _hazeGlareColor = hazeGlareColor; - _hazePropertiesChanged = true; -} - -xColor ZoneEntityItem::getHazeGlareColor()const { - return _hazeGlareColor; -} - -void ZoneEntityItem::setHazeEnableGlare(const bool hazeEnableGlare) { - _hazeEnableGlare = hazeEnableGlare; - _hazePropertiesChanged = true; -} - -bool ZoneEntityItem::getHazeEnableGlare()const { - return _hazeEnableGlare; -} - -void ZoneEntityItem::setHazeGlareAngle(const float hazeGlareAngle) { - _hazeGlareAngle = hazeGlareAngle; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeGlareAngle() const { - return _hazeGlareAngle; -} - -void ZoneEntityItem::setHazeCeiling(const float hazeCeiling) { - _hazeCeiling = hazeCeiling; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeCeiling() const { - return _hazeCeiling; -} - -void ZoneEntityItem::setHazeBaseRef(const float hazeBaseRef) { - _hazeBaseRef = hazeBaseRef; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeBaseRef() const { - return _hazeBaseRef; -} - -void ZoneEntityItem::setHazeBackgroundBlend(const float hazeBackgroundBlend) { - _hazeBackgroundBlend = hazeBackgroundBlend; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeBackgroundBlend() const { - return _hazeBackgroundBlend; -} - -void ZoneEntityItem::setHazeAttenuateKeyLight(const bool hazeAttenuateKeyLight) { - _hazeAttenuateKeyLight = hazeAttenuateKeyLight; - _hazePropertiesChanged = true; -} - -bool ZoneEntityItem::getHazeAttenuateKeyLight() const { - return _hazeAttenuateKeyLight; -} - -void ZoneEntityItem::setHazeKeyLightRange(const float hazeKeyLightRange) { - _hazeKeyLightRange = hazeKeyLightRange; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeKeyLightRange() const { - return _hazeKeyLightRange; -} - -void ZoneEntityItem::setHazeKeyLightAltitude(const float hazeKeyLightAltitude) { - _hazeKeyLightAltitude = hazeKeyLightAltitude; - _hazePropertiesChanged = true; -} - -float ZoneEntityItem::getHazeKeyLightAltitude() const { - return _hazeKeyLightAltitude; -} - diff --git a/libraries/entities/src/ZoneEntityItem.h b/libraries/entities/src/ZoneEntityItem.h index 628c228af6..ba5f3b3dee 100644 --- a/libraries/entities/src/ZoneEntityItem.h +++ b/libraries/entities/src/ZoneEntityItem.h @@ -74,32 +74,6 @@ public: void setHazeMode(const uint32_t value); uint32_t getHazeMode() const; - void setHazeRange(const float hazeRange); - float getHazeRange() const; - void setHazeColor(const xColor hazeColor); - xColor getHazeColor() const; - void setHazeGlareColor(const xColor hazeGlareColor); - xColor getHazeGlareColor() const; - void setHazeEnableGlare(const bool hazeEnableGlare); - bool getHazeEnableGlare() const; - void setHazeGlareAngle(const float hazeGlareAngle); - float getHazeGlareAngle() const; - - void setHazeCeiling(const float hazeCeiling); - float getHazeCeiling() const; - void setHazeBaseRef(const float hazeBaseRef); - float getHazeBaseRef() const; - - void setHazeBackgroundBlend(const float hazeBackgroundBlend); - float getHazeBackgroundBlend() const; - - void setHazeAttenuateKeyLight(const bool hazeAttenuateKeyLight); - bool getHazeAttenuateKeyLight() const; - void setHazeKeyLightRange(const float hazeKeyLightRange); - float getHazeKeyLightRange() const; - void setHazeKeyLightAltitude(const float hazeKeyLightAltitude); - float getHazeKeyLightAltitude() const; - SkyboxPropertyGroup getSkyboxProperties() const { return resultWithReadLock([&] { return _skyboxProperties; }); } const HazePropertyGroup& getHazeProperties() const { return _hazeProperties; } @@ -151,21 +125,6 @@ protected: uint32_t _hazeMode{ DEFAULT_HAZE_MODE }; - float _hazeRange{ model::initialHazeRange_m }; - xColor _hazeColor{ model::initialHazeColorXcolor }; - xColor _hazeGlareColor{ model::initialHazeGlareColorXcolor }; - bool _hazeEnableGlare{ false }; - float _hazeGlareAngle{ model::initialGlareAngle_degs }; - - float _hazeCeiling{ model::initialHazeBaseReference_m + model::initialHazeHeight_m }; - float _hazeBaseRef{ model::initialHazeBaseReference_m }; - - float _hazeBackgroundBlend{ model::initialHazeBackgroundBlend }; - - bool _hazeAttenuateKeyLight{ false }; - float _hazeKeyLightRange{ model::initialHazeKeyLightRange_m }; - float _hazeKeyLightAltitude{ model::initialHazeKeyLightAltitude_m }; - SkyboxPropertyGroup _skyboxProperties; HazePropertyGroup _hazeProperties; StagePropertyGroup _stageProperties; diff --git a/libraries/model/src/model/Stage.h b/libraries/model/src/model/Stage.h index e009684c62..a2eb7e3945 100644 --- a/libraries/model/src/model/Stage.h +++ b/libraries/model/src/model/Stage.h @@ -219,21 +219,21 @@ protected: uint8_t _hazeMode = (uint8_t)HAZE_OFF; - float _hazeRange; - xColor _hazeColor; - xColor _hazeGlareColor; - bool _hazeEnableGlare; - float _hazeGlareAngle; + float _hazeRange{ model::initialHazeRange_m }; + xColor _hazeColor{ model::initialHazeColorXcolor }; + xColor _hazeGlareColor{ model::initialHazeGlareColorXcolor }; + bool _hazeEnableGlare{ false }; + float _hazeGlareAngle{ model::initialGlareAngle_degs }; - bool _hazeAltitudeEffect; - float _hazeCeiling; + bool _hazeAltitudeEffect{ false }; + float _hazeCeiling{ model::initialHazeBaseReference_m + model::initialHazeHeight_m }; float _hazeBaseRef; - float _hazeBackgroundBlend; + float _hazeBackgroundBlend{ model::initialHazeBackgroundBlend }; - bool _hazeAttenuateKeyLight; - float _hazeKeyLightRange; - float _hazeKeyLightAltitude; + bool _hazeAttenuateKeyLight{ false }; + float _hazeKeyLightRange{ model::initialHazeKeyLightRange_m }; + float _hazeKeyLightAltitude{ model::initialHazeKeyLightAltitude_m }; LightPointer _sunLight; mutable SkyboxPointer _skybox;