Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for outline issue in wasm #127

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions rmf_site_editor/src/interaction/outline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,20 @@ impl OutlineVisualization {
}
}

// A strange issue is causing outlines to diverge at certain camera angles
// for objects that use the Flat depth. The issue doesn't seem to happen
// for objects with Real depth, so we are switching most objects to use the
// Real outline setting. However, I don't think this looks good for certain
// types of objects so we will keep the Flat setting for them and accept
// that certain camera angles can make their outline look strange.
//
// The relevant upstream issue is being tracked here: https://github.com/komadori/bevy_mod_outline/issues/14
// Flat outlines look better but are subject to glitches in wasm, use a feature flag to use
// Real outline depth in wasm and flat in other platforms.
// Tracking issue here https://github.com/komadori/bevy_mod_outline/issues/19
// TODO(luca) revisit once issue is solved
pub fn depth(&self) -> SetOutlineDepth {
SetOutlineDepth::Flat {
model_origin: Vec3::ZERO,
#[cfg(target_arch = "wasm32")]
{
SetOutlineDepth::Real
}
#[cfg(not(target_arch = "wasm32"))]
{
SetOutlineDepth::Flat {
model_origin: Vec3::ZERO,
}
}
}

Expand Down