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

[4.0] Adding Lerp function in the math helper #895

Merged
merged 4 commits into from
Apr 15, 2019
Merged

[4.0] Adding Lerp function in the math helper #895

merged 4 commits into from
Apr 15, 2019

Conversation

Pandav0x
Copy link
Contributor

@Pandav0x Pandav0x commented Apr 13, 2019

Purpose of this PR

This PR aims to add the linear interpolation (LERP) function in the MathHelper class. (Closes #892)

Testing status

Tests haven't been written yet.

@Perksey
Copy link
Contributor

Perksey commented Apr 13, 2019

Also you don't need to write tests at this stage.

@Pandav0x
Copy link
Contributor Author

Should I add an ArgumentOutOfRangeException if t is less than 0 or greater than 1 ?

@Perksey
Copy link
Contributor

Perksey commented Apr 13, 2019

That's probably best given that this is the imprecise method.

@varon
Copy link
Member

varon commented Apr 13, 2019

Just to chip in here:
Throwing an exception at runtime stops this from being a total function. It's probably better to just clamp t to [0;1].

Automatic clamping is very convenient. Unity's Mathf.Lerp function operates this way as well.

@Pandav0x
Copy link
Contributor Author

Thank you very much, I've clamped t to [0;1] instead of throwing an error.

@Perksey
Copy link
Contributor

Perksey commented Apr 14, 2019

If that's all, remove the WIP mark and I'll merge :)

@Pandav0x Pandav0x changed the title [WIP][4.0] Adding Lerp function in the math helper [4.0] Adding Lerp function in the math helper Apr 14, 2019
@Pandav0x
Copy link
Contributor Author

Thank you :)

@varon varon merged commit 635c3a5 into opentk:master Apr 15, 2019
@varon
Copy link
Member

varon commented Apr 15, 2019

Thanks @Pandav0x .

Every little bit counts. Well done, and we hope to see loads more in the future!

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

Successfully merging this pull request may close these issues.

Math Lerp function missing
3 participants