docs: clarify spotlight cone angles are half-angles#8665
Merged
Conversation
`innerConeAngle` and `outerConeAngle` on `LightComponent` are measured
from the light's direction axis to the cone edge (half-angle), not from
edge to edge across the cone. The previous wording ("the angle at which
the spotlight cone has faded to nothing") was ambiguous and easy to
misread as the full beam angle (which is the convention used in Unity,
Maya, 3ds Max, Unreal, and most DCC tools), making the default of 45
appear to describe a 45 degree cone when it actually describes a
90 degree cone.
This commit updates the JSDoc for both properties to state the
convention explicitly and call out the resulting full beam angle,
without changing any runtime behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
Clarifies the LightComponent spotlight cone angle documentation to explicitly state that innerConeAngle / outerConeAngle are half-angles, and explains the implied full beam angle to reduce user confusion without changing runtime behavior.
Changes:
- Update
innerConeAnglesetter/getter JSDoc to describe half-angle semantics and the derived full inner beam angle. - Update
outerConeAnglesetter/getter JSDoc to describe half-angle semantics and the derived full outer beam angle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LightComponent.innerConeAngle/LightComponent.outerConeAngleJSDoc that these are half-angles (measured from the light's direction axis to the cone edge), and calls out the resulting full beam angle.Motivation
The current wording ("the angle at which the spotlight cone has faded to nothing") reads naturally as the full beam angle. That's the convention every major DCC / engine uses — Unity, Maya, 3ds Max, Unreal, Blender all treat a "45° spot" as a 45° cone. PlayCanvas actually stores the half-angle (which is the natural form for the shader math and matches glTF
KHR_lights_punctual), so a user settingouterConeAngle = 45gets a 90° cone, not a 45° one. The default45compounds the confusion.This PR doesn't change the convention (behavior stability + glTF alignment make that a separate discussion) — it just stops the docs from quietly misleading readers.
Before / After
Before:
After:
innerConeAnglegets the equivalent treatment (half-angle, full inner beam callout, default40→ 80° full inner beam).Test plan
npm run lintclean