Dcumentation bugs Mat4

some small problems on the Mat4 documentation:

https://api.playcanvas.com/classes/Engine.Mat4.html#transformPoint as well as
https://api.playcanvas.com/classes/Engine.Mat4.html#transformVector should state that they only yield correct results if the matrix represents an affine transformation and that for general matrices https://api.playcanvas.com/classes/Engine.Mat4.html#transformVec4 should be used (alternatively, the implementation of transformPoint and transformVector should be fixed to calculate and divide by w component)

https://api.playcanvas.com/classes/Engine.Mat4.html#data should probably state that the data layout is column-major (or at least that all the convenience functions assume column-major layout)

https://api.playcanvas.com/classes/Engine.Mat4.html#mulAffine2
here the description is incorrect
β€œβ€¦, and the bottom left 3 elements are translation. The rightmost column is assumed to be [0, 0, 0, 1]” should instead read β€œβ€¦, and the top right 3 elements are translation. The bottommost row is assumed to be [0, 0, 0, 1]”

1 Like

Many thanks @mabu!

Care to add an issue or even better a PR on the docs repo? It’s open source and very much welcomes all contributions.

1 Like