PositionModifierComponent.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "PositionModifierComponent.h"
  9. #include <AzCore/Component/Entity.h>
  10. #include <AzCore/RTTI/BehaviorContext.h>
  11. #include <AzCore/Serialization/EditContext.h>
  12. #include <AzCore/Serialization/SerializeContext.h>
  13. #include <AzCore/std/sort.h>
  14. #include <Vegetation/Descriptor.h>
  15. #include <GradientSignal/Ebuses/GradientRequestBus.h>
  16. #include <Vegetation/InstanceData.h>
  17. #include <VegetationProfiler.h>
  18. #include <SurfaceData/SurfaceDataSystemRequestBus.h>
  19. namespace Vegetation
  20. {
  21. namespace PositionModifierUtil
  22. {
  23. static bool UpdateVersion(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement)
  24. {
  25. if (classElement.GetVersion() < 1)
  26. {
  27. AZ::Vector3 rangeMin(-0.3f, -0.3f, 0.0f);
  28. if (classElement.GetChildData(AZ_CRC_CE("RangeMin"), rangeMin))
  29. {
  30. classElement.RemoveElementByName(AZ_CRC_CE("RangeMin"));
  31. classElement.AddElementWithData(context, "RangeMinX", (float)rangeMin.GetX());
  32. classElement.AddElementWithData(context, "RangeMinY", (float)rangeMin.GetY());
  33. classElement.AddElementWithData(context, "RangeMinZ", (float)rangeMin.GetZ());
  34. }
  35. AZ::Vector3 rangeMax(0.3f, 0.3f, 0.0f);
  36. if (classElement.GetChildData(AZ_CRC_CE("RangeMax"), rangeMax))
  37. {
  38. classElement.RemoveElementByName(AZ_CRC_CE("RangeMax"));
  39. classElement.AddElementWithData(context, "RangeMaxX", (float)rangeMax.GetX());
  40. classElement.AddElementWithData(context, "RangeMaxY", (float)rangeMax.GetY());
  41. classElement.AddElementWithData(context, "RangeMaxZ", (float)rangeMax.GetZ());
  42. }
  43. }
  44. return true;
  45. }
  46. }
  47. void PositionModifierConfig::Reflect(AZ::ReflectContext* context)
  48. {
  49. AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context);
  50. if (serialize)
  51. {
  52. serialize->Class<PositionModifierConfig, AZ::ComponentConfig>()
  53. ->Version(1, &PositionModifierUtil::UpdateVersion)
  54. ->Field("AllowOverrides", &PositionModifierConfig::m_allowOverrides)
  55. ->Field("AutoSnapToSurface", &PositionModifierConfig::m_autoSnapToSurface)
  56. ->Field("SurfacesToSnapTo", &PositionModifierConfig::m_surfaceTagsToSnapTo)
  57. ->Field("RangeMinX", &PositionModifierConfig::m_rangeMinX)
  58. ->Field("RangeMaxX", &PositionModifierConfig::m_rangeMaxX)
  59. ->Field("GradientX", &PositionModifierConfig::m_gradientSamplerX)
  60. ->Field("RangeMinY", &PositionModifierConfig::m_rangeMinY)
  61. ->Field("RangeMaxY", &PositionModifierConfig::m_rangeMaxY)
  62. ->Field("GradientY", &PositionModifierConfig::m_gradientSamplerY)
  63. ->Field("RangeMinZ", &PositionModifierConfig::m_rangeMinZ)
  64. ->Field("RangeMaxZ", &PositionModifierConfig::m_rangeMaxZ)
  65. ->Field("GradientZ", &PositionModifierConfig::m_gradientSamplerZ)
  66. ;
  67. AZ::EditContext* edit = serialize->GetEditContext();
  68. if (edit)
  69. {
  70. edit->Class<PositionModifierConfig>(
  71. "Vegetation Position Modifier", "")
  72. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  73. ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
  74. ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
  75. ->DataElement(AZ::Edit::UIHandlers::CheckBox, &PositionModifierConfig::m_allowOverrides, "Allow Per-Item Overrides", "Allow per-descriptor parameters to override component parameters.")
  76. ->DataElement(0, &PositionModifierConfig::m_autoSnapToSurface, "Auto Snap To Surface", "Automatically snap to the surface closest to the new position using Surface Tags To Snap To plus the initial surface tags.")
  77. ->DataElement(0, &PositionModifierConfig::m_surfaceTagsToSnapTo, "Surface Tags To Snap To", "Additional surface tags to snap to if auto snap is enabled.")
  78. ->ClassElement(AZ::Edit::ClassElements::Group, "Position X")
  79. ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
  80. ->DataElement(AZ::Edit::UIHandlers::Slider, &PositionModifierConfig::m_rangeMinX, "Range Min", "Minimum position offset on X axis.")
  81. ->Attribute(AZ::Edit::Attributes::Min, std::numeric_limits<float>::lowest())
  82. ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits<float>::max())
  83. ->Attribute(AZ::Edit::Attributes::SoftMin, -2.0f)
  84. ->Attribute(AZ::Edit::Attributes::SoftMax, 2.0f)
  85. ->DataElement(AZ::Edit::UIHandlers::Slider, &PositionModifierConfig::m_rangeMaxX, "Range Max", "Maximum position offset on X axis.")
  86. ->Attribute(AZ::Edit::Attributes::Min, std::numeric_limits<float>::lowest())
  87. ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits<float>::max())
  88. ->Attribute(AZ::Edit::Attributes::SoftMin, -2.0f)
  89. ->Attribute(AZ::Edit::Attributes::SoftMax, 2.0f)
  90. ->DataElement(0, &PositionModifierConfig::m_gradientSamplerX, "Gradient", "Gradient used as blend factor to lerp between ranges on X axis.")
  91. ->ClassElement(AZ::Edit::ClassElements::Group, "Position Y")
  92. ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
  93. ->DataElement(AZ::Edit::UIHandlers::Slider, &PositionModifierConfig::m_rangeMinY, "Range Min", "Minimum position offset on Y axis.")
  94. ->Attribute(AZ::Edit::Attributes::Min, std::numeric_limits<float>::lowest())
  95. ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits<float>::max())
  96. ->Attribute(AZ::Edit::Attributes::SoftMin, -2.0f)
  97. ->Attribute(AZ::Edit::Attributes::SoftMax, 2.0f)
  98. ->DataElement(AZ::Edit::UIHandlers::Slider, &PositionModifierConfig::m_rangeMaxY, "Range Max", "Maximum position offset on Y axis.")
  99. ->Attribute(AZ::Edit::Attributes::Min, std::numeric_limits<float>::lowest())
  100. ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits<float>::max())
  101. ->Attribute(AZ::Edit::Attributes::SoftMin, -2.0f)
  102. ->Attribute(AZ::Edit::Attributes::SoftMax, 2.0f)
  103. ->DataElement(0, &PositionModifierConfig::m_gradientSamplerY, "Gradient", "Gradient used as blend factor to lerp between ranges on Y axis.")
  104. ->ClassElement(AZ::Edit::ClassElements::Group, "Position Z")
  105. ->Attribute(AZ::Edit::Attributes::AutoExpand, false)
  106. ->DataElement(AZ::Edit::UIHandlers::Slider, &PositionModifierConfig::m_rangeMinZ, "Range Min", "Minimum position offset on Z axis.")
  107. ->Attribute(AZ::Edit::Attributes::Min, std::numeric_limits<float>::lowest())
  108. ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits<float>::max())
  109. ->Attribute(AZ::Edit::Attributes::SoftMin, -2.0f)
  110. ->Attribute(AZ::Edit::Attributes::SoftMax, 2.0f)
  111. ->DataElement(AZ::Edit::UIHandlers::Slider, &PositionModifierConfig::m_rangeMaxZ, "Range Max", "Maximum position offset on Z axis.")
  112. ->Attribute(AZ::Edit::Attributes::Min, std::numeric_limits<float>::lowest())
  113. ->Attribute(AZ::Edit::Attributes::Max, std::numeric_limits<float>::max())
  114. ->Attribute(AZ::Edit::Attributes::SoftMin, -2.0f)
  115. ->Attribute(AZ::Edit::Attributes::SoftMax, 2.0f)
  116. ->DataElement(0, &PositionModifierConfig::m_gradientSamplerZ, "Gradient", "Gradient used as blend factor to lerp between ranges on Z axis.")
  117. ;
  118. }
  119. }
  120. if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  121. {
  122. behaviorContext->Class<PositionModifierConfig>()
  123. ->Attribute(AZ::Script::Attributes::Category, "Vegetation")
  124. ->Constructor()
  125. ->Property("allowOverrides", BehaviorValueProperty(&PositionModifierConfig::m_allowOverrides))
  126. ->Property("rangeMinX", BehaviorValueProperty(&PositionModifierConfig::m_rangeMinX))
  127. ->Property("rangeMaxX", BehaviorValueProperty(&PositionModifierConfig::m_rangeMaxX))
  128. ->Property("gradientSamplerX", BehaviorValueProperty(&PositionModifierConfig::m_gradientSamplerX))
  129. ->Property("rangeMinY", BehaviorValueProperty(&PositionModifierConfig::m_rangeMinY))
  130. ->Property("rangeMaxY", BehaviorValueProperty(&PositionModifierConfig::m_rangeMaxY))
  131. ->Property("gradientSamplerY", BehaviorValueProperty(&PositionModifierConfig::m_gradientSamplerY))
  132. ->Property("rangeMinZ", BehaviorValueProperty(&PositionModifierConfig::m_rangeMinZ))
  133. ->Property("rangeMaxZ", BehaviorValueProperty(&PositionModifierConfig::m_rangeMaxZ))
  134. ->Property("gradientSamplerZ", BehaviorValueProperty(&PositionModifierConfig::m_gradientSamplerZ))
  135. ->Method("GetNumTags", &PositionModifierConfig::GetNumTags)
  136. ->Method("GetTag", &PositionModifierConfig::GetTag)
  137. ->Method("RemoveTag", &PositionModifierConfig::RemoveTag)
  138. ->Method("AddTag", &PositionModifierConfig::AddTag)
  139. ;
  140. }
  141. }
  142. size_t PositionModifierConfig::GetNumTags() const
  143. {
  144. return m_surfaceTagsToSnapTo.size();
  145. }
  146. AZ::Crc32 PositionModifierConfig::GetTag(int tagIndex) const
  147. {
  148. if (tagIndex < m_surfaceTagsToSnapTo.size())
  149. {
  150. return m_surfaceTagsToSnapTo[tagIndex];
  151. }
  152. return AZ::Crc32();
  153. }
  154. void PositionModifierConfig::RemoveTag(int tagIndex)
  155. {
  156. if (tagIndex < m_surfaceTagsToSnapTo.size())
  157. {
  158. m_surfaceTagsToSnapTo.erase(m_surfaceTagsToSnapTo.begin() + tagIndex);
  159. }
  160. }
  161. void PositionModifierConfig::AddTag(AZStd::string tag)
  162. {
  163. m_surfaceTagsToSnapTo.push_back(SurfaceData::SurfaceTag(tag));
  164. }
  165. void PositionModifierComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services)
  166. {
  167. services.push_back(AZ_CRC_CE("VegetationModifierService"));
  168. services.push_back(AZ_CRC_CE("VegetationPositionModifierService"));
  169. }
  170. void PositionModifierComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services)
  171. {
  172. services.push_back(AZ_CRC_CE("VegetationPositionModifierService"));
  173. }
  174. void PositionModifierComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& services)
  175. {
  176. services.push_back(AZ_CRC_CE("VegetationAreaService"));
  177. }
  178. void PositionModifierComponent::Reflect(AZ::ReflectContext* context)
  179. {
  180. PositionModifierConfig::Reflect(context);
  181. AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context);
  182. if (serialize)
  183. {
  184. serialize->Class<PositionModifierComponent, AZ::Component>()
  185. ->Version(0)
  186. ->Field("Configuration", &PositionModifierComponent::m_configuration)
  187. ;
  188. }
  189. if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  190. {
  191. behaviorContext->Constant("PositionModifierComponentTypeId", BehaviorConstant(PositionModifierComponentTypeId));
  192. behaviorContext->Class<PositionModifierComponent>()->RequestBus("PositionModifierRequestBus");
  193. behaviorContext->EBus<PositionModifierRequestBus>("PositionModifierRequestBus")
  194. ->Attribute(AZ::Script::Attributes::Category, "Vegetation")
  195. ->Event("GetAllowOverrides", &PositionModifierRequestBus::Events::GetAllowOverrides)
  196. ->Event("SetAllowOverrides", &PositionModifierRequestBus::Events::SetAllowOverrides)
  197. ->VirtualProperty("AllowOverrides", "GetAllowOverrides", "SetAllowOverrides")
  198. ->Event("GetRangeMin", &PositionModifierRequestBus::Events::GetRangeMin)
  199. ->Event("SetRangeMin", &PositionModifierRequestBus::Events::SetRangeMin)
  200. ->VirtualProperty("RangeMin", "GetRangeMin", "SetRangeMin")
  201. ->Event("GetRangeMax", &PositionModifierRequestBus::Events::GetRangeMax)
  202. ->Event("SetRangeMax", &PositionModifierRequestBus::Events::SetRangeMax)
  203. ->VirtualProperty("RangeMax", "GetRangeMax", "SetRangeMax")
  204. ->Event("GetGradientSamplerX", &PositionModifierRequestBus::Events::GetGradientSamplerX)
  205. ->Event("GetGradientSamplerY", &PositionModifierRequestBus::Events::GetGradientSamplerY)
  206. ->Event("GetGradientSamplerZ", &PositionModifierRequestBus::Events::GetGradientSamplerZ)
  207. ->Event("GetNumTags", &PositionModifierRequestBus::Events::GetNumTags)
  208. ->Event("GetTag", &PositionModifierRequestBus::Events::GetTag)
  209. ->Event("RemoveTag", &PositionModifierRequestBus::Events::RemoveTag)
  210. ->Event("AddTag", &PositionModifierRequestBus::Events::AddTag)
  211. ;
  212. }
  213. }
  214. PositionModifierComponent::PositionModifierComponent(const PositionModifierConfig& configuration)
  215. : m_configuration(configuration)
  216. {
  217. }
  218. void PositionModifierComponent::Activate()
  219. {
  220. m_dependencyMonitor.Reset();
  221. m_dependencyMonitor.ConnectOwner(GetEntityId());
  222. m_dependencyMonitor.ConnectDependencies({
  223. m_configuration.m_gradientSamplerX.m_gradientId,
  224. m_configuration.m_gradientSamplerY.m_gradientId,
  225. m_configuration.m_gradientSamplerZ.m_gradientId });
  226. ModifierRequestBus::Handler::BusConnect(GetEntityId());
  227. PositionModifierRequestBus::Handler::BusConnect(GetEntityId());
  228. }
  229. void PositionModifierComponent::Deactivate()
  230. {
  231. m_dependencyMonitor.Reset();
  232. ModifierRequestBus::Handler::BusDisconnect();
  233. PositionModifierRequestBus::Handler::BusDisconnect();
  234. }
  235. bool PositionModifierComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig)
  236. {
  237. if (auto config = azrtti_cast<const PositionModifierConfig*>(baseConfig))
  238. {
  239. m_configuration = *config;
  240. return true;
  241. }
  242. return false;
  243. }
  244. bool PositionModifierComponent::WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const
  245. {
  246. if (auto config = azrtti_cast<PositionModifierConfig*>(outBaseConfig))
  247. {
  248. *config = m_configuration;
  249. return true;
  250. }
  251. return false;
  252. }
  253. void PositionModifierComponent::Execute(InstanceData& instanceData) const
  254. {
  255. VEGETATION_PROFILE_FUNCTION_VERBOSE
  256. const GradientSignal::GradientSampleParams sampleParams(instanceData.m_position);
  257. float factorX = m_configuration.m_gradientSamplerX.GetValue(sampleParams);
  258. float factorY = m_configuration.m_gradientSamplerY.GetValue(sampleParams);
  259. float factorZ = m_configuration.m_gradientSamplerZ.GetValue(sampleParams);
  260. const bool useOverrides = m_configuration.m_allowOverrides && instanceData.m_descriptorPtr && instanceData.m_descriptorPtr->m_positionOverrideEnabled;
  261. const AZ::Vector3& min = useOverrides ? instanceData.m_descriptorPtr->GetPositionMin() : GetRangeMin();
  262. const AZ::Vector3& max = useOverrides ? instanceData.m_descriptorPtr->GetPositionMax() : GetRangeMax();
  263. const AZ::Vector3 delta = min + AZ::Vector3(
  264. (max.GetX() - min.GetX()) * factorX,
  265. (max.GetY() - min.GetY()) * factorY,
  266. (max.GetZ() - min.GetZ()) * factorZ);
  267. const AZ::Vector3 deltaXY(delta.GetX(), delta.GetY(), 0.0f);
  268. instanceData.m_position += deltaXY;
  269. //auto snapping to surface if change occurred on XY axis
  270. if (m_configuration.m_autoSnapToSurface && !deltaXY.IsClose(AZ::Vector3::CreateZero()))
  271. {
  272. //get the combined set of masks to consider for snapping
  273. m_surfaceTagsToSnapToCombined.clear();
  274. m_surfaceTagsToSnapToCombined.reserve(
  275. m_configuration.m_surfaceTagsToSnapTo.size() +
  276. instanceData.m_masks.GetSize());
  277. m_surfaceTagsToSnapToCombined.insert(m_surfaceTagsToSnapToCombined.end(),
  278. m_configuration.m_surfaceTagsToSnapTo.begin(), m_configuration.m_surfaceTagsToSnapTo.end());
  279. instanceData.m_masks.EnumerateWeights(
  280. [this](AZ::Crc32 surfaceType, [[maybe_unused]] float weight)
  281. {
  282. m_surfaceTagsToSnapToCombined.push_back(surfaceType);
  283. return true;
  284. });
  285. //get the intersection data at the new position
  286. m_points.Clear();
  287. AZ::Interface<SurfaceData::SurfaceDataSystem>::Get()->GetSurfacePoints(
  288. instanceData.m_position, m_surfaceTagsToSnapToCombined, m_points);
  289. // Get the point with the closest distance from the new position in case there are multiple intersections at different or
  290. // unrelated heights
  291. float closestPointDistanceSq = AZStd::numeric_limits<float>::max();
  292. AZ::Vector3 originalInstanceDataPosition = instanceData.m_position;
  293. m_points.EnumeratePoints(
  294. [&instanceData, originalInstanceDataPosition, &closestPointDistanceSq](
  295. [[maybe_unused]] size_t inPositionIndex, const AZ::Vector3& position,
  296. const AZ::Vector3& normal, const SurfaceData::SurfaceTagWeights& masks) -> bool
  297. {
  298. float distanceSq = position.GetDistanceSq(originalInstanceDataPosition);
  299. if (distanceSq < closestPointDistanceSq)
  300. {
  301. instanceData.m_position = position;
  302. instanceData.m_normal = normal;
  303. instanceData.m_masks = masks;
  304. closestPointDistanceSq = distanceSq;
  305. }
  306. return true;
  307. });
  308. }
  309. instanceData.m_position.SetZ(instanceData.m_position.GetZ() + delta.GetZ());
  310. }
  311. ModifierStage PositionModifierComponent::GetModifierStage() const
  312. {
  313. return ModifierStage::PreProcess;
  314. }
  315. bool PositionModifierComponent::GetAllowOverrides() const
  316. {
  317. return m_configuration.m_allowOverrides;
  318. }
  319. void PositionModifierComponent::SetAllowOverrides(bool value)
  320. {
  321. m_configuration.m_allowOverrides = value;
  322. LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged);
  323. }
  324. AZ::Vector3 PositionModifierComponent::GetRangeMin() const
  325. {
  326. return AZ::Vector3(m_configuration.m_rangeMinX, m_configuration.m_rangeMinY, m_configuration.m_rangeMinZ);
  327. }
  328. void PositionModifierComponent::SetRangeMin(AZ::Vector3 rangeMin)
  329. {
  330. m_configuration.m_rangeMinX = rangeMin.GetX();
  331. m_configuration.m_rangeMinY = rangeMin.GetY();
  332. m_configuration.m_rangeMinZ = rangeMin.GetZ();
  333. LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged);
  334. }
  335. AZ::Vector3 PositionModifierComponent::GetRangeMax() const
  336. {
  337. return AZ::Vector3(m_configuration.m_rangeMaxX, m_configuration.m_rangeMaxY, m_configuration.m_rangeMaxZ);
  338. }
  339. void PositionModifierComponent::SetRangeMax(AZ::Vector3 rangeMax)
  340. {
  341. m_configuration.m_rangeMaxX = rangeMax.GetX();
  342. m_configuration.m_rangeMaxY = rangeMax.GetY();
  343. m_configuration.m_rangeMaxZ = rangeMax.GetZ();
  344. LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged);
  345. }
  346. GradientSignal::GradientSampler& PositionModifierComponent::GetGradientSamplerX()
  347. {
  348. return m_configuration.m_gradientSamplerX;
  349. }
  350. GradientSignal::GradientSampler& PositionModifierComponent::GetGradientSamplerY()
  351. {
  352. return m_configuration.m_gradientSamplerY;
  353. }
  354. GradientSignal::GradientSampler& PositionModifierComponent::GetGradientSamplerZ()
  355. {
  356. return m_configuration.m_gradientSamplerZ;
  357. }
  358. size_t PositionModifierComponent::GetNumTags() const
  359. {
  360. return m_configuration.GetNumTags();
  361. }
  362. AZ::Crc32 PositionModifierComponent::GetTag(int tagIndex) const
  363. {
  364. return m_configuration.GetTag(tagIndex);
  365. }
  366. void PositionModifierComponent::RemoveTag(int tagIndex)
  367. {
  368. m_configuration.RemoveTag(tagIndex);
  369. LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged);
  370. }
  371. void PositionModifierComponent::AddTag(AZStd::string tag)
  372. {
  373. m_configuration.AddTag(tag);
  374. LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged);
  375. }
  376. }