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

Keep the camera position when switching to inspector (fix #607) #717

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

vincentfretin
Copy link
Contributor

Keep the camera position and rotation when opening the inspector.

I have this change for quite some times in my project. When I use the default inspector build in other projects I am so frustrated that the camera position is not kept while opening the inspector.
It seems I am not the only one that wanted this behavior.

This closes #607

@vincentfretin vincentfretin marked this pull request as draft May 23, 2024 09:28
@vincentfretin
Copy link
Contributor Author

But it should be an option somehow. I want that behavior when I am on a scene and I open the inspector.
But I don't want that behavior when opening directly the inspector and want the perspective camera to be at the specified position

perspectiveCamera.position.set(0, 1.6, 2);
perspectiveCamera.lookAt(new THREE.Vector3(0, 1.6, -1));

Those positions should also be configurable, with the ortho cameras as well. I'm writing some configurators where I want different camera positions.

@vincentfretin vincentfretin marked this pull request as ready for review February 7, 2025 14:36
…e behavior of keeping the camera position in sync
@vincentfretin
Copy link
Contributor Author

I made the new behavior of keeping the inspector perspective camera position in sync with the A-Frame active camera the default, with the ability to disable that behavior with a window.AFRAME_INSPECTOR_CONFIG variable.

@dmarcos dmarcos merged commit 5700c61 into aframevr:master Feb 7, 2025
1 check passed
@vincentfretin vincentfretin deleted the keep-camera-position branch February 7, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be able to look through the cameras in the scene
2 participants