Skip to content
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

[Merged by Bors] - add default direction to DirectionalLight docs #5188

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/bevy_pbr/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ impl Default for PointLightShadowMap {
/// approximation for light sources VERY far away, like the sun or
/// the moon.
///
/// The light's default direction is negative-Z (0, 0, -1) and is
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// The light's default direction is negative-Z (0, 0, -1) and is
/// The light shines in the forward direction of the transform (negative z) and is

It's true that that is the default direction, but I think it's better to explain why that is the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@devil-ira Can you clarify this statement? Why it's negative-Z or what it has a default direction?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's important to explain "how is the direction inferred from the transform", and then tie that back to the default transform value.

/// adjusted by the GlobalTransform.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// adjusted by the GlobalTransform.
/// adjusted by the [`GlobalTransform`] of the entity that has this component.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather remove the mention of GlobalTransform as it may make people think they should edit it instead of Transform.

///
/// Valid values for `illuminance` are:
///
/// | Illuminance (lux) | Surfaces illuminated by |
Expand Down