4 ms·
V3 = M1.multiply(V1).add(V2); // and even worse V4 = V1.add(M1.multiply(V2)); ...I don't code in JS often, but am I missing why you wouldn't just use t
by jdc 15y ago
V3 = M1.multiply(V1).add(V2);
// and even worse
V4 = V1.add(M1.multiply(V2));
...I don't code in JS often, but am I missing why you wouldn't just use this?:
V3 = M1 * V1 + V2;
V4 = V1 + M1 * M2;
- teamonkey 15y agoV1,V2,V3 are vectors. M1,M2 are matrices. Javascript doesn't have built-in matrix math.
- fridek 15y agoAnd there is no operator overloading, so you have to go with prefix notation. It's not that bad unless you want to write something like GJK collision detection. I actually do, so you see why it annoys me so much.