-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add lerp to Math #426
Comments
This comment was originally written by [email protected] Removed Type-Defect label. |
This comment was originally written by [email protected] i'm not sure what the libraries stance on validation is, but this method might want to: assert(t >= 0 && t <= 1); |
This comment was originally written by [email protected] I'd prefer something more webgl glsl'y. So mix instead of lerp? num mix(num min, num max, double a) Float32x4 mix(Float32x4 min, Float32x4 max, double a) Maybe a few others? double smoothstep(num edge0, num edge1, double val) Float32x4 smoothstep(Float32x4 edge0, Float32x4 edge1, double val) not necessarily sure these should be in math as clamp and mod live on the datatypes Float32x4 and num (though there is no mod on Float32x4) |
I think these fit better in a WebGl package. Potentially with other 3D primitives (like tools to work with Quaternions, ...). Added NotPlanned label. |
This issue was originally filed by [email protected]
Implementation something like
double lerp(double t, num min, num max) {
return min + t * (max - min);
}
The text was updated successfully, but these errors were encountered: