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

Removing Collider-Based visibility scheme option #1231

Merged
merged 11 commits into from
Aug 21, 2024

Conversation

winthos
Copy link
Collaborator

@winthos winthos commented Aug 12, 2024

Removes all references and use of the collider based visibility scheme used to query sim objects from cameras. Moving forward this scheme will not be supported, and all visibility checks will now be completely distance-based from the camera (ie: objects will only be potentially visible if they are within maxVisibleDistance from the camera based purely by raycast distance)

Additionally, updating the function to query objects from a camera to be called GetVisibleObjectsFromCamera since the old name GetVisibleObjects was too easily confused with other object-visibility helper functions. The oldGetVisibleObjects action will remain but will have a deprecation warning message thrown for those who may still use it.

Finally, added unit tests forGetVisibleObjectsFromCamera

winthos added 5 commits August 9, 2024 16:36
this commit removes all references and use of the collider based visibility scheme used to query sim objects from cameras. Moving forward this scheme will not be supported, and all visibility checks will now be completely distance-based from the camera (ie: objects will only be potentially visible if they are within maxVisibleDistance from the camera based purely by raycast distance)

Additionally, updating the function to query objects from a camera to be called `GetVisibleObjectsFromCamera` since the old name `GetVisibleObjects` was too easily confused with other object-visibility helper functions. The old`GetVisibleObjects` action will remain but will have a deprecation warning message thrown for those who may still use it.

Finally, added unit tests for`GetVisibleObjectsFromCamera`
@AlvaroHG
Copy link
Collaborator

Ok one request, can you throw an exception on AgentManger.cs Initialize explicitly saying Deprecated parametar 'collider' for visibility, only ... supported so that it clear.

LGTM after that

Copy link
Collaborator

@elimvb elimvb left a comment

Choose a reason for hiding this comment

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

Pretty solid. Just a few minor changes.

unity/Assets/Scripts/BaseFPSAgentController.cs Outdated Show resolved Hide resolved
unity/Assets/Scripts/BaseFPSAgentController.cs Outdated Show resolved Hide resolved
... to ensure an error is thrown because the local visibilityScheme value is set to the only valid enum at initialization now

also adding a main camera unit test in GetVisibleObjectsFromCamera as previously only the created ThirdPartyCamera was being tested for expected returns
@winthos winthos requested a review from Lucaweihs August 21, 2024 20:04
@winthos winthos merged commit b648af0 into main Aug 21, 2024
8 checks passed
@winthos winthos deleted the remove-collider-vis-scheme branch August 21, 2024 21:43
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.

4 participants