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
Implement divide functionality for Vec2, Vec3 and Vec4 classes #2942
Comments
How about if the API was like this: Vec3#mulScalar(n: number) : Vec3
Vec3#mul(vec: Vec3) : Vec3
Vec3#mul2(vec1: Vec3, vec2: Vec3) : Vec3
Vec3#divScalar(n: number) : Vec3
Vec3#div(vec: Vec3) : Vec3
Vec3#div2(vec1: Vec3, vec2: Vec3) : Vec3
Vec3#addScalar(n: number) : Vec3
Vec3#add(vec: Vec3) : Vec3
Vec3#add2(vec1: Vec3, vec2: Vec3) : Vec3
Vec3#subScalar(n: number) : Vec3
Vec3#sub(vec: Vec3) : Vec3
Vec3#sub2(vec1: Vec3, vec2: Vec3) : Vec3 And we deprecated Vec3#scale. And same for |
sounds good but not sure we need these, it's not common to do that:
Maybe we should add these:
|
Won't it become many ways of doing the same thing? For readability of code, I rarely see Devs using mul2. |
@Maksims This issue originated from here: https://forum.playcanvas.com/t/dividing-vectors/18583/6 The problem is that, for you or I, it's obvious that |
Currently we have:
We should consider similar functionality for divide operation.
The text was updated successfully, but these errors were encountered: