Skip to content

Document how directional and spot lights are aimed - #9206

Merged
mvaligursky merged 1 commit into
mainfrom
mv-light-aiming-docs
Aug 21, 2026
Merged

Document how directional and spot lights are aimed#9206
mvaligursky merged 1 commit into
mainfrom
mv-light-aiming-docs

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

The LightComponent documentation already states that directional and spot lights emit along the owner entity's negative y-axis, but nothing explains how to aim one. GraphNode#lookAt is the obvious tool to reach for and it orients an entity's negative z-axis, so it aims a camera and leaves a light pointing somewhere unrelated.

Changes:

  • The LightComponent class documentation now covers aiming: lights are aimed with the owner entity's rotation, an unrotated light shines straight down, and lookAt needs a following rotateLocal(90, 0, 0) to bring the negative y-axis onto the target. A short snippet shows all three.
  • The type setter, which already states the negative y-axis convention for directional and spot, now cross-references the class documentation for the aiming details.

Documentation only, no functional or API changes.

@github-actions

Copy link
Copy Markdown

Build size report

This PR does not change the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2371.4 KB — 609.4 KB — 473.4 KB —
playcanvas.min.mjs 2368.8 KB — 608.3 KB — 472.8 KB —

@mvaligursky mvaligursky added docs Documentation related area: graphics Graphics related issue labels Aug 21, 2026
@mvaligursky
mvaligursky merged commit fcadbb3 into main Aug 21, 2026
10 checks passed
@mvaligursky
mvaligursky deleted the mv-light-aiming-docs branch August 21, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue docs Documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant