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

Camera clipping #1217

Merged
merged 1 commit into from
Jan 11, 2025
Merged

Camera clipping #1217

merged 1 commit into from
Jan 11, 2025

Conversation

HifiExperiments
Copy link
Member

@HifiExperiments HifiExperiments commented Nov 1, 2024

Closes #299

this adds an optional (single, for now) ray pick to the 3rd person (and selfie cam) camera to make sure the camera doesn't clip through entities

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo
NGI Zero Logo

@HifiExperiments HifiExperiments added needs CR This pull request needs to be code reviewed needs QA This pull request needs to be tested NLnet labels Nov 1, 2024
_maxOctreePPS(_maxOctreePacketsPerSecond.get()),
// Camera
_fieldOfView("fieldOfView", DEFAULT_FIELD_OF_VIEW_DEGREES),
_cameraClippingEnabled("cameraClippingEnabled", false)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the option defaults to false currently, but I can change that if we want

@Armored-Dragon
Copy link
Member

Avatar entities seem to also cause the camera to clip. This makes it to where clothing causes the camera to clip in some situations. This might not be ideal.

@HifiExperiments
Copy link
Member Author

Avatar entities seem to also cause the camera to clip. This makes it to where clothing causes the camera to clip in some situations. This might not be ideal.

great point, I changed it to only clip against domain and local entities, not avatar entities

@ksuprynowicz
Copy link
Member

I just tested it and it desktop mode clipping works pretty well. The problems I noticed is that it clips with local entities created by Create App, like for example zone icons. Also small entities cause clipping, making the camera move too much so maybe it would be good to ignore entities below certain size relative to avatar size?
It doesn't work in VR but maybe that's ok because it could cause motion sickness there?

@HifiExperiments
Copy link
Member Author

hm good points. the picking system doesn’t currently allow specifying sizes like that, but maybe it’s something we could add in the future?

as for local entities, I thought there would be more cases where we would want to collide with local entities. made clipping should just be disabled completely in create mode though?

@Armored-Dragon
Copy link
Member

I would think we would want to clip with local entities too. We can probably just force Create App to disable camera clipping when the create app window is opened and return it to the previous setting when it closes.

@ksuprynowicz
Copy link
Member

as for local entities, I thought there would be more cases where we would want to collide with local entities. made clipping should just be disabled completely in create mode though?

I think it's indeed best choice currently. When Create App is not open the current version works really well, and is a massive ux improvement in my opinion.
IMO as soon as Create App can temporarily disable it it would be ready for review and merging.

@Krzeszny
Copy link

I wanted to test it but where can I activate the function?

@HifiExperiments
Copy link
Member Author

@Krzeszny if I remember correctly, one place you can toggle it is the Graphics settings

@HifiExperiments
Copy link
Member Author

I've updated this to turn off while in Create mode, and return to the saved state when you exit Create.

however, since it depends on #939, it'll have to wait until that one is merged

@ksuprynowicz
Copy link
Member

I just tested the newest version, and it works perfectly with Create App now :)
I will review it as soon as Application.cpp refactor is merged, and then we can merge it.

@ksuprynowicz ksuprynowicz added QA approved This pull request has been successfully tested and removed needs QA This pull request needs to be tested labels Jan 5, 2025
@HifiExperiments
Copy link
Member Author

since the application PR needs more work, I've separated this out so it's good for review now

@HifiExperiments HifiExperiments changed the title (DNM) Camera clipping Camera clipping Jan 10, 2025
@ksuprynowicz
Copy link
Member

I tested it, works perfectly now :)

@ksuprynowicz ksuprynowicz merged commit 127458a into overte-org:master Jan 11, 2025
4 checks passed
@HifiExperiments HifiExperiments deleted the cameraClip branch January 12, 2025 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs CR This pull request needs to be code reviewed NLnet QA approved This pull request has been successfully tested
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add raycast query to third person camera mode
4 participants