Skip to content

docs: clarify spotlight cone angles are half-angles#8665

Merged
willeastcott merged 3 commits into
mainfrom
docs/spotlight-cone-angle-halfangle
May 2, 2026
Merged

docs: clarify spotlight cone angles are half-angles#8665
willeastcott merged 3 commits into
mainfrom
docs/spotlight-cone-angle-halfangle

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

Summary

  • Clarifies in the LightComponent.innerConeAngle / LightComponent.outerConeAngle JSDoc that these are half-angles (measured from the light's direction axis to the cone edge), and calls out the resulting full beam angle.
  • No runtime behavior change — documentation only.

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 setting outerConeAngle = 45 gets a 90° cone, not a 45° one. The default 45 compounds 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:

/**
 * Sets the angle at which the spotlight cone has faded to nothing. The angle is specified in
 * degrees. Affects spot lights only. Defaults to 45.
 *
 * @type {number}
 */
set outerConeAngle(arg) { ... }

After:

/**
 * Sets the half-angle (measured in degrees from the light's direction axis to the cone edge)
 * at which the spotlight cone has faded to nothing. The full outer beam angle is twice this
 * value. Affects spot lights only. Defaults to 45 (i.e. a 90 degree full outer beam).
 *
 * @type {number}
 */
set outerConeAngle(arg) { ... }

innerConeAngle gets the equivalent treatment (half-angle, full inner beam callout, default 40 → 80° full inner beam).

Test plan

  • npm run lint clean
  • Docs-only change; no runtime tests needed.

`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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 innerConeAngle setter/getter JSDoc to describe half-angle semantics and the derived full inner beam angle.
  • Update outerConeAngle setter/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.

Comment thread src/framework/components/light/component.js Outdated
Comment thread src/framework/components/light/component.js Outdated
willeastcott and others added 2 commits May 2, 2026 17:39
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>
@willeastcott willeastcott merged commit 8ddbd25 into main May 2, 2026
6 of 8 checks passed
@willeastcott willeastcott deleted the docs/spotlight-cone-angle-halfangle branch May 2, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants