84void QQuick3DInfiniteGrid::setGridInterval(
float newGridInterval)
86 if (qFuzzyCompare(m_gridInterval, newGridInterval))
88 m_gridInterval = newGridInterval;
89 emit gridIntervalChanged();
90 if (m_sceneEnv && !qFuzzyIsNull(m_gridInterval))
91 m_sceneEnv->setGridScale(0.1 / m_gridInterval);
94void QQuick3DInfiniteGrid::componentComplete()
96 m_componentComplete =
true;
98 QQuick3DSceneEnvironment *sceneEnv =
nullptr;
99 while (p && !sceneEnv) {
100 sceneEnv = qobject_cast<QQuick3DSceneEnvironment *>(p);
104 m_sceneEnv = sceneEnv;
105 Q_ASSERT(m_sceneEnv);
106 m_sceneEnv->setGridEnabled(m_visible);
107 if (!qFuzzyIsNull(m_gridInterval))
108 m_sceneEnv->setGridScale(0.1 / m_gridInterval);
111 qWarning(
"InfiniteGrid needs to be a child of SceneEnvironment.");