mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
viewport: wire up the backface-culling setting
The "Backface Culling" checkbox persisted a value and reflected it, but nothing consumed AppSettings::backfaceCulling — the opaque pipeline hardcoded cullMode = Back, so toggling had no effect. Build a second opaque pipeline (cullMode None) alongside the culled one and pick between them per-frame from a backface_culling_ flag; setBackfaceCulling flips the flag and requests a redraw (no rebuild). ViewportWindow forwards it, and MainWindow applies the persisted value at startup and re-applies on change — same wiring as the nav preset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -510,6 +510,15 @@ void MainWindow::setupStatus() {
|
||||
vp->applyNavPreset(AppSettings::navPresetName(preset));
|
||||
});
|
||||
|
||||
// Backface culling: apply the persisted choice and re-apply live on change.
|
||||
if (auto* vp = viewport_widget_->viewport())
|
||||
vp->setBackfaceCulling(AppSettings::instance().backfaceCulling());
|
||||
connect(&AppSettings::instance(), &AppSettings::backfaceCullingChanged, this,
|
||||
[this](bool enabled) {
|
||||
if (auto* vp = viewport_widget_->viewport())
|
||||
vp->setBackfaceCulling(enabled);
|
||||
});
|
||||
|
||||
connect(session_state_, &bonsaiviewer::SessionState::statusMessageChanged,
|
||||
this, [this](const QString& mode, const QString& detail) {
|
||||
status_mode_label_->setText(mode);
|
||||
|
||||
Reference in New Issue
Block a user