These classes are supposed to store the original setting values,
so doubles are more appropriate as they won't slightly change
eg when round-tripping through qgis project XML.
(The actual 3d material classes still use floats, this is just
for the settings classes)
This introduces a new class QgsGeoTransform (derived from QTransform)
that keeps chunk's translation vector as a QgsVector3D (i.e. in double
coordinates) and if there is a shift of the origin, 3D map scene and
chunk entities react to it by adjusting the underlying QTransform.
The number of available clip planes depends on the OpenGL
implementation.
This change Introduces a new function in Qgs3DUtils function called
`Qgs3DUtils::getOpenGLMaxClipPlanes` to compute this
number (`GL_MAX_CLIP_PLANES`) and use it in the 3D scene.
See: https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glClipPlane.xml
This adds two functions to setup clip planes on a 3d scene:
- enableClipping() to enable opengl clipping
- disableClipping() to disable opengl clipping
The `enableClipping()` function achieves 3 things:
- it stores the clipping plane equations
- it adds clip planes to the framegraph
- it enables the clipping on the material of the existing entities
`disableClipping()` does the opposite things.
The clip planes equations need to be stored to handle the dynamic
addition of new entities. Indeed, when a new entity is added, clipping
needs to be enabled on its material if necessary. This is achieved
in `finalizeNewEntity` which is called on all new entities.
However, this is not true for the terrain entity. That's why,
`mTerrain` now listens to the `newEntityCreated` signal to call
`handleClippingOnEntity()`.
The module patching for _3d was not working at all, because
the same logic which works for other modules with a private _module
copy clashed with the approach of exposing the public 3d module
as qgis._3d
Work around this by renaming the private internal module as _3d_p,
so that the monkey patching logic from sip is correctly run
when the module is loaded.
Fixes broken API in 3d module for renamed enums, and fixes the
broken PyQGIS doc for the 3d module