-
Notifications
You must be signed in to change notification settings - Fork 5
Visual Improvements to Maps3D demo #5
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
Open
medbensalah
wants to merge
15
commits into
develop
Choose a base branch
from
MBS/Maps3D
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
695364d
Change initial globe size
medbensalah 740e393
fix: Menu3D visuals are offset
medbensalah 1451765
Change camera Start position
medbensalah 63a8da5
feat: Add text to explain Maps3D controls
medbensalah 8d1e678
fix: Room shows up when leaving Maps3D in AR mode
medbensalah b535e5d
fix: Room hitscanable whe invisible
medbensalah 5c1434d
feat: Make info panel visibnle only in XR
medbensalah 3335039
made the earth closer
medbensalah 36f09e8
fix: remove duplicate line after rebase
medbensalah 715336d
fix: Room environment no longer appears in AR mode
medbensalah 23d01d6
Fix type
avdynut de89e06
Clean up
avdynut 102730c
remove shadows from Maps3D + fix room visibility
medbensalah 602e156
Fix room visibility
avdynut f725a7c
fix: Remove shadow from Maps3D
medbensalah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-3.5 MB
(15%)
src/XRSharpSamplesGallery/XRSharpSamplesGallery/Menu/Thumbnails/Maps3D.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 55 additions & 1 deletion
56
src/XRSharpSamplesGallery/XRSharpSamplesGallery/Samples/Maps3D/Maps3D.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,69 @@ | ||
using System; | ||
// filepath: d:\userware\XRSharpSamplesGallery\src\XRSharpSamplesGallery\XRSharpSamplesGallery\Samples\Maps3D\Maps3D.xaml.cs | ||
using System; | ||
using System.Windows; | ||
using XRSharp; | ||
using XRSharp.Components; | ||
using XRSharp.Controls; | ||
using XRSharp.Controls.Extras; | ||
using XRSharp.Core; | ||
|
||
namespace XRSharpSamplesGallery.Samples | ||
{ | ||
public partial class Maps3D : UserControl3D | ||
{ | ||
private Grid3D _infoPanel; | ||
private Root3D _root; | ||
|
||
public Maps3D() | ||
{ | ||
InitializeComponent(); | ||
|
||
// Find the root element to subscribe to XR events | ||
_root = Root3D.Current; | ||
|
||
// Get the info panel reference | ||
_infoPanel = this.FindName("infoPanel") as Grid3D; | ||
|
||
// Hide info panel by default (not in XR mode initially) | ||
if (_infoPanel != null) | ||
{ | ||
_infoPanel.Visibility = Visibility.Collapsed; | ||
} | ||
|
||
// Subscribe to XR events | ||
if (_root != null) | ||
{ | ||
_root.EnterXR += OnEnterXR; | ||
_root.ExitXR += OnExitXR; | ||
} | ||
} | ||
|
||
private void OnEnterXR(object sender, EventArgs e) | ||
{ | ||
// Show the info panel when entering XR mode | ||
if (_infoPanel != null) | ||
{ | ||
_infoPanel.Visibility = Visibility.Visible; | ||
} | ||
} | ||
|
||
private void OnExitXR(object sender, EventArgs e) | ||
{ | ||
// Hide the info panel when exiting XR mode | ||
if (_infoPanel != null) | ||
{ | ||
_infoPanel.Visibility = Visibility.Collapsed; | ||
} | ||
} | ||
|
||
private void OnUnloaded(object sender, EventArgs e) | ||
{ | ||
// Clean up event handlers when control is unloaded | ||
if (_root != null) | ||
{ | ||
_root.EnterXR -= OnEnterXR; | ||
_root.ExitXR -= OnExitXR; | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OnUnloaded event handler is defined but not wired to the control's Unloaded event; consider subscribing to it to ensure proper cleanup of event handlers.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@medbensalah could you check if it can be removed, or better to subscribe to Unloaded event