106 Bytecode* args = script->ptrReadPos;
115 Bytecode* args = script->ptrReadPos;
124 Bytecode* args = script->ptrReadPos;
133 Bytecode* args = script->ptrReadPos;
142 Bytecode* args = script->ptrReadPos;
150 camera->
params.interp.pitch = pitch;
151 camera->
params.interp.yaw = yaw;
152 camera->
params.interp.dist = dist;
153 camera->
params.interp.offsetY = offsetY;
158 Bytecode* args = script->ptrReadPos;
166 camera->
params.basic.skipRecalc = skipRecalc;
167 camera->
params.basic.dist = dist;
168 camera->
params.basic.fovScale = fovScale;
169 camera->
params.basic.pitch = pitch;
174 Bytecode* args = script->ptrReadPos;
186 Bytecode* args = script->ptrReadPos;
200 Bytecode* args = script->ptrReadPos;
214 Bytecode* args = script->ptrReadPos;
228 typedef struct CamInterpData {
235 Bytecode* args = script->ptrReadPos;
248 script->userData = data;
251 data->useTarget = useTarget;
254 switch (data->useTarget) {
261 data->vel.x = (posX - cam->
targetPos.
x) / data->time;
262 data->vel.y = (posY - cam->
targetPos.
y) / data->time;
263 data->vel.z = (posZ - cam->
targetPos.
z) / data->time;
268 data = script->userData;
270 switch (data->useTarget) {
272 cam->lookAt_obj_target.x += data->vel.x;
273 cam->lookAt_obj_target.y += data->vel.y;
274 cam->lookAt_obj_target.z += data->vel.z;
277 cam->targetPos.x += data->vel.x;
278 cam->targetPos.y += data->vel.y;
279 cam->targetPos.z += data->vel.z;
284 if (data->time == 0) {
286 script->userData = NULL;
293 Bytecode* args = script->ptrReadPos;
313 script->functionTempF[3] = 1.0f;
314 script->functionTemp[1] = duration;
317 if (magnitude > 10.0f) {
321 rumbleMagnitude = magnitude;
322 if (rumbleMagnitude > 6.0f) {
323 rumbleMagnitude = 6.0f;
325 rumbleMagnitude = rumbleMagnitude * 32.0f + 64.0f;
327 rumbleDuration = duration;
329 if (rumbleDuration < 5) {
332 start_rumble(rumbleMagnitude, (rumbleDuration & 0xFFFF) * 2);
337 scale = script->functionTempF[3];
341 script->functionTempF[3] = -script->functionTempF[3];
345 script->functionTempF[3] = -script->functionTempF[3];
349 if ((script->functionTemp[1] < (duration * 2)) && (duration < script->functionTemp[1])) {
350 script->functionTempF[3] = script->functionTempF[3] * -0.8;
352 script->functionTempF[3] = -script->functionTempF[3];
357 if (script->functionTemp[1] == 0) {
358 camera->
flags &= ~CAMERA_FLAG_SHAKING;
361 script->functionTemp[1]--;
369 script->varTable[0] = camID;
370 script->varTable[1] = mode;
371 script->varTable[2] = duration;
385 Bytecode* args = script->ptrReadPos;
393 camera->
flags &= ~CAMERA_FLAG_LEAD_PLAYER;
401 camera->
moveFlags &= ~CAMERA_MOVE_IGNORE_PLAYER_Y;
415 camera->
flags &= ~CAMERA_FLAG_SUPRESS_LEADING;
427 Bytecode* args = script->ptrReadPos;
437 Bytecode* args = script->ptrReadPos;
444 if (targetType != 0) {
456 Bytecode* args = script->ptrReadPos;
462 f32 hitX, hitY, hitZ;
463 f32 hitDepth = 32767.0f;
465 s32 hitID =
test_ray_zones(startX, startY + 10.0f, startZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth,
475 Bytecode* args = script->ptrReadPos;
485 Bytecode* args = script->ptrReadPos;
497 Bytecode* args = script->ptrReadPos;
509 Bytecode* args = script->ptrReadPos;
519 Bytecode* args = script->ptrReadPos;
531 Bytecode* args = script->ptrReadPos;
543 Bytecode* args = script->ptrReadPos;
555 Bytecode* args = script->ptrReadPos;
570 Bytecode* args = script->ptrReadPos;
580 Bytecode* args = script->ptrReadPos;
592 Bytecode* args = script->ptrReadPos;
604 Bytecode* args = script->ptrReadPos;
614 Bytecode* args = script->ptrReadPos;
626 Bytecode* args = script->ptrReadPos;
638 Bytecode* args = script->ptrReadPos;
650 Bytecode* args = script->ptrReadPos;
664 Bytecode* args = script->ptrReadPos;
669 if (isInitialCall || (endInterpValue > camera->
interpAlpha)) {
676 f32 hitX, hitY, hitZ, hitDepth, nX, nY, nZ;
678 Bytecode* args = script->ptrReadPos;
690 zoneID =
test_ray_zones(posX, posY + 10.0f, posZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &nX, &nY, &nZ);
716 f32 hitX, hitY, hitZ, hitDepth, nX, nY, nZ;
717 f32 posX, posY, posZ;
719 Bytecode* args = script->ptrReadPos;
730 posX = playerStatus->
pos.
x;
731 posY = playerStatus->
pos.
y;
732 posZ = playerStatus->
pos.
z;
733 zoneID =
test_ray_zones(posX, posY + 10.0f, posZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &nX, &nY, &nZ);
738 camera->
movePos.
x = posX + deltaPosX;
759 Bytecode* args = script->ptrReadPos;
766 f32 x = playerStatus->
pos.
x;
767 f32 y = playerStatus->
pos.
y;
768 f32 z = playerStatus->
pos.
z;
769 f32 hitX, hitY, hitZ;
770 f32 hitDepth = 32767.0f;
774 hitID =
test_ray_zones(x, y + 10.0f, z, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth,
void exec_ShakeCam1(s32 camID, s32 mode, s32 duration)
void exec_ShakeCamX(s32 camID, s32 mode, s32 duration, f32 magnitude)
union CameraControlSettings::@14 points
@ CAM_SHAKE_DECAYING_VERTICAL
@ CAM_SHAKE_CONSTANT_VERTICAL
@ CAM_SHAKE_ANGULAR_HORIZONTAL
@ CAMERA_FLAG_LEAD_PLAYER
@ CAMERA_FLAG_SUPRESS_LEADING
@ CAMERA_MOVE_IGNORE_PLAYER_Y
void start_rumble(s32, s32)
s32 test_ray_zones(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32 *hitX, f32 *hitY, f32 *hitZ, f32 *hitDepth, f32 *nx, f32 *ny, f32 *nz)
s32 evt_get_variable(Evt *script, Bytecode var)
f32 evt_set_float_variable(Evt *script, Bytecode var, f32 value)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
f32 evt_get_float_variable(Evt *script, Bytecode var)
Evt * start_script_in_group(EvtScript *source, u8 priority, u8 initialState, u8 groupFlags)
void * heap_malloc(s32 size)
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height)
ApiStatus GetCamPosB(Evt *script, b32 isInitialCall)
ApiStatus SetCamPosA(Evt *script, b32 isInitialCall)
ApiStatus SetCamEnabled(Evt *script, b32 isInitialCall)
ApiStatus SetCamViewport(Evt *script, b32 isInitialCall)
ApiStatus ResetCam(Evt *script, b32 isInitialCall)
ApiStatus SetCamPitch(Evt *script, b32 isInitialCall)
ApiStatus GetCamPosA(Evt *script, b32 isInitialCall)
ApiStatus SetInterpCamOffsetY(Evt *script, b32 isInitialCall)
ApiStatus SetCamPosB(Evt *script, b32 isInitialCall)
ApiStatus GetCamPitch(Evt *script, b32 isInitialCall)
ApiStatus LoadSettings(Evt *script, b32 isInitialCall)
ApiStatus SetCamUpdateMode(Evt *script, b32 isInitialCall)
ApiStatus DisableCameraFollowPlayerY(Evt *script, b32 isInitialCall)
ApiStatus PanToTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamType(Evt *script, b32 isInitialCall)
ApiStatus GetInterpCamDist(Evt *script, b32 isInitialCall)
ApiStatus GrabCamera(Evt *script, b32 isInitialCall)
ApiStatus SetCamProperties(Evt *script, b32 isInitialCall)
ApiStatus GetCamType(Evt *script, b32 isInitialCall)
ApiStatus SetCamLeadScale(Evt *script, b32 isInitialCall)
ApiStatus InterpCamTargetPos(Evt *script, b32 isInitialCall)
ApiStatus SetCamLookTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamBGColor(Evt *script, b32 isInitialCall)
ApiStatus SetCamDistance(Evt *script, b32 isInitialCall)
ApiStatus AdjustCam(Evt *script, b32 isInitialCall)
ApiStatus SetInterpCamParams(Evt *script, b32 isInitialCall)
ApiStatus WaitForCam(Evt *script, b32 isInitialCall)
ApiStatus GetCamPosition(Evt *script, b32 isInitialCall)
ApiStatus EnableCameraFollowPlayerY(Evt *script, b32 isInitialCall)
ApiStatus GetCamDistance(Evt *script, b32 isInitialCall)
ApiStatus SetCamLeadPlayer(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus SetNoInterpCamParams(Evt *script, b32 isInitialCall)
ApiStatus GetInterpCamOffsetY(Evt *script, b32 isInitialCall)
ApiStatus EnableCameraLeadingPlayer(Evt *script, b32 isInitialCall)
ApiStatus SetCamPosC(Evt *script, b32 isInitialCall)
ApiStatus SetCamTarget(Evt *script, b32 isInitialCall)
ApiStatus SetInterpCamDist(Evt *script, b32 isInitialCall)
ApiStatus UseSettingsFrom(Evt *script, b32 isInitialCall)
ApiStatus SetPanTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamSpeed(Evt *script, b32 isInitialCall)
ApiStatus SetCamNoDraw(Evt *script, b32 isInitialCall)
ApiStatus SetCamPerspective(Evt *script, b32 isInitialCall)
ApiStatus GetCamPosC(Evt *script, b32 isInitialCall)
ApiStatus DisableCameraLeadingPlayer(Evt *script, b32 isInitialCall)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define SetGroup(GROUP)
Sets the current thread's group. Group value meanings are currently not known.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define Return
Kills the current EVT thread.
f32 interpEasingParameter
CameraControlSettings overrideSettings
CollisionData gZoneCollisionData
GameStatus * gGameStatusPtr
PlayerStatus gPlayerStatus