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