[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I think this misses some qualities that WebGL requires or would benefit of:
- Running operations without incurring GC overhead (for instance operand1.multiply(operand2, intoTarget))
- The abiliy to use array buffers as backing store (for instance mymat = new Mat4(somearraybuffer, offset))
- Missing methods:
- Optimized inverse().transpose().copyToMat3(target) commonly used to build rotation matrices
- Building perspective and inverse perspective matrices
- Building orthographic and inverse orthographic matrices
- setting to zero
- setting to identity
- setting from quaternion
- No 2x2, 3x3 matrices, no 2-component and 3-component vectors.
If introducing points, why not introduce common methods useful for points (length, multiply, divide, add, subtract, dot, cross, normalize, max, min, etc.)?
There's also minor points in that it doesn't do chaining (for instance mymat.translate().rotatex(45)) which will trigger the more user-friendly minded developers to wrap each matrix in a JS decorator, kinda defeating the point.
Due to matrices not accepting a backing store, and not being able to target without copy, it would also make it useless for libraries such as glMatrix to use as a "backend" since glMatrix is carefully optimized to not require copying and to be able to use array buffer backing stores, and logically can't use functionality that does not support that. So any argument of "oh the missing things will be added by <insert library here>" is illusionary at this point.