-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Clarify type-specific lerp()
documentation
#99993
base: master
Are you sure you want to change the base?
Conversation
Clarifies that `lerp()` can be used for interpolation or extrapolation. Links to the GlobalScope `lerp()` docs.
@@ -306,7 +306,9 @@ | |||
<param index="0" name="to" type="Color" /> | |||
<param index="1" name="weight" type="float" /> | |||
<description> | |||
Returns the linear interpolation between this color's components and [param to]'s components. The interpolation factor [param weight] should be between 0.0 and 1.0 (inclusive). See also [method @GlobalScope.lerp]. | |||
Returns the linear interpolation between this color's components and [param to]'s components. | |||
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. |
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 perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. | |
To interpolate, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Values outside this range can be used to [i]extrapolate[/i] instead. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. |
I was thinking of something like this to be more concise, but I'm open to any suggestions.
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 fine with either way. However I think the "however" and "are allowed and" may not be necessary. It still reads fine as is, though.
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 subtle, but I think "to interpolate" is better than "to perform interpolation", but "to perform extrapolation" is a little better than "to extrapolate". So I should probably leave this mostly as-is and just trim the extra words that you mentioned.
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. | |
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Values outside this range can be used to perform [i]extrapolation[/i] instead. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. |
or maybe
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. | |
To interpolate, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Values outside this range can be used to perform [i]extrapolation[/i] instead. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight]. |
Addresses godotengine/godot-docs#10362.
I'm not 100% sure about this one.
For each type-specific
lerp()
orlerp()
equivalent, except for Basis and Quaternion, add a line mentioning thatweight
can be with the range[0,1]
or not, to perform either extrapolation or interpolation. Some of these descriptions had similar information already, in which case I removed that information in favor of this new line.Each description also links to the GlobalScope
lerp()
.Because these are copypasta notes, I put them on a separate line and used generic phrasing so that it is a single string for translation (I think this works?).
The note is copied verbatim from the GlobalScope
lerp()
. Personally I think that the wording could be improved and made a bit more concise. If we do so, it should apply to all of these notes and also potentially to the GlobalScopelerp()
as well.