MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / MatrixSpeed

Function MatrixSpeed

src/SB/Game/zCamera.cpp:251–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251static 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
275static S32 zCameraFlyUpdate(xCamera* cam, F32 dt)
276{

Callers 1

zCameraFlyUpdateFunction · 0.70

Calls 1

xacosFunction · 0.85

Tested by

no test coverage detected