Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Improve documentation relating to
Frustum
andHalfSpace
#9136Improve documentation relating to
Frustum
andHalfSpace
#9136Changes from 6 commits
c9bcff3
d3d39f4
0377c42
3c948cb
a291534
10751c1
9714243
dee7a95
19c3c8c
936a912
4d506ca
aeaef2d
1a3e4f0
c425511
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This probably needs to mention
Handle<Mesh>
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 isn't applied only to
Handle<Mesh>
, people can find what it applies to if they follow the doc ofCalculateBounds
, but maybe I can add a "for example" section?Edit: Mentionned it here:
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.
This sentence is convoluted because it tries to define the AABB as two different things:
I'd suggest to keeping to (1) as definition, and mentioning "this is also used as" in a subsequent sentence (or maybe remove it, you describe (2) already in the rest of this paragraph.
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.
Adressed by: 936a912
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.
nit: "in a process called frustum culling" Here feels dissociated from the rest of the sentence. You probably need to start a sentence, using it a subject, in order to make the sentence coherent.
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 is used as a component on an entity during "frustum culling", a process to determine if the entity should be rendered [...]
?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.
Unless this is describe in
NoFrustrumCulling
it could be nice to specify what a "entity that could be subject to frustum culling" 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.
It isn't but I'm not sure myself why would you want to opt out of it actually.
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.
See #4971. Also in situations related to global lighting/reflection
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.
This is because in animation the Mesh's vertices positions are updated, but the Aabb is not, right?
Lighting/reflection is for when you have a Mesh with a reflective material and you want to see something in it that is out of frustum, right?
I'm trying to write meaningful examples, I have this:
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.
This is confusing. Here is a suggestion: "Currently, bevy doesn't update AABB based on changes to the
Mesh
pointed to by the handle."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 can add that in a "for example" section after (I think it's a good idea), but Aabb don't apply only to
Handle<Mesh>
.Edit: added this:
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 don't think these are necessary.
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.
To me, it would make more sense intuitively that the distance would be from the origin to the plane along the normal (so the opposite of what it is) so I wanted to put the emphasis on that.
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 don't like how "normal" is used here. It should be "plane going through the origin with given normal" or something along those lines.
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 plane doesn't (necessarilly, if the distance is not 0.) go through the origin? I don't understand sorry.
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'm struggling to understand this paragraph as well.
It's not clear what "the length of the projection of p on the normal" is referring to (what type of object is the normal? How is it constructed?) and I don't understand what the "opposite of the distance" means.
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.
among other things
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.
Is it used for something else in Bevy? I didn't want to imply it's the only usage, I just wanted to say it's only used for that in Bevy.
Edit: it is used for lights also, right?
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.
Changed to
It is used to define a [Frustum], and for light computation.
in dee7a95Is that okay?
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.
Same as aabb, those are general types and component, doc shouldn't restrict how they are used.
I'm not sure I see the point of documenting that here anyway. being able to go from the frustrum doc to the half space is interesting, not the reverse in my opinion
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 good to have a concrete example of what it is used for instead of just having it and not knowing how it can be used or fits in Bevy.
I don't really see how my sentence implies it can't be used for something else? I can add "for example", or "among other things" (which feels a bit like lying because in official Bevy it's not), at the end?
Edit: added "for example".
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.
nit: (I know it is pre-existing text) the "helps determine" is complex, could the sentence be simplified?
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.
Honestly I would kinda be in favor of removing that sentence completely, it's already explained in the
HalfSpace
doc and you can do nothing with the distance alone anyway you need the normal for the formula, if this formula should be copied somewhere I would argue it should be innormal_d
.This sentence was written for
Plane
to know on which side of the plane we are.Edit: I just removed it.
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 kinda piles up math jargon on top and I don't think it helps much.
I prefer "pyramid without the top" personally
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 can be a cuboid for orthogonal projection, or I guess technically it could have less than six sides or extend to infinity.
But I did say "Usually" and a Cuboid is a special case of truncated pyramid I guess.
According to wikipedia, the real name of the truncated pyramid is either "Quadrilateral frustum" (which doesn't help much here) or "apex-truncated square pyramid" which I think works? Are you okay with the last one?
Edit: changed to
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 sentence would benefit from being split in two, such as the updating can be explained in isolation from the adding.
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.
My French brain struggles to make short sentences 😄 (I agree)
Edit: changed to:
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 find sentences in the present participle (-ing) are much more difficult to parse than in the simple present. I'd suggest avoiding (I know) them. Ideally avoid indirection in your sentences, it helps clarity; Much like in programming languages.
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.
Changed the sentence bellow to keep the information that it's a system:
Used in system set
->This system is used [...]
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.
at least remove "of an entity" here. Components are necessarily part of an entity, it's redundant. Also, if split into two paragraphs, it will be much easier to read. Though I'm not sure the second paragraph is necessary, since it doesn't provide much more information than the type signature of the function.
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.
Maybe I should still mention
Camera
, orCamera3dBundle
/Camera2dBundle
, to add context?I guess the context is in the doc of
Frustum
andCameraProjection
already.