-
Notifications
You must be signed in to change notification settings - Fork 51
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
Camera Options & Context Menu #1079
base: dev
Are you sure you want to change the base?
Conversation
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.
This is super cool! Love the context menu.
- Zooming in seems to zoom in the whole screen => MainHUD/Scoreboard out of view and field blurry rather than controlling scene cam. Note: browser is still on normal zoom seeing this.
- Moving a MirabufSceneObject while camera is focused on it causes fun jumps that are more difficult to control. Temporarily unfocus?
- Second time you move a MirabufSceneObject, the Move gizmo starts based on the last move rather than the current position. For the most part this can be worked around, but it would be nice to not have to go to the other side of the field
- Could you make an option to lock heading/yaw follow without pitch and roll following? Or just make lock heading only to begin with
I have no idea what's happening there and I haven't ever seen it before. Could you give steps to reproduce it?
An unfocus would probably be a good idea, tho a better fix will probably be needed later down the line.
This is a fundamental issue with how the transform gizmos are done. This may have to become it's own PR.
This runs into a lot of issues. The more the robot isn't upright, the more unreliable doing something like this becomes. |
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.
Could you add rotation to the move gizmo in case robots tip over?
On my work laptop, normal zoom: put two fingers down and moved the second outward. Happened every time I zoomed in, but never on zoom out. Happy to hop on call to show you. Everything else sounds good. |
Going to wait on @Dhruv-0-Arora 's transform gizmos fix for that. |
@a-crowell Where are you placing your fingers? Are they over any of the UI elements? |
Could you make it so when you add/edit either a scoring zone, intake, or ejector, the camera follows the transform gizmo like in v6? I believe the camera stayed still while dragging the gizmo, then snapped to it when the mouse was released. |
They're not over any UI, just the floor mesh or blank space surrounding. Want to hop on call so I can show you? |
@HunterBarclay for the solution, see // Disable gesture inputs on track pad to zoom into UI
window.addEventListener(
"wheel",
function (e) {
if (e.ctrlKey) {
e.preventDefault() // Prevent the zoom
}
},
{ passive: false }
) |
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.
synthesis/fission/src/systems/input/InputSystem.ts
Lines 167 to 177 in 3557819
// Disable gesture inputs on track pad to zoom into UI | |
window.addEventListener( | |
"wheel", | |
function (e) { | |
if (e.ctrlKey) { | |
e.preventDefault() // Prevent the zoom | |
} | |
}, | |
{ passive: false } | |
) | |
} |
👀
2b8ef0b
to
c859528
Compare
@LucaHaverty @a-crowell Added the fix, haven't tested it yet tho. Make sure you |
@HunterBarclay I'm unable to zoom at all now. It looks like with your custom camera, blocking the scroll wheel default blocks the camera inputs, but the threejs camera does something different that's not affected. Does it work with a mouse? |
When opening the context menu:
|
c859528
to
974f125
Compare
…king works as expected. Slowly implementing customization panle
…tions for mobile testing
795c00b
to
1c70994
Compare
for mobile, added keys to context menu react components.
Description
In order to add the context menu and camera options I wanted, I had to rewrite the entire Camera Controller from the ground up. Good news, we now have an avenue towards mobile touch controls.
Camera
Made a custom orbit camera controller. This controller can be provided a MirabufSceneObject which will act as a provider for dictating what the camera follows around in the scene. You now also have the option to lock the camera orientation to that of the assembly you are following. Left-click to orbit, Right-click to pan.
On mobile, the first touch is for orbiting. If a second touch is detected, it will measure the change in distance between the two touches to determine zoom. Currently Firefox on mobile has something wrong with the movement data it gives, but other than that, it has been working pretty consistently.
Context Menu
If you Right-click, but don't move the mouse by a given threshold, it will instead open a context menu, depending on what you clicked on. Right now, MirabufSceneObject have support for the context menu, supplying options for camera options, scheme changing, and removing the assembly from the scene. If nothing is detected as being clicked on, it will populate with default scene options. Currently this only includes adding assemblies to the scene.
SSL
To test on other devices with the dev server. I have a boolean in
vite.config.ts
to enable/disable ssl. This will allow you to easily connect to the server AND have OPFS support for the caching system.TODO