Skip to content

Conversation

@kkolyan
Copy link
Contributor

@kkolyan kkolyan commented May 27, 2020

I've caught unpredictable behavior, when tried to use Camera.contains, then checked javadoc and found the reason why.
But javadoc is a bit outdated. This PR updates javadoc according observable behavior.

Old javadoc:
image

New javadoc:
image

Discussion: https://hub.jmonkeyengine.org/t/camera-contains-javadoc-outdated/43320

@pspeed42
Copy link
Contributor

The check plane is a small optimization. It's used to make sure that whatever plane caused the BV to be outside last time is checked first the next time. All of the planes will still be checked if the object passes that check. So your added code is not necessary.

The only case where it would be of any benefit at all (and even then only a little) is if an application is constantly checking the BV of all of the spatials against a different camera every frame. And an app like that probably already has a hundred worse performance problems than missing this small optimization.

@kkolyan kkolyan force-pushed the camera_contains_javadoc_updated branch from b1736a0 to 51233cb Compare May 27, 2020 15:14
@kkolyan kkolyan force-pushed the camera_contains_javadoc_updated branch from 51233cb to 980f99f Compare May 27, 2020 15:16
@kkolyan
Copy link
Contributor Author

kkolyan commented May 27, 2020

Thanks for explanation. I removed lines with checkPlane.

@stephengold
Copy link
Member

Is this ready to be integrated?

@pspeed42
Copy link
Contributor

pspeed42 commented Jun 5, 2020

Seems like it.

@stephengold stephengold merged commit eb7aab9 into jMonkeyEngine:master Jun 5, 2020
@stephengold stephengold added this to the v3.4.0 milestone Mar 13, 2021
@stephengold stephengold added the Documentation Issues that affect the Wiki, Javadoc or any other form of documentation label Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Issues that affect the Wiki, Javadoc or any other form of documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants