Skip to content

Commit

Permalink
don't try to load sub indexes when using initial camera pos
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Oct 19, 2023
1 parent 7c014e6 commit 339cc72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/3d/qgsvirtualpointcloudentity_p.cpp
Expand Up @@ -115,7 +115,10 @@ void QgsVirtualPointCloudEntity::handleSceneUpdate( const SceneState &state )
const float distance = bbox.distanceFromPoint( state.cameraPos );
const float sse = Qgs3DUtils::screenSpaceError( epsilon, distance, state.screenSizePx, state.cameraFov );
constexpr float THRESHOLD = .2;
const bool displayAsBbox = sse < THRESHOLD;

// always display as bbox for the initial temporary camera pos (0, 0, 0)
// then once the camera changes we display as bbox depending on screen space error
const bool displayAsBbox = state.cameraPos.isNull() || sse < THRESHOLD;
if ( !displayAsBbox && !subIndexes.at( i ).index() )
provider()->loadSubIndex( i );

Expand Down

0 comments on commit 339cc72

Please sign in to comment.