(camera)
| 169 | } |
| 170 | |
| 171 | function getViewMatrix(camera) { |
| 172 | const R = camera.rotation.flat(); |
| 173 | const t = camera.position; |
| 174 | const camToWorld = [ |
| 175 | [R[0], R[1], R[2], 0], |
| 176 | [R[3], R[4], R[5], 0], |
| 177 | [R[6], R[7], R[8], 0], |
| 178 | [ |
| 179 | -t[0] * R[0] - t[1] * R[3] - t[2] * R[6], |
| 180 | -t[0] * R[1] - t[1] * R[4] - t[2] * R[7], |
| 181 | -t[0] * R[2] - t[1] * R[5] - t[2] * R[8], |
| 182 | 1, |
| 183 | ], |
| 184 | ].flat(); |
| 185 | return camToWorld; |
| 186 | } |
| 187 | // function translate4(a, x, y, z) { |
| 188 | // return [ |
| 189 | // ...a.slice(0, 12), |
no outgoing calls
no test coverage detected