| 249 | } |
| 250 | |
| 251 | static F32 MatrixSpeed(zFlyKey keys[]) |
| 252 | { |
| 253 | F32 dot1 = iabs(xVec3Dot((xVec3*)&keys[0].matrix[0], (xVec3*)&keys[1].matrix[0])); |
| 254 | F32 dot2 = iabs(xVec3Dot((xVec3*)&keys[0].matrix[3], (xVec3*)&keys[1].matrix[3])); |
| 255 | |
| 256 | // dot1 = max(dot1, dot2) |
| 257 | if (dot2 > dot1) |
| 258 | { |
| 259 | dot1 = iabs(xVec3Dot((xVec3*)&keys[0].matrix[3], (xVec3*)&keys[1].matrix[3])); |
| 260 | } |
| 261 | |
| 262 | dot2 = iabs(xVec3Dot((xVec3*)&keys[0].matrix[6], (xVec3*)&keys[1].matrix[6])); |
| 263 | |
| 264 | // dot1 = max(dot1, dot2) |
| 265 | if (dot2 > dot1) |
| 266 | { |
| 267 | dot1 = iabs(xVec3Dot((xVec3*)&keys[0].matrix[6], (xVec3*)&keys[1].matrix[6])); |
| 268 | } |
| 269 | |
| 270 | // m = max(1.0, dot1) |
| 271 | F32 m = 1.0f < dot1 ? 1.0f : dot1; |
| 272 | return xacos(m) * 114.59155f * 30.0f; |
| 273 | } |
| 274 | |
| 275 | static S32 zCameraFlyUpdate(xCamera* cam, F32 dt) |
| 276 | { |
no test coverage detected