Skip to content

Refactor: PointLightShadowRenderer reduce object allocations#2514

Merged
yaRnMcDonuts merged 3 commits into
jMonkeyEngine:masterfrom
capdevon:capdevon-PointLightShadowRenderer
Sep 7, 2025
Merged

Refactor: PointLightShadowRenderer reduce object allocations#2514
yaRnMcDonuts merged 3 commits into
jMonkeyEngine:masterfrom
capdevon:capdevon-PointLightShadowRenderer

Conversation

@capdevon

@capdevon capdevon commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

This PR refactors the PointLightShadowRenderer class to improve readability and maintainability. Key changes include:

  • Replaces repeated inline vector negations (e.g., Vector3f.UNIT_X.mult(-1f)) with clearly named constants (X_NEG, Y_NEG, Z_NEG).
  • Updates camera axis assignments in updateShadowCams() to use these new constants, reducing code duplication and potential errors.
  • Minor improvements to JavaDoc for clarity and consistency.

These changes make the codebase cleaner and easier to understand without altering any functionality.

Comment thread jme3-core/src/main/java/com/jme3/shadow/PointLightShadowRenderer.java Outdated
@richardTingle

richardTingle commented Jun 26, 2025

Copy link
Copy Markdown
Member

(Apart from the author change) looks good. Makes sense to avoid pointless negative vector allocations

@capdevon

capdevon commented Jul 11, 2025

Copy link
Copy Markdown
Contributor Author

Hi guys,
Could you tell me why there is an error in the Screenshot Test? I just restored the original name of the class author after a previous change that passed the test.

@riccardobl

Copy link
Copy Markdown
Member

Hi guys, Could you tell me why there is an error in the Screenshot Test? I just restored the original name of the class author after a previous change that passed the test.

looks like a timeout, sometime github action is a bit flaky, i've rerunned it

@codex128 codex128 added the Refactoring and Cleanup This PR is all about improving code quality and javadoc. label Aug 30, 2025
@yaRnMcDonuts yaRnMcDonuts merged commit 112ff1f into jMonkeyEngine:master Sep 7, 2025
16 of 17 checks passed
@yaRnMcDonuts yaRnMcDonuts added this to the v3.9.0 milestone Sep 8, 2025
@capdevon capdevon deleted the capdevon-PointLightShadowRenderer branch September 14, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactoring and Cleanup This PR is all about improving code quality and javadoc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants