Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
camera.c File Reference

Go to the source code of this file.

Data Structures

struct  CamSubjects
 

Macros

#define LERP(a, b, alpha)   ((a) * (alpha) + (b) * (1.0f-(alpha)))
 
#define QUADRATIC_SINE_INTERP(alpha)   (1.0f - sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2))
 
#define CUBIC_SINE_INTERP(alpha)   (1.0f - sin_rad(sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2) * PI_S / 2))
 

Functions

f32 clamp_edge_pos_x (f32 x)
 
b32 get_cam_subject_properties (CamSubjects *subjects, b32 usePart)
 
void btl_cam_use_preset_impl (s32 id)
 
void btl_cam_use_preset_immediately (s32 preset)
 
void btl_cam_use_preset (s32 preset)
 
void btl_cam_target_actor (s32 actorID)
 
void btl_cam_target_actor_part (s32 actorID, s32 actorPartIndex)
 
void btl_cam_set_params (b16 skipRecalc, s16 boomLength, s16 vfovScale, s16 boomPitch, s32 boomYaw, s32 boomZOffset, s32 zoomPercent)
 
void btl_cam_move (s16 moveTime)
 
void btl_cam_set_target_pos (f32 x, f32 y, f32 z)
 
void btl_cam_set_pos (f32 x, f32 y, f32 z)
 
s32 btl_cam_is_moving_done (void)
 
void btl_cam_set_zoom (s16 zoom)
 
void btl_cam_add_zoom (s32 zoom)
 
void btl_cam_set_zoffset (s16 zOffset)
 
void btl_cam_unfreeze (void)
 
void btl_cam_disable_clamp_x (void)
 

Variables

s8 BattleCam_IsFrozen = FALSE
 
s32 BattleCam_CurrentPresetID = -1
 
EvtScript EVS_BattleCam_Interrupt
 
EvtScript EVS_BattleCam_FocusMidpointA
 
EvtScript EVS_BattleCam_FocusMidpointB
 
EvtScript EVS_BattleCam_FocusActorPart
 
EvtScript EVS_BattleCam_FocusActor
 
EvtScript EVS_BattleCam_FocusGoal
 
EvtScript EVS_BattleCam_SimpleLerp_Unskippable
 
EvtScript EVS_BattleCam_ResetNeutral
 
EvtScript EVS_BattleCam_ViewEnemies
 
EvtScript EVS_BattleCam_ViewEnemies_MaintainY
 
EvtScript EVS_BattleCam_SimpleLerp_Skippable
 
EvtScript EVS_BattleCam_FollowActorY
 
EvtScript EVS_BattleCam_FollowActorPos
 
EvtScript EVS_BattleCam_Reset
 
EvtScript EVS_OnBattleInit
 

Data Structure Documentation

◆ CamSubjects

struct CamSubjects
Data Fields
Vec3f actorPos
Vec2f actorSize
f32 actorSizeAvg
Vec3f targetPos
Vec2f targetSize
f32 targetSizeAvg
Vec3f avgPos

Macro Definition Documentation

◆ LERP

#define LERP ( a,
b,
alpha )   ((a) * (alpha) + (b) * (1.0f-(alpha)))

Definition at line 5 of file camera.c.

◆ QUADRATIC_SINE_INTERP

#define QUADRATIC_SINE_INTERP ( alpha)    (1.0f - sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2))

Definition at line 7 of file camera.c.

◆ CUBIC_SINE_INTERP

#define CUBIC_SINE_INTERP ( alpha)    (1.0f - sin_rad(sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2) * PI_S / 2))

Definition at line 8 of file camera.c.

Function Documentation

◆ clamp_edge_pos_x()

f32 clamp_edge_pos_x ( f32 x)

Definition at line 50 of file camera.c.

50 {
51 if (BattleCam_ClampPosX) {
52 f32 upperBound = (500.0f - BattleCam_InitialBoomLength) * 0.4 + 30.0;
53 f32 lowerBound = -upperBound;
54
55 if (x < lowerBound) {
56 x += (lowerBound - x) / 2;
57 }
58 if (x > upperBound) {
59 x += (upperBound - x) / 2;
60 }
61 }
62 return x;
63}

◆ get_cam_subject_properties()

b32 get_cam_subject_properties ( CamSubjects * subjects,
b32 usePart )

Definition at line 65 of file camera.c.

65 {
66 s32 actorClass = BattleCam_SubjectActor & ACTOR_CLASS_MASK;
67 s32 actorID = BattleCam_SubjectActor & 0xFF;
68 ActorPart* part = NULL;
69 Actor* actor;
70 Actor* targetActor;
71 f32 deltaY;
72
73 switch (actorClass) {
76 break;
79 break;
81 actor = gBattleStatus.enemyActors[actorID];
82 if (usePart && actor != NULL) {
83 part = get_actor_part(actor, BattleCam_SubjectActorPart);
84 }
85 break;
86 default:
87 return FALSE;
88 }
89
90 if (actor == NULL) {
91 return FALSE;
92 }
93
94 if (part != NULL) {
95 subjects->actorPos.x = part->absolutePos.x;
96 subjects->actorPos.y = part->absolutePos.y + part->size.y / 2 + part->size.y / 4;
97 subjects->actorPos.z = part->absolutePos.z;
98
99 subjects->actorSize.x = part->size.x;
100 subjects->actorSize.y = part->size.y;
101 } else {
102 subjects->actorPos.x = actor->curPos.x;
103 subjects->actorPos.y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4;
104 subjects->actorPos.z = actor->curPos.z;
105
106 subjects->actorSize.x = actor->size.x;
107 subjects->actorSize.y = actor->size.y;
108 }
109 subjects->actorSizeAvg = (subjects->actorSize.x + subjects->actorSize.y) / 2;
110
111 targetActor = get_actor(actor->targetActorID);
112 if (targetActor == NULL) {
113 return FALSE;
114 }
115
116 subjects->targetPos.x = targetActor->curPos.x;
117 subjects->targetPos.y = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4;
118 subjects->targetPos.z = targetActor->curPos.z;
119
120 subjects->targetSize.x = targetActor->size.x;
121 subjects->targetSize.y = targetActor->size.y;
122 subjects->targetSizeAvg = (subjects->targetSize.x + subjects->targetSize.y) / 2;
123
124 subjects->avgPos.x = (subjects->actorPos.x + subjects->targetPos.x) / 2;
125 subjects->avgPos.z = (subjects->actorPos.z + subjects->targetPos.z) / 2;
126 deltaY = subjects->actorPos.y - subjects->targetPos.y;
127
128 switch (actorClass) {
130 switch (BattleCam_AdjustTargetYMode) {
132 // final position is weighted 75% actor and 25% target:
133 // = a - (a - t) / 4
134 // = (4a - a + t) / 4
135 // = (3a + t) / 4
136 subjects->avgPos.y = subjects->actorPos.y - deltaY / 4;
137 break;
139 subjects->avgPos.y = subjects->targetPos.y;
140 break;
142 subjects->avgPos.y = subjects->actorPos.y;
143 break;
144 case BTL_CAM_YADJ_AVG:
145 // final position is weighted 66% actor and 33% target:
146 // = t + (a - t) / 2 + (a - t) / 6
147 // = (6t + 3a - 3t + a - t) / 6
148 // = (2t + 4a) / 6
149 subjects->avgPos.y = subjects->targetPos.y + deltaY / 2 + deltaY / 6;
150 break;
151 }
152 break;
154 switch (BattleCam_AdjustTargetYMode) {
156 subjects->avgPos.y = subjects->targetPos.y;
157 break;
159 subjects->avgPos.y = subjects->actorPos.y;
160 break;
161 case BTL_CAM_YADJ_AVG:
162 // same math as ACTOR_CLASS_PLAYER
163 subjects->avgPos.y = subjects->targetPos.y + deltaY / 2 + deltaY / 6;
164 break;
165 }
166 break;
168 switch (BattleCam_AdjustTargetYMode) {
170 subjects->avgPos.y = subjects->actorPos.y;
171 break;
173 subjects->avgPos.y = subjects->targetPos.y;
174 break;
176 subjects->avgPos.y = subjects->actorPos.y;
177 break;
178 case BTL_CAM_YADJ_AVG:
179 // same math as ACTOR_CLASS_PLAYER
180 subjects->avgPos.y = subjects->targetPos.y + deltaY / 2 + deltaY / 6;
181 break;
182 }
183 break;
184 default:
185 return FALSE;
186 }
187
188 return TRUE;
189}
Vec2f targetSize
Definition camera.c:45
Vec3f avgPos
Definition camera.c:47
Vec2f actorSize
Definition camera.c:42
Vec3f targetPos
Definition camera.c:44
f32 targetSizeAvg
Definition camera.c:46
Vec3f actorPos
Definition camera.c:41
f32 actorSizeAvg
Definition camera.c:43
s16 targetActorID
Vec2bu size
Vec3f curPos
@ ACTOR_CLASS_ENEMY
Definition enums.h:2079
@ ACTOR_CLASS_PLAYER
Definition enums.h:2077
@ ACTOR_CLASS_PARTNER
Definition enums.h:2078
@ ACTOR_CLASS_MASK
Definition enums.h:2080
@ BTL_CAM_YADJ_SLIGHT
Definition enums.h:4904
@ BTL_CAM_YADJ_AVG
Definition enums.h:4907
@ BTL_CAM_YADJ_NONE
Definition enums.h:4906
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
struct Actor * partnerActor
struct Actor * playerActor
struct Actor * enemyActors[24]
BattleStatus gBattleStatus
Definition battle.c:11

◆ btl_cam_use_preset_impl()

void btl_cam_use_preset_impl ( s32 id)

Definition at line 1187 of file camera.c.

1187 {
1188 EvtScript* preset = NULL;
1189 Evt* newScript;
1190
1191 if (BattleCam_IsFrozen) {
1192 return;
1193 }
1194
1195 BattleCam_ClampPosX = TRUE;
1196 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1197 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1198 BattleCam_UseLinearInterp = FALSE;
1199 BattleCam_ExtraOffsetX = 0;
1200
1201 switch (id) {
1202 case BTL_CAM_RESET:
1203 preset = &EVS_BattleCam_Reset;
1204 break;
1205 case BTL_CAM_INTERRUPT:
1206 preset = &EVS_BattleCam_Interrupt;
1207 break;
1208 case BTL_CAM_DEFAULT:
1209 if (BattleCam_CurrentPresetID == id) {
1210 return;
1211 }
1212 BattleCam_BoomLength = 500;
1213 BattleCam_MoveTimeLeft = 30;
1215 break;
1217 if (BattleCam_CurrentPresetID == id) {
1218 return;
1219 }
1220 BattleCam_BoomLength = 480;
1221 BattleCam_BoomOffsetY = 0;
1222 BattleCam_MoveTimeLeft = 20;
1223 preset = &EVS_BattleCam_ViewEnemies;
1224 break;
1226 if (BattleCam_CurrentPresetID == id) {
1227 return;
1228 }
1229 BattleCam_BoomLength = 500;
1230 BattleCam_BoomOffsetY = 0;
1231 BattleCam_MoveTimeLeft = 10;
1233 break;
1235 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1236 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1237 BattleCam_BoomLength = 300;
1238 BattleCam_MoveTimeLeft = 20;
1240 break;
1241 case BTL_CAM_ACTOR_PART:
1242 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1243 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1244 BattleCam_BoomLength = 300;
1245 BattleCam_MoveTimeLeft = 20;
1247 break;
1249 BattleCam_BoomLength = 300;
1250 BattleCam_MoveTimeLeft = 20;
1251 preset = &EVS_BattleCam_FocusGoal;
1252 break;
1254 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1255 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1256 BattleCam_BoomLength = 300;
1257 BattleCam_MoveTimeLeft = 20;
1258 preset = &EVS_BattleCam_FocusActor;
1259 break;
1261 if (BattleCam_ControlScript == &EVS_BattleCam_ResetNeutral) {
1262 return;
1263 }
1264 BattleCam_BoomLength = 500;
1265 BattleCam_MoveTimeLeft = 120;
1267 break;
1269 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1270 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1271 BattleCam_BoomLength = 200;
1272 BattleCam_BoomPitch = 8;
1273 BattleCam_BoomYaw = 0;
1274 BattleCam_BoomOffsetY = 15;
1275 BattleCam_MoveTimeLeft = 20;
1277 break;
1279 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1280 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1281 BattleCam_BoomLength = 300;
1282 BattleCam_BoomPitch = 8;
1283 BattleCam_BoomYaw = 0;
1284 BattleCam_BoomOffsetY = 16;
1285 BattleCam_MoveTimeLeft = 20;
1287 break;
1289 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1290 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1291 BattleCam_BoomLength = 400;
1292 BattleCam_BoomPitch = 8;
1293 BattleCam_BoomYaw = 0;
1294 BattleCam_BoomOffsetY = 30;
1295 BattleCam_MoveTimeLeft = 20;
1297 break;
1299 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1300 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1301 BattleCam_BoomLength = 200;
1302 BattleCam_BoomPitch = 8;
1303 BattleCam_BoomYaw = 0;
1304 BattleCam_BoomOffsetY = 15;
1305 BattleCam_MoveTimeLeft = 20;
1306 preset = &EVS_BattleCam_FocusActor;
1307 break;
1308 case BTL_CAM_ACTOR:
1309 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1310 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1311 BattleCam_BoomLength = 300;
1312 BattleCam_BoomPitch = 8;
1313 BattleCam_BoomYaw = 0;
1314 BattleCam_BoomOffsetY = 16;
1315 BattleCam_MoveTimeLeft = 20;
1316 preset = &EVS_BattleCam_FocusActor;
1317 break;
1318 case BTL_CAM_ACTOR_FAR:
1319 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1320 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1321 BattleCam_BoomLength = 400;
1322 BattleCam_BoomPitch = 8;
1323 BattleCam_BoomYaw = 0;
1324 BattleCam_BoomOffsetY = 30;
1325 BattleCam_MoveTimeLeft = 20;
1326 preset = &EVS_BattleCam_FocusActor;
1327 break;
1329 BattleCam_BoomLength = 267;
1330 BattleCam_BoomPitch = 8;
1331 BattleCam_BoomYaw = 0;
1332 BattleCam_BoomOffsetY = 23;
1333 BattleCam_MoveTimeLeft = 20;
1334 preset = &EVS_BattleCam_FocusGoal;
1335 break;
1336 case BTL_CAM_ACTOR_GOAL:
1337 BattleCam_BoomLength = 300;
1338 BattleCam_BoomPitch = 8;
1339 BattleCam_BoomYaw = 0;
1340 BattleCam_BoomOffsetY = 8;
1341 BattleCam_MoveTimeLeft = 20;
1342 preset = &EVS_BattleCam_FocusGoal;
1343 break;
1345 BattleCam_BoomLength = 400;
1346 BattleCam_BoomPitch = 8;
1347 BattleCam_BoomYaw = 0;
1348 BattleCam_BoomOffsetY = 0;
1349 BattleCam_MoveTimeLeft = 20;
1350 preset = &EVS_BattleCam_FocusGoal;
1351 break;
1352 case BTL_CAM_REPOSITION:
1353 BattleCam_MoveTimeLeft = 20;
1355 break;
1357 BattleCam_BoomOffsetY = 0;
1358 BattleCam_MoveTimeLeft = 20;
1360 break;
1362 BattleCam_BoomOffsetY = 0;
1363 BattleCam_MoveTimeLeft = 20;
1365 break;
1367 BattleCam_SubjectActor = ACTOR_PLAYER;
1368 BattleCam_BoomLength = 266;
1369 BattleCam_BoomPitch = 8;
1370 BattleCam_BoomYaw = 0;
1371 BattleCam_BoomOffsetY = 40;
1372 btl_cam_set_target_pos(-80.0f, 0.0f, 0.0f);
1373 BattleCam_MoveTimeLeft = 20;
1375 break;
1377 BattleCam_SubjectActor = ACTOR_PLAYER;
1378 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1379 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1380 BattleCam_BoomLength = 250;
1381 BattleCam_BoomPitch = 8;
1382 BattleCam_BoomYaw = 0;
1383 BattleCam_BoomOffsetY = 14;
1384 BattleCam_ClampPosX = FALSE;
1385 BattleCam_IsFrozen = TRUE;
1386 BattleCam_MoveTimeLeft = 20;
1387 preset = &EVS_BattleCam_FocusActor;
1388 break;
1389 case BTL_CAM_VICTORY:
1390 BattleCam_SubjectActor = ACTOR_PLAYER;
1391 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1392 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1393 BattleCam_BoomLength = 255;
1394 BattleCam_BoomPitch = 8;
1395 BattleCam_BoomYaw = 0;
1396 BattleCam_BoomOffsetY = 29;
1397 btl_cam_set_target_pos(-95.0f, 18.0f, 10.0f);
1398 BattleCam_MoveTimeLeft = 20;
1400 break;
1402 BattleCam_SubjectActor = ACTOR_PLAYER;
1403 BattleCam_BoomLength = 230;
1404 BattleCam_BoomPitch = 8;
1405 BattleCam_BoomYaw = 0;
1406 BattleCam_BoomOffsetY = 0;
1407 BattleCam_MoveTimeLeft = 20;
1409 break;
1411 BattleCam_SubjectActor = ACTOR_PLAYER;
1412 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1413 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1414 BattleCam_BoomLength = 310;
1415 BattleCam_BoomPitch = 8;
1416 BattleCam_BoomYaw = 0;
1417 BattleCam_BoomOffsetY = 16;
1418 BattleCam_ClampPosX = FALSE;
1419 BattleCam_MoveTimeLeft = 30;
1421 break;
1423 BattleCam_SubjectActor = ACTOR_PLAYER;
1424 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1425 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1426 BattleCam_BoomLength = 320;
1427 BattleCam_BoomPitch = 8;
1428 BattleCam_BoomYaw = 0;
1429 BattleCam_BoomOffsetY = 0;
1430 BattleCam_ClampPosX = FALSE;
1431 BattleCam_MoveTimeLeft = 5;
1433 break;
1435 BattleCam_SubjectActor = ACTOR_PLAYER;
1436 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1437 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1438 BattleCam_BoomLength = 340;
1439 BattleCam_BoomPitch = 8;
1440 BattleCam_BoomYaw = 0;
1441 BattleCam_BoomOffsetY = 0;
1442 BattleCam_ClampPosX = FALSE;
1443 BattleCam_MoveTimeLeft = 5;
1445 break;
1448 BattleCam_SubjectActor = ACTOR_PLAYER;
1449 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1450 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1451 BattleCam_BoomLength = 300;
1452 BattleCam_BoomPitch = 8;
1453 BattleCam_BoomYaw = 0;
1454 BattleCam_BoomOffsetY = -32;
1455 BattleCam_ExtraOffsetX = 20;
1456 BattleCam_MoveTimeLeft = 15;
1457 preset = &EVS_BattleCam_FocusActor;
1458 break;
1460 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1461 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1462 BattleCam_PosX = -65.0f;
1463 BattleCam_PosY = 30.0f;
1464 BattleCam_PosZ = 0.0f;
1465 BattleCam_BoomLength = 300;
1466 BattleCam_BoomPitch = 8;
1467 BattleCam_BoomYaw = 0;
1468 BattleCam_BoomOffsetY = 10;
1469 BattleCam_MoveTimeLeft = 10;
1471 break;
1473 BattleCam_SubjectActor = ACTOR_PLAYER;
1474 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1475 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1476 BattleCam_BoomLength = 220;
1477 BattleCam_BoomPitch = 8;
1478 BattleCam_BoomYaw = 0;
1479 BattleCam_BoomOffsetY = 24;
1480 BattleCam_ClampPosX = FALSE;
1481 BattleCam_MoveTimeLeft = 30;
1482 preset = &EVS_BattleCam_FocusActor;
1483 break;
1485 BattleCam_SubjectActor = ACTOR_PLAYER;
1486 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1487 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1488 BattleCam_BoomLength = 280;
1489 BattleCam_BoomPitch = 8;
1490 BattleCam_BoomYaw = 0;
1491 BattleCam_BoomOffsetY = -4;
1492 BattleCam_ClampPosX = FALSE;
1493 BattleCam_MoveTimeLeft = 30;
1495 break;
1497 BattleCam_SubjectActor = ACTOR_PLAYER;
1498 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1499 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1500 BattleCam_BoomLength = 380;
1501 BattleCam_BoomPitch = 8;
1502 BattleCam_BoomYaw = 0;
1503 BattleCam_BoomOffsetY = 0;
1504 BattleCam_ClampPosX = FALSE;
1505 BattleCam_UseLinearInterp = TRUE;
1506 BattleCam_MoveTimeLeft = 60;
1508 break;
1510 BattleCam_SubjectActor = ACTOR_PLAYER;
1511 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1512 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1513 BattleCam_BoomLength = 300;
1514 BattleCam_BoomPitch = 8;
1515 BattleCam_BoomYaw = 0;
1516 BattleCam_BoomOffsetY = 0;
1517 BattleCam_ClampPosX = FALSE;
1518 BattleCam_UseLinearInterp = TRUE;
1519 BattleCam_MoveTimeLeft = 60;
1521 break;
1524 BattleCam_SubjectActor = ACTOR_PLAYER;
1525 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1526 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1527 BattleCam_BoomLength = 320;
1528 BattleCam_BoomPitch = 8;
1529 BattleCam_BoomYaw = 0;
1530 BattleCam_BoomOffsetY = -4;
1531 BattleCam_ClampPosX = FALSE;
1532 BattleCam_MoveTimeLeft = 30;
1534 break;
1536 BattleCam_SubjectActor = ACTOR_PLAYER;
1537 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1538 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1539 BattleCam_BoomLength = 320;
1540 BattleCam_BoomPitch = 8;
1541 BattleCam_BoomYaw = 0;
1542 BattleCam_BoomOffsetY = 0;
1543 BattleCam_ClampPosX = FALSE;
1544 BattleCam_MoveTimeLeft = 30;
1546 break;
1548 BattleCam_SubjectActor = ACTOR_PLAYER;
1549 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1550 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1551 BattleCam_BoomLength = 360;
1552 BattleCam_BoomPitch = 8;
1553 BattleCam_BoomYaw = 0;
1554 BattleCam_BoomOffsetY = -4;
1555 BattleCam_ClampPosX = FALSE;
1556 BattleCam_MoveTimeLeft = 20;
1558 break;
1561 BattleCam_BoomLength = 200;
1562 BattleCam_MoveTimeTotal = 7;
1563 BattleCam_DoneMoving = FALSE;
1564 BattleCam_ClampPosX = FALSE;
1565 BattleCam_MoveTimeLeft = 7;
1566 preset = BattleCam_ControlScript;
1567 break;
1569 BattleCam_SubjectActor = ACTOR_PLAYER;
1570 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1571 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_SLIGHT;
1572 BattleCam_BoomLength = 214;
1573 BattleCam_BoomPitch = 8;
1574 BattleCam_BoomYaw = 0;
1575 BattleCam_BoomOffsetY = 16;
1576 BattleCam_ClampPosX = FALSE;
1577 BattleCam_MoveTimeLeft = 20;
1579 break;
1581 BattleCam_SubjectActor = ACTOR_PLAYER;
1582 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1583 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1584 BattleCam_BoomLength = 300;
1585 BattleCam_BoomPitch = 8;
1586 BattleCam_BoomYaw = 0;
1587 BattleCam_BoomOffsetY = 16;
1588 BattleCam_ClampPosX = FALSE;
1589 BattleCam_MoveTimeLeft = 8;
1591 break;
1593 BattleCam_SubjectActor = ACTOR_PLAYER;
1594 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1595 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1596 BattleCam_PosX = 60.0f;
1597 BattleCam_PosY = 40.0f;
1598 BattleCam_PosZ = 0.0f;
1599 BattleCam_BoomLength = 430;
1600 BattleCam_BoomPitch = 8;
1601 BattleCam_BoomYaw = 0;
1602 BattleCam_BoomOffsetY = 16;
1603 BattleCam_MoveTimeLeft = 10;
1605 break;
1607 BattleCam_SubjectActor = ACTOR_PLAYER;
1608 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1609 BattleCam_PosX = 60.0f;
1610 BattleCam_PosY = 40.0f;
1611 BattleCam_PosZ = 0.0f;
1612 BattleCam_BoomLength = 460;
1613 BattleCam_BoomPitch = 8;
1614 BattleCam_BoomYaw = 0;
1615 BattleCam_BoomOffsetY = 27;
1616 BattleCam_MoveTimeLeft = 10;
1618 break;
1620 BattleCam_BoomLength = 390;
1621 BattleCam_BoomPitch = 8;
1622 BattleCam_BoomYaw = 0;
1623 BattleCam_BoomOffsetY = 45;
1624 btl_cam_set_target_pos(-70.0f, 0.0f, 0.0f);
1625 BattleCam_ClampPosX = FALSE;
1626 BattleCam_MoveTimeLeft = 10;
1628 break;
1630 BattleCam_BoomLength = 500;
1631 BattleCam_BoomPitch = 8;
1632 BattleCam_BoomYaw = 0;
1633 BattleCam_BoomOffsetY = 45;
1634 btl_cam_set_target_pos(0.0f, 0.0f, 0.0f);
1635 BattleCam_ClampPosX = FALSE;
1636 BattleCam_MoveTimeLeft = 40;
1638 break;
1641 BattleCam_BoomLength = 300;
1642 BattleCam_BoomPitch = 8;
1643 BattleCam_BoomYaw = 0;
1644 BattleCam_BoomOffsetY = 45;
1645 btl_cam_set_target_pos(-50.0f, 0.0f, 0.0f);
1646 BattleCam_ClampPosX = FALSE;
1647 BattleCam_MoveTimeLeft = 20;
1649 break;
1651 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1652 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1653 BattleCam_PosX = -75.0f;
1654 BattleCam_PosY = 150.0f;
1655 BattleCam_PosZ = 0.0f;
1656 BattleCam_BoomLength = 166;
1657 BattleCam_BoomPitch = 8;
1658 BattleCam_BoomYaw = 0;
1659 BattleCam_BoomOffsetY = 17;
1660 BattleCam_MoveTimeLeft = 1;
1662 break;
1664 BattleCam_SubjectActor = ACTOR_PARTNER;
1665 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1666 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1667 BattleCam_BoomLength = 310;
1668 BattleCam_BoomPitch = 8;
1669 BattleCam_BoomYaw = 0;
1670 BattleCam_BoomOffsetY = 16;
1671 BattleCam_ClampPosX = FALSE;
1672 BattleCam_MoveTimeLeft = 30;
1674 break;
1676 BattleCam_SubjectActor = ACTOR_PARTNER;
1677 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1678 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1679 BattleCam_BoomLength = 250;
1680 BattleCam_BoomPitch = 8;
1681 BattleCam_BoomYaw = 0;
1682 BattleCam_BoomOffsetY = 16;
1683 BattleCam_ClampPosX = FALSE;
1684 BattleCam_UseLinearInterp = TRUE;
1685 BattleCam_MoveTimeLeft = 120;
1687 break;
1689 BattleCam_SubjectActor = ACTOR_PARTNER;
1690 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1691 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1692 BattleCam_BoomLength = 300;
1693 BattleCam_BoomPitch = 8;
1694 BattleCam_BoomYaw = 0;
1695 BattleCam_BoomOffsetY = 16;
1696 BattleCam_ClampPosX = FALSE;
1697 BattleCam_UseLinearInterp = TRUE;
1698 BattleCam_MoveTimeLeft = 120;
1699 preset = &EVS_BattleCam_FocusActor;
1700 break;
1702 BattleCam_SubjectActor = ACTOR_PARTNER;
1703 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1704 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1705 BattleCam_BoomLength = 320;
1706 BattleCam_BoomPitch = 8;
1707 BattleCam_BoomYaw = 0;
1708 BattleCam_BoomOffsetY = 0;
1709 BattleCam_ClampPosX = FALSE;
1710 BattleCam_MoveTimeLeft = 5;
1712 break;
1715 BattleCam_BoomLength = 500;
1716 BattleCam_BoomOffsetY = 0;
1717 BattleCam_MoveTimeLeft = 50;
1718 preset = &EVS_BattleCam_ViewEnemies;
1719 break;
1721 BattleCam_SubjectActor = ACTOR_PARTNER;
1722 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1723 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1724 BattleCam_BoomLength = 280;
1725 BattleCam_BoomPitch = 8;
1726 BattleCam_BoomYaw = 0;
1727 BattleCam_BoomOffsetY = -4;
1728 BattleCam_ClampPosX = FALSE;
1729 BattleCam_MoveTimeLeft = 30;
1731 break;
1733 BattleCam_SubjectActor = ACTOR_PARTNER;
1734 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1735 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1736 BattleCam_BoomLength = 380;
1737 BattleCam_BoomPitch = 8;
1738 BattleCam_BoomYaw = 0;
1739 BattleCam_BoomOffsetY = 0;
1740 BattleCam_ClampPosX = FALSE;
1741 BattleCam_UseLinearInterp = TRUE;
1742 BattleCam_MoveTimeLeft = 60;
1744 break;
1746 BattleCam_SubjectActor = ACTOR_PARTNER;
1747 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1748 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1749 BattleCam_BoomLength = 220;
1750 BattleCam_BoomPitch = 8;
1751 BattleCam_BoomYaw = 0;
1752 BattleCam_BoomOffsetY = 24;
1753 BattleCam_ClampPosX = FALSE;
1754 BattleCam_MoveTimeLeft = 30;
1755 preset = &EVS_BattleCam_FocusActor;
1756 break;
1758 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1759 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1760 BattleCam_PosX = -95.0f;
1761 BattleCam_PosY = 22.0f;
1762 BattleCam_PosZ = 0.0f;
1763 BattleCam_BoomLength = 210;
1764 BattleCam_BoomPitch = 8;
1765 BattleCam_BoomYaw = 0;
1766 BattleCam_BoomOffsetY = 10;
1767 BattleCam_MoveTimeLeft = 20;
1769 break;
1771 BattleCam_SubjectActor = ACTOR_PARTNER;
1772 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1773 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1774 BattleCam_BoomLength = 320;
1775 BattleCam_BoomPitch = 8;
1776 BattleCam_BoomYaw = 0;
1777 BattleCam_BoomOffsetY = -4;
1778 BattleCam_MoveTimeLeft = 30;
1780 break;
1782 BattleCam_SubjectActor = ACTOR_PARTNER;
1783 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1784 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1785 BattleCam_BoomLength = 320;
1786 BattleCam_BoomPitch = 8;
1787 BattleCam_BoomYaw = 0;
1788 BattleCam_BoomOffsetY = 0;
1789 BattleCam_MoveTimeLeft = 30;
1791 break;
1793 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1794 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1795 BattleCam_PosX = 25.0f;
1796 BattleCam_PosY = 60.0f;
1797 BattleCam_PosZ = 0.0f;
1798 BattleCam_BoomLength = 400;
1799 BattleCam_BoomPitch = 8;
1800 BattleCam_BoomYaw = 0;
1801 BattleCam_BoomOffsetY = 10;
1802 BattleCam_MoveTimeLeft = 30;
1804 break;
1806 BattleCam_SubjectActor = ACTOR_PARTNER;
1807 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1808 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1809 BattleCam_BoomLength = 200;
1810 BattleCam_BoomPitch = 8;
1811 BattleCam_BoomYaw = 0;
1812 BattleCam_BoomOffsetY = 11;
1813 BattleCam_ClampPosX = FALSE;
1814 BattleCam_UseLinearInterp = TRUE;
1815 BattleCam_MoveTimeLeft = 60;
1816 preset = &EVS_BattleCam_FocusActor;
1817 break;
1819 BattleCam_SubjectActor = ACTOR_PARTNER;
1820 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1821 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_NONE;
1822 BattleCam_BoomLength = 300;
1823 BattleCam_BoomPitch = 8;
1824 BattleCam_BoomYaw = 0;
1825 BattleCam_BoomOffsetY = 16;
1826 BattleCam_MoveTimeLeft = 8;
1827 preset = &EVS_BattleCam_FocusActor;
1828 break;
1831 BattleCam_SubjectActor = ACTOR_PARTNER;
1832 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1833 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1834 BattleCam_BoomLength = 300;
1835 BattleCam_BoomPitch = 8;
1836 BattleCam_BoomYaw = 0;
1837 BattleCam_BoomOffsetY = -32;
1838 BattleCam_ExtraOffsetX = 20;
1839 BattleCam_MoveTimeLeft = 15;
1840 preset = &EVS_BattleCam_FocusActor;
1841 break;
1843 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1844 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1845 BattleCam_BoomLength = 400;
1846 BattleCam_BoomPitch = 8;
1847 BattleCam_BoomYaw = 0;
1848 BattleCam_BoomOffsetY = 27;
1849 BattleCam_MoveTimeLeft = 20;
1851 break;
1853 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1854 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1855 BattleCam_BoomLength = 358;
1856 BattleCam_BoomPitch = 8;
1857 BattleCam_BoomYaw = 0;
1858 BattleCam_BoomOffsetY = 16;
1859 BattleCam_MoveTimeLeft = 10;
1861 break;
1863 BattleCam_BoomLength = 500;
1864 BattleCam_MoveTimeLeft = 50;
1866 break;
1867 case BTL_CAM_ENEMY_DIVE:
1868 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_NONE;
1869 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1870 BattleCam_BoomLength = 267;
1871 BattleCam_BoomPitch = 8;
1872 BattleCam_BoomYaw = 0;
1873 BattleCam_BoomOffsetY = 16;
1874 BattleCam_MoveTimeLeft = 20;
1876 break;
1878 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1879 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1880 BattleCam_BoomLength = 214;
1881 BattleCam_BoomPitch = 8;
1882 BattleCam_BoomYaw = 0;
1883 BattleCam_BoomOffsetY = 16;
1884 BattleCam_MoveTimeLeft = 20;
1886 break;
1888 BattleCam_AdjustTargetXMode = BTL_CAM_XADJ_AVG;
1889 BattleCam_AdjustTargetYMode = BTL_CAM_YADJ_AVG;
1890 BattleCam_BoomLength = 300;
1891 BattleCam_BoomPitch = 8;
1892 BattleCam_BoomOffsetY = 16;
1893 BattleCam_BoomYaw = 0;
1894 BattleCam_MoveTimeLeft = 4;
1896 break;
1897 }
1898
1900
1901 if (gBattleStatus.camMovementScript != NULL) {
1903 }
1904
1905 BattleCam_ControlScript = preset;
1907 gBattleStatus.camMovementScript = newScript;
1909 BattleCam_DoneMoving = FALSE;
1910}
EvtScript EVS_BattleCam_FocusActorPart
Definition camera.c:1102
EvtScript EVS_BattleCam_FocusActor
Definition camera.c:1108
EvtScript EVS_BattleCam_Interrupt
Definition camera.c:1084
EvtScript EVS_BattleCam_SimpleLerp_Unskippable
Definition camera.c:1120
EvtScript EVS_BattleCam_Reset
Definition camera.c:1162
EvtScript EVS_BattleCam_FocusMidpointA
Definition camera.c:1090
s32 BattleCam_CurrentPresetID
Definition camera.c:38
EvtScript EVS_BattleCam_SimpleLerp_Skippable
Definition camera.c:1144
s8 BattleCam_IsFrozen
Definition camera.c:37
EvtScript EVS_BattleCam_ResetNeutral
Definition camera.c:1126
void btl_cam_set_target_pos(f32 x, f32 y, f32 z)
Definition camera.c:1962
EvtScript EVS_BattleCam_FocusMidpointB
Definition camera.c:1096
EvtScript EVS_BattleCam_ViewEnemies
Definition camera.c:1132
EvtScript EVS_BattleCam_FollowActorY
Definition camera.c:1150
EvtScript EVS_BattleCam_ViewEnemies_MaintainY
Definition camera.c:1138
EvtScript EVS_BattleCam_FollowActorPos
Definition camera.c:1156
EvtScript EVS_BattleCam_FocusGoal
Definition camera.c:1114
Bytecode EvtScript[]
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ BTL_CAM_XADJ_NONE
Definition enums.h:4899
@ BTL_CAM_ACTOR_PART
Definition enums.h:4828
@ BTL_CAM_GOOMBARIO_BONK_FOLLOWUP_2
Definition enums.h:4875
@ BTL_CAM_MIDPOINT_FAR
Definition enums.h:4834
@ BTL_CAM_MIDPOINT_NORMAL
Definition enums.h:4833
@ BTL_CAM_ACTOR_TARGET_MIDPOINT
Definition enums.h:4827
@ BTL_CAM_MIDPOINT_CLOSE
Definition enums.h:4832
@ BTL_CAM_GOOMBARIO_BONK_FOLLOWUP_1
Definition enums.h:4872
@ BTL_CAM_PLAYER_HAMMER_QUAKE
Definition enums.h:4868
@ BTL_CAM_RETURN_HOME
Definition enums.h:4826
@ BTL_CAM_PRESET_UNUSED_2A
Definition enums.h:4864
@ BTL_CAM_CLOSER_PARTNER_APPROACH
Definition enums.h:4870
@ BTL_CAM_PARTNER_INJURED
Definition enums.h:4876
@ BTL_CAM_PRESET_UNUSED_46
Definition enums.h:4892
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_PLAYER_PRE_ULTRA_JUMP_FINISH
Definition enums.h:4850
@ BTL_CAM_INTERRUPT
Definition enums.h:4823
@ BTL_CAM_PRESET_UNUSED_3C
Definition enums.h:4882
@ BTL_CAM_ACTOR_GOAL
Definition enums.h:4839
@ BTL_CAM_PLAYER_FLEE
Definition enums.h:4847
@ BTL_CAM_VICTORY
Definition enums.h:4845
@ BTL_CAM_ACTOR_SIMPLE
Definition enums.h:4830
@ BTL_CAM_PLAYER_MISTAKE
Definition enums.h:4851
@ BTL_CAM_PARTNER_MIDAIR
Definition enums.h:4874
@ BTL_CAM_ACTOR_GOAL_SIMPLE
Definition enums.h:4829
@ BTL_CAM_PLAYER_ENTRY
Definition enums.h:4844
@ BTL_CAM_PLAYER_PRE_JUMP_FINISH
Definition enums.h:4849
@ BTL_CAM_PRESET_UNUSED_2D
Definition enums.h:4867
@ BTL_CAM_PLAYER_AIM_HAMMER
Definition enums.h:4865
@ BTL_CAM_PLAYER_HIT_HAZARD
Definition enums.h:4853
@ BTL_CAM_PRESET_UNUSED_43
Definition enums.h:4889
@ BTL_CAM_PRESET_UNUSED_48
Definition enums.h:4894
@ BTL_CAM_ACTOR
Definition enums.h:4836
@ BTL_CAM_REPOSITION
Definition enums.h:4841
@ BTL_CAM_ACTOR_GOAL_FAR
Definition enums.h:4840
@ BTL_CAM_ACTOR_CLOSE
Definition enums.h:4835
@ BTL_CAM_ACTOR_FAR
Definition enums.h:4837
@ BTL_CAM_PRESET_UNUSED_39
Definition enums.h:4879
@ BTL_CAM_ACTOR_GOAL_NEAR
Definition enums.h:4838
@ BTL_CAM_PLAYER_JUMP_FINISH_CLOSE
Definition enums.h:4858
@ BTL_CAM_PRESET_UNUSED_3A
Definition enums.h:4880
@ BTL_CAM_PLAYER_WISH
Definition enums.h:4891
@ BTL_CAM_PLAYER_MULTIBOUNCE
Definition enums.h:4862
@ BTL_CAM_PLAYER_SUPER_JUMP_MIDAIR
Definition enums.h:4859
@ BTL_CAM_PRESET_UNUSED_40
Definition enums.h:4886
@ BTL_CAM_PARTNER_GOOMPA
Definition enums.h:4877
@ BTL_CAM_STAR_SPIRIT
Definition enums.h:4895
@ BTL_CAM_ENEMY_DIVE
Definition enums.h:4888
@ BTL_CAM_PLAYER_HAMMER_STRIKE
Definition enums.h:4866
@ BTL_CAM_FOLLOW_ACTOR_Y
Definition enums.h:4842
@ BTL_CAM_PLAYER_UNUSED_ULTRA_JUMP
Definition enums.h:4861
@ BTL_CAM_PRESET_UNUSED_38
Definition enums.h:4878
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ BTL_CAM_PRESET_UNUSED_44
Definition enums.h:4890
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4825
@ BTL_CAM_PARTNER_HIT_SPIKE
Definition enums.h:4883
@ BTL_CAM_FOLLOW_ACTOR_POS
Definition enums.h:4843
@ BTL_CAM_PLAYER_JUMP_FINISH
Definition enums.h:4857
@ BTL_CAM_PARTNER_CLOSE_UP
Definition enums.h:4881
@ BTL_CAM_PRESET_UNUSED_31
Definition enums.h:4871
@ BTL_CAM_PLAYER_JUMP_MIDAIR
Definition enums.h:4856
@ BTL_CAM_PARTNER_HIT_HAZARD
Definition enums.h:4884
@ BTL_CAM_PRESET_UNUSED_47
Definition enums.h:4893
@ BTL_CAM_SLOWER_DEFAULT
Definition enums.h:4887
@ BTL_CAM_PLAYER_HIT_SPIKE
Definition enums.h:4852
@ BTL_CAM_PLAYER_CHARGE_UP
Definition enums.h:4854
@ BTL_CAM_PLAYER_ULTRA_JUMP_MIDAIR
Definition enums.h:4860
@ BTL_CAM_RESET
Definition enums.h:4822
@ BTL_CAM_PLAYER_ATTACK_APPROACH
Definition enums.h:4848
@ BTL_CAM_PLAYER_DIES
Definition enums.h:4846
@ BTL_CAM_PLAYER_STATUS_AFFLICTED
Definition enums.h:4855
@ BTL_CAM_SLOW_DEFAULT
Definition enums.h:4831
@ BTL_CAM_PARTNER_MISTAKE
Definition enums.h:4873
@ BTL_CAM_PRESET_UNUSED_29
Definition enums.h:4863
@ BTL_CAM_PARTNER_APPROACH
Definition enums.h:4869
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ EVT_PRIORITY_A
Definition evt.h:153
@ EVT_FLAG_RUN_IMMEDIATELY
don't wait for next update_scripts call
Definition evt.h:161
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
void kill_script_by_ID(s32 id)
struct Evt * camMovementScript

Referenced by btl_cam_use_preset(), and btl_cam_use_preset_immediately().

◆ btl_cam_use_preset_immediately()

void btl_cam_use_preset_immediately ( s32 preset)

Definition at line 1912 of file camera.c.

1912 {
1913 if (!BattleCam_IsFrozen) {
1914 BattleCam_SetImmediately = TRUE;
1916 }
1917}
void btl_cam_use_preset_impl(s32 id)
Definition camera.c:1187

◆ btl_cam_use_preset()

◆ btl_cam_target_actor()

void btl_cam_target_actor ( s32 actorID)

◆ btl_cam_target_actor_part()

void btl_cam_target_actor_part ( s32 actorID,
s32 actorPartIndex )

Definition at line 1932 of file camera.c.

1932 {
1933 if (!BattleCam_IsFrozen) {
1934 BattleCam_SubjectActor = actorID;
1935 BattleCam_SubjectActorPart = actorPartIndex;
1936 }
1937}

◆ btl_cam_set_params()

void btl_cam_set_params ( b16 skipRecalc,
s16 boomLength,
s16 vfovScale,
s16 boomPitch,
s32 boomYaw,
s32 boomZOffset,
s32 zoomPercent )

Definition at line 1939 of file camera.c.

1939 {
1940 Camera* camera = &gCameras[CAM_BATTLE];
1941
1942 if (!BattleCam_IsFrozen) {
1943 camera->params.basic.skipRecalc = skipRecalc;
1944 camera->params.basic.dist = boomLength;
1945 camera->params.basic.fovScale = vfovScale;
1946 camera->params.basic.pitch = boomPitch;
1947 camera->params.basic.yaw = boomYaw;
1948 camera->params.basic.offsetY = boomZOffset * 256;
1949 camera->params.basic.zoomPercent = zoomPercent;
1950 }
1951}
@ CAM_BATTLE
Definition enums.h:1801
union Camera::@17 params
Camera gCameras[4]
Definition cam_main.c:17

Referenced by btl_state_update_celebration().

◆ btl_cam_move()

◆ btl_cam_set_target_pos()

void btl_cam_set_target_pos ( f32 x,
f32 y,
f32 z )

Definition at line 1962 of file camera.c.

1962 {
1963 if (!BattleCam_IsFrozen) {
1964 BattleCam_PosX = x;
1965 BattleCam_PosY = y;
1966 BattleCam_PosZ = z;
1967 }
1968}

Referenced by btl_cam_use_preset_impl(), and btl_state_update_change_partner().

◆ btl_cam_set_pos()

void btl_cam_set_pos ( f32 x,
f32 y,
f32 z )

Definition at line 1970 of file camera.c.

1970 {
1971 Camera* camera = &gCameras[CAM_BATTLE];
1972
1973 if (!BattleCam_IsFrozen) {
1974 camera->lookAt_obj_target.x = x;
1975 camera->lookAt_obj_target.y = y;
1976 camera->lookAt_obj_target.z = z;
1977 }
1978}
Vec3f lookAt_obj_target

◆ btl_cam_is_moving_done()

s32 btl_cam_is_moving_done ( void )

Definition at line 1980 of file camera.c.

1980 {
1981 return BattleCam_DoneMoving;
1982}

Referenced by btl_state_update_begin_partner_turn(), btl_state_update_begin_player_turn(), and btl_state_update_celebration().

◆ btl_cam_set_zoom()

void btl_cam_set_zoom ( s16 zoom)

Definition at line 1984 of file camera.c.

1984 {
1985 if (!BattleCam_IsFrozen) {
1986 BattleCam_BoomLength = zoom;
1987 }
1988}

Referenced by btl_state_update_change_partner().

◆ btl_cam_add_zoom()

void btl_cam_add_zoom ( s32 zoom)

Definition at line 1990 of file camera.c.

1990 {
1991 if (!BattleCam_IsFrozen) {
1992 BattleCam_BoomLength += zoom;
1993 }
1994}

◆ btl_cam_set_zoffset()

void btl_cam_set_zoffset ( s16 zOffset)

Definition at line 1996 of file camera.c.

1996 {
1997 if (!BattleCam_IsFrozen) {
1998 BattleCam_BoomOffsetY = zOffset;
1999 }
2000}

Referenced by btl_state_update_change_partner().

◆ btl_cam_unfreeze()

void btl_cam_unfreeze ( void )

Definition at line 2002 of file camera.c.

2002 {
2003 BattleCam_IsFrozen = FALSE;
2004}

Referenced by btl_state_update_end_battle().

◆ btl_cam_disable_clamp_x()

void btl_cam_disable_clamp_x ( void )

Definition at line 2006 of file camera.c.

2006 {
2007 BattleCam_ClampPosX = FALSE;
2008}

Variable Documentation

◆ BattleCam_IsFrozen

◆ BattleCam_CurrentPresetID

s32 BattleCam_CurrentPresetID = -1

Definition at line 38 of file camera.c.

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_Interrupt

EvtScript EVS_BattleCam_Interrupt
Initial value:
= {
Call(BattleCam_Update_Interrupt)
}
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 1084 of file camera.c.

1084 {
1085 Call(BattleCam_Update_Interrupt)
1086 Return
1087 End
1088};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FocusMidpointA

EvtScript EVS_BattleCam_FocusMidpointA
Initial value:
= {
Call(BattleCam_Update_FocusMidpointA)
}

Definition at line 1090 of file camera.c.

1090 {
1091 Call(BattleCam_Update_FocusMidpointA)
1092 Return
1093 End
1094};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FocusMidpointB

EvtScript EVS_BattleCam_FocusMidpointB
Initial value:
= {
Call(BattleCam_Update_FocusMidpointB)
}

Definition at line 1096 of file camera.c.

1096 {
1097 Call(BattleCam_Update_FocusMidpointB)
1098 Return
1099 End
1100};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FocusActorPart

EvtScript EVS_BattleCam_FocusActorPart
Initial value:
= {
Call(BattleCam_Update_FocusActorPart)
}

Definition at line 1102 of file camera.c.

1102 {
1103 Call(BattleCam_Update_FocusActorPart)
1104 Return
1105 End
1106};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FocusActor

EvtScript EVS_BattleCam_FocusActor
Initial value:
= {
Call(BattleCam_Update_FocusActor)
}

Definition at line 1108 of file camera.c.

1108 {
1109 Call(BattleCam_Update_FocusActor)
1110 Return
1111 End
1112};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FocusGoal

EvtScript EVS_BattleCam_FocusGoal
Initial value:
= {
Call(BattleCam_Update_FocusGoal)
}

Definition at line 1114 of file camera.c.

1114 {
1115 Call(BattleCam_Update_FocusGoal)
1116 Return
1117 End
1118};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_SimpleLerp_Unskippable

EvtScript EVS_BattleCam_SimpleLerp_Unskippable
Initial value:
= {
Call(BattleCam_Update_SimpleLerp_Unskippable)
}

Definition at line 1120 of file camera.c.

1120 {
1121 Call(BattleCam_Update_SimpleLerp_Unskippable)
1122 Return
1123 End
1124};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_ResetNeutral

EvtScript EVS_BattleCam_ResetNeutral
Initial value:
= {
Call(BattleCam_Update_ResetToNeutral_Skippable)
}

Definition at line 1126 of file camera.c.

1126 {
1127 Call(BattleCam_Update_ResetToNeutral_Skippable)
1128 Return
1129 End
1130};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_ViewEnemies

EvtScript EVS_BattleCam_ViewEnemies
Initial value:
= {
Call(BattleCam_Update_ViewAllEnemies)
}

Definition at line 1132 of file camera.c.

1132 {
1133 Call(BattleCam_Update_ViewAllEnemies)
1134 Return
1135 End
1136};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_ViewEnemies_MaintainY

EvtScript EVS_BattleCam_ViewEnemies_MaintainY
Initial value:
= {
Call(BattleCam_Update_ViewAllEnemies_MaintainY)
}

Definition at line 1138 of file camera.c.

1138 {
1139 Call(BattleCam_Update_ViewAllEnemies_MaintainY)
1140 Return
1141 End
1142};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_SimpleLerp_Skippable

EvtScript EVS_BattleCam_SimpleLerp_Skippable
Initial value:
= {
Call(BattleCam_Update_SimpleLerp_Skippable)
}

Definition at line 1144 of file camera.c.

1144 {
1145 Call(BattleCam_Update_SimpleLerp_Skippable)
1146 Return
1147 End
1148};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FollowActorY

EvtScript EVS_BattleCam_FollowActorY
Initial value:
= {
Call(BattleCam_Update_FollowActorY)
}

Definition at line 1150 of file camera.c.

1150 {
1151 Call(BattleCam_Update_FollowActorY)
1152 Return
1153 End
1154};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_FollowActorPos

EvtScript EVS_BattleCam_FollowActorPos
Initial value:
= {
Call(BattleCam_Update_FollowActorPos)
}

Definition at line 1156 of file camera.c.

1156 {
1157 Call(BattleCam_Update_FollowActorPos)
1158 Return
1159 End
1160};

Referenced by btl_cam_use_preset_impl().

◆ EVS_BattleCam_Reset

EvtScript EVS_BattleCam_Reset
Initial value:
= {
Call(ForceBattleCamTarget, 0, 15, 0)
Call(SetBattleCamParam, CAM_PARAM_BOOM_LENGTH, 550)
Call(SetBattleCamParam, CAM_PARAM_FOV_SCALE, 100)
Call(SetBattleCamParam, CAM_PARAM_BOOM_PITCH, 8)
}
@ CAM_PARAM_BOOM_PITCH
Definition enums.h:1817
@ CAM_PARAM_BOOM_LENGTH
Definition enums.h:1815
@ CAM_PARAM_FOV_SCALE
Definition enums.h:1816

Definition at line 1162 of file camera.c.

1162 {
1163 Call(ForceBattleCamTarget, 0, 15, 0)
1164 Call(SetBattleCamParam, CAM_PARAM_BOOM_LENGTH, 550)
1165 Call(SetBattleCamParam, CAM_PARAM_FOV_SCALE, 100)
1166 Call(SetBattleCamParam, CAM_PARAM_BOOM_PITCH, 8)
1167 Return
1168 End
1169};

Referenced by btl_cam_use_preset_impl().

◆ EVS_OnBattleInit

EvtScript EVS_OnBattleInit
Initial value:
= {
Call(SetCamViewport, CAM_BATTLE, 12, 20, 296, 200)
Wait(1)
Call(SetNoInterpCamParams, CAM_BATTLE, FALSE, 240, 100, 8)
Call(BattleCamTargetActor, 0)
Call(BattleCam_Init)
}
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
ApiStatus SetCamEnabled(Evt *script, b32 isInitialCall)
ApiStatus SetCamViewport(Evt *script, b32 isInitialCall)
ApiStatus InitVirtualEntityList(Evt *script, b32 isInitialCall)
ApiStatus InitAnimatedModels(Evt *script, b32 isInitialCall)
ApiStatus SetCamLookTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamBGColor(Evt *script, b32 isInitialCall)
ApiStatus SetNoInterpCamParams(Evt *script, b32 isInitialCall)
ApiStatus SetCamPerspective(Evt *script, b32 isInitialCall)
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254

Definition at line 1171 of file camera.c.

1171 {
1173 Call(SetCamViewport, CAM_BATTLE, 12, 20, 296, 200)
1174 Call(SetCamBGColor, CAM_BATTLE, 0, 0, 0)
1176 Wait(1)
1179 Call(SetNoInterpCamParams, CAM_BATTLE, FALSE, 240, 100, 8)
1180 Call(SetCamLookTarget, CAM_BATTLE, -75, 35, 0)
1181 Call(BattleCamTargetActor, 0)
1182 Call(BattleCam_Init)
1183 Return
1184 End
1185};

Referenced by btl_state_update_normal_start().