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

Clarify type-specific lerp() documentation #99993

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tetrapod00
Copy link
Contributor

Addresses godotengine/godot-docs#10362.

I'm not 100% sure about this one.

For each type-specific lerp() or lerp() equivalent, except for Basis and Quaternion, add a line mentioning that weight 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 GlobalScope lerp() as well.

Clarifies that `lerp()` can be used for interpolation or extrapolation.
Links to the GlobalScope `lerp()` docs.
@tetrapod00 tetrapod00 added this to the 4.x milestone Dec 3, 2024
@tetrapod00 tetrapod00 requested a review from a team as a code owner December 3, 2024 23:22
@@ -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].
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Contributor

@Mickeon Mickeon Dec 3, 2024

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.

Copy link
Contributor Author

@tetrapod00 tetrapod00 Dec 4, 2024

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.

Suggested change
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

Suggested change
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].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants