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

Conversation

strattonbrazil
Copy link
Contributor

Objective

  • Adds a default direction to the documentation of DirectionalLight

Solution

Suggestion from Q&A answer:
#5186 (reply in thread)

@@ -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.
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.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Rendering Drawing game state to the screen labels Jul 3, 2022
@@ -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.

crates/bevy_pbr/src/light.rs Outdated Show resolved Hide resolved
@@ -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.
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
/// transform adjusts its direction.
/// transform adjusts its direction.
/// The light always points in the "forward" direction of its local rotation.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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.

@strattonbrazil
Copy link
Contributor Author

Are we good to merge this?

@alice-i-cecile
Copy link
Member

I think my suggestion should be merged in first to clarify exactly what's going on.

@strattonbrazil
Copy link
Contributor Author

@alice-i-cecile, you mean this suggestion?

The light always points in the "forward" direction of its local rotation.

That seemed redundant by the previous line:

By default, the light shines along the negative-Z axis and the local transform adjusts its direction.

@alice-i-cecile
Copy link
Member

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.

Copy link
Contributor

@superdump superdump left a comment

Choose a reason for hiding this comment

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

bors r+

bors bot pushed a commit that referenced this pull request Aug 2, 2022
# Objective

- Adds a default direction to the documentation of DirectionalLight 

## Solution

Suggestion from Q&A answer: 
#5186 (reply in thread)
@bors bors bot changed the title add default direction to DirectionalLight docs [Merged by Bors] - add default direction to DirectionalLight docs Aug 2, 2022
@bors bors bot closed this Aug 2, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# Objective

- Adds a default direction to the documentation of DirectionalLight 

## Solution

Suggestion from Q&A answer: 
bevyengine#5186 (reply in thread)
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- Adds a default direction to the documentation of DirectionalLight 

## Solution

Suggestion from Q&A answer: 
bevyengine#5186 (reply in thread)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Docs An addition or correction to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants