Skip to content

WireFrustum: javadoc + add makeGeometry(Camera) method #2480

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

capdevon
Copy link
Contributor

@capdevon capdevon commented Jun 6, 2025

These changes focus on improving the readability, robustness, and maintainability of the WireFrustum class.

  1. Comprehensive Javadoc Documentation
    Extensive Javadoc comments were added to the class, constructors, and all methods. This significantly enhances code understanding and future maintainability.

  2. Robust Input Validation
    Implemented explicit checks in the WireFrustum constructor and the update method to ensure that the points array is never null and always contains exactly 8 Vector3f objects. This prevents common runtime errors such as NullPointerException and IndexOutOfBoundsException, making the class more reliable.

  3. Minor Code Refinements
    Small adjustments were made to the update method to explicitly clear the existing FloatBuffer before writing new data, enhancing clarity in buffer handling.

New Utility Method: makeGeometry(Camera camera) for Debugging.
A dedicated static method, makeGeometry, was added. This method specifically generates a Geometry object representing the wireframe viewing frustum of any given camera. This is an invaluable tool for debugging and visualizing the camera's exact viewing volume within the 3D scene, which helps in understanding culling, shadow calculations, and general scene setup.

@yaRnMcDonuts yaRnMcDonuts added this to the v3.9.0 milestone Jun 7, 2025
@yaRnMcDonuts
Copy link
Member

Looks good to me, I'll merge this PR (as well as a few other of your PRs from last week that I've also already marked approved) in the next day or 2.

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.

2 participants