44 AvalancheController(Terrain* terrain);
51 AvalancheController();
63 void setAvalancheDecayFraction(
agx::Real avalancheDecayFraction);
65 agx::Real getAvalancheDecayFraction()
const;
67 void setAvalancheMaxHeightGrowth(
agx::Real maxHeightGrowth);
69 agx::Real getAvalancheMaxHeightGrowth()
const;
83 virtual ~AvalancheController();
90 SurfaceInfoTable m_surfaceInfoTable;
92 void applyGrowthMap();
103 class AvalancheIterationMap
120 return m_avalancheIterationVector[toIndex(k)];
126 size_t vectorIndex = toIndex(k);
127 if (!m_avalancheIterationVector[vectorIndex].contains(index))
129 m_avalancheIterationVector[vectorIndex].push_back(index,index);
135 size_t vectorIndex = toIndex(k);
136 if (vectorIndex > m_avalancheIterationVector.size() - 1)
139 return m_avalancheIterationVector[vectorIndex].contains(index);
154 size_t vectorIndex = toIndex(k);
155 if (vectorIndex > m_avalancheIterationVector.size() - 1)
157 m_avalancheIterationVector.resize(vectorIndex + 1);
174 m_avalancheIterationVector.clear();
179 return m_avalancheIterationVector.size();
189 void avalanche(
const agx::Vec2i vertexXY, AvalancheIterationMap& avalancheMap);
205 return m_modifiedTerrainVertices;
210 return m_avalanchedTerrainVertices;
215 return m_touchedTerrainIndices;