-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
crates/bevy_pbr/src/light.rs
Outdated
@@ -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 | |||
/// adjusted by the GlobalTransform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// adjusted by the GlobalTransform. | |
/// adjusted by the [`GlobalTransform`] of the entity that has this component. |
There was a problem hiding this comment.
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
.
crates/bevy_pbr/src/light.rs
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Robert Swain <[email protected]>
crates/bevy_pbr/src/light.rs
Outdated
@@ -92,6 +92,9 @@ impl Default for PointLightShadowMap { | |||
/// approximation for light sources VERY far away, like the sun or | |||
/// the moon. | |||
/// | |||
/// By default, the light shines along the negative-Z axis and the local | |||
/// transform adjusts its direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// transform adjusts its direction. | |
/// transform adjusts its direction. | |
/// The light always points in the "forward" direction of its local rotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with this is that people don’t always know that negative z is forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's explained above, so I think this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misread the diff in the email and thought you were replacing the text. I see now you added to it. Apologies.
Are we good to merge this? |
I think my suggestion should be merged in first to clarify exactly what's going on. |
@alice-i-cecile, you mean this suggestion?
That seemed redundant by the previous line:
|
That suggestion yes. Feel free to tweak the phrasing, but it's not clear to new users exactly "how" the local transform adjusts its direction and we should try to be more precise. |
Co-authored-by: Robert Swain <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
# Objective - Adds a default direction to the documentation of DirectionalLight ## Solution Suggestion from Q&A answer: #5186 (reply in thread)
Pull request successfully merged into main. Build succeeded: |
# Objective - Adds a default direction to the documentation of DirectionalLight ## Solution Suggestion from Q&A answer: bevyengine#5186 (reply in thread)
# Objective - Adds a default direction to the documentation of DirectionalLight ## Solution Suggestion from Q&A answer: bevyengine#5186 (reply in thread)
Objective
Solution
Suggestion from Q&A answer:
#5186 (reply in thread)