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

Function xCameraLook

src/SB/Core/x/xCamera.cpp:1288–1315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1286}
1287
1288void xCameraLook(xCamera* cam, U32 flags, const xQuat* orn_goal, F32 tm, F32 tm_acc, F32 tm_dec)
1289{
1290 F32 s; // unused
1291
1292 cam->flags = (cam->flags & ~0xF80) | (flags & 0xF80);
1293 cam->orn_goal = *orn_goal;
1294
1295 if (tm <= 0.0f)
1296 {
1297 if (cam->tgt_mat)
1298 {
1299 xQuatToMat(orn_goal, &cam->mat);
1300
1301 *(xMat3x3*)&cam->omat = *(xMat3x3*)&cam->mat;
1302 }
1303 }
1304 else
1305 {
1306 cam->flags |= 0x40;
1307 cam->ltm_acc = tm - tm_acc;
1308 cam->ltm_dec = tm_dec;
1309 cam->ltmr = tm;
1310
1311 xQuatDiff(&cam->orn_diff, &cam->orn_cur, orn_goal);
1312
1313 cam->orn_epv = 1.0f / (tm - 0.5f * (tm_acc - tm_dec)) * xQuatGetAngle(&cam->orn_diff);
1314 }
1315}
1316
1317void xCameraLookYPR(xCamera* cam, U32 flags, F32 yaw, F32 pitch, F32 roll, F32 tm, F32 tm_acc,
1318 F32 tm_dec)

Callers 1

_xCameraUpdateFunction · 0.70

Calls 3

xQuatDiffFunction · 0.85
xQuatGetAngleFunction · 0.85
xQuatToMatFunction · 0.70

Tested by

no test coverage detected