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

Function xCameraReset

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

Source from the content-addressed store, hash-verified

73}
74
75void xCameraReset(xCamera* cam, F32 d, F32 h, F32 pitch)
76{
77 sInvisWallHack = (RpAtomic*)xSTFindAsset(0xB8895D14, NULL);
78
79 xMat4x3Identity(&cam->mat);
80
81 cam->omat = cam->mat;
82 cam->focus.x = 0.0f;
83 cam->focus.y = 0.0f;
84 cam->focus.z = 10.0f;
85 cam->tran_accum.x = 0.0f;
86 cam->tran_accum.y = 0.0f;
87 cam->tran_accum.z = 0.0f;
88 cam->flags = 0;
89
90 F32 goal_p = 3.1415927f;
91
92 if (cam->tgt_mat)
93 {
94 goal_p += xatan2(cam->tgt_mat->at.x, cam->tgt_mat->at.z);
95 }
96
97 xCameraMove(cam, 0x2E, d, h, goal_p, 0.0f, 0.66666669f, 0.66666669f);
98
99 cam->pitch_goal = pitch;
100 cam->pitch_cur = pitch;
101 cam->roll_cur = 0.0f;
102
103 xMat3x3Euler(&cam->mat, cam->yaw_cur, cam->pitch_cur, cam->roll_cur);
104
105 cam->omat = cam->mat;
106 cam->yaw_ct = 1.0f;
107 cam->yaw_cd = 1.0f;
108 cam->yaw_ccv = 0.64999998f;
109 cam->yaw_csv = 1.0f;
110 cam->pitch_ct = 1.0f;
111 cam->pitch_cd = 1.0f;
112 cam->pitch_ccv = 0.7f;
113 cam->pitch_csv = 1.0f;
114 cam->roll_ct = 1.0f;
115 cam->roll_cd = 1.0f;
116 cam->roll_ccv = 0.7f;
117 cam->roll_csv = 1.0f;
118 cam->flags |= 0x80;
119
120 xcam_do_collis = 1;
121 xcam_collis_owner_disable = 0;
122}
123
124static void xCam_buildbasis(xCamera* cam)
125{

Callers 1

zCameraResetFunction · 0.50

Calls 5

xMat4x3IdentityFunction · 0.85
xatan2Function · 0.85
xMat3x3EulerFunction · 0.85
xSTFindAssetFunction · 0.70
xCameraMoveFunction · 0.70

Tested by

no test coverage detected