Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
camera.h
Go to the documentation of this file.
1#ifndef FIGHTSTG_CAMERA_H
2#define FIGHTSTG_CAMERA_H
3
4/* FIGHTSTG's cameras: the fighters' cameras, the shot camera, the battle
5 camera and its views, and the camera turns (fighter_camera.c,
6 shot_camera.c, battle_camera.c and camera_task.c). */
7
10
11/* A fighter's camera (FIGHTSTG_createCamera) on layer 0x1009, from its
12 FighterInfo; frames counts the frames it still has to be set */
13typedef struct FighterCamera {
15 /* 0x50 */ s32 fighter;
16 /* 0x54 */ ModelControl *control;
17 /* 0x58 */ GsRVIEW2 view;
18 /* 0x78 */ s32 proj; /* the projection distance */
19 /* 0x7C */ GsCOORDINATE2 coord; /* the view's */
20 /* 0xCC */ SVECTOR rot;
21 /* 0xD4 */ VECTOR trans;
22 /* 0xE4 */ s32 frames;
24
25/* A shot of FIGHTSTG_updateShotCamera's camera */
26typedef struct CameraShot {
27 /* 0x0 */ s16 time; /* -1 ends the list */
28 /* 0x2 */ s16 substate;
30
31/* A camera (FIGHTSTG_createShotCamera) that goes through lists of shots
32 (FIGHTSTG_cameraShots), the next list picked at random
33 (FIGHTSTG_nextShotLists) */
34typedef struct ShotCamera {
36 /* 0x50 */ struct BattleCamera *camera;
37 /* 0x54 */ struct CameraView *view;
38 /* 0x58 */ struct Models *models;
39 /* 0x5C */ s16 list;
40 /* 0x5E */ s16 shot;
41 /* 0x60 */ s16 ry; /* where the turn of substate 1 is */
42 /* 0x62 */ s16 turned;
43 /* 0x64 */ s32 time;
44 /* 0x68 */ s32 speed;
46
47/* Where the battle camera looks from and to, as a GsRVIEW2 with the
48 transform of its coordinate system */
49typedef struct CameraView {
50 /* 0x00 */ s32 vpx;
51 /* 0x04 */ s32 vpy;
52 /* 0x08 */ s32 vpz;
53 /* 0x0C */ s32 vrx;
54 /* 0x10 */ s32 vry;
55 /* 0x14 */ s32 vrz;
56 /* 0x18 */ s32 tx;
57 /* 0x1C */ s32 ty;
58 /* 0x20 */ s32 tz;
59 /* 0x24 */ SVECTOR rot;
60 /* 0x2C */ s32 rz; /* the roll, in degrees */
61 /* 0x30 */ s32 proj; /* the projection distance */
63
64/* The battle camera (FIGHTSTG_createBattleCamera), registered as BATTLE_TASK_CAMERA on
65 a layer: set puts a view, fade goes from one to another in time frames */
66typedef struct BattleCamera {
68 /* 0x050 */ s32 layerId;
69 /* 0x054 */ CameraView current;
70 /* 0x088 */ CameraView to;
71 /* 0x0BC */ CameraView from;
72 /* 0x0F0 */ s32 t; /* 0-0x1000 */
73 /* 0x0F4 */ s32 tStep; /* per frame, << 8 */
74 /* 0x0F8 */ void (*set)(struct BattleCamera *task, CameraView *view);
75 /* 0x0FC */ void (*fade)(struct BattleCamera *task, CameraView *from, CameraView *to, s32 time); /* from: NULL for the current */
76 /* 0x100 */ CameraView *(*getEnemyView)(struct BattleCamera *task);
77 /* 0x104 */ CameraView *(*getFighterView)(struct BattleCamera *task, s32 id, s32 camera);
79
81
82/* The European version's camera (FIGHTSTG_startCameraShots): one of three lists of shots
83 (FIGHTSTG_euCameraShots) picked at random, then back to the enemy's view */
84typedef struct CameraShots {
86 /* 0x50 */ struct BattleCamera *camera;
87 /* 0x54 */ struct CameraView *view;
88 /* 0x58 */ struct Models *models;
89 /* 0x5C */ s16 list;
90 /* 0x5E */ s16 shot;
91 /* 0x60 */ s16 ry; /* where the turn of substate 6 starts */
92 /* 0x62 */ s16 rx;
93 /* 0x64 */ s32 pad64; /* never read or written */
94 /* 0x68 */ s32 time;
95 /* 0x6C */ s32 pad6C; /* never read or written */
96 /* 0x70 */ struct CameraView to; /* where substates 4 and 5 fade to */
98
99/* The camera's turn around the fighters when the player loses
100 (FIGHTSTG_updateCameraTurn) */
105
106/* The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS */
109
110/* Shared between the overlay's objects */
126extern u8 FIGHTSTG_nextShotLists[8][3];
127#if VERSION_EU || VERSION_JP
129#endif
130
131#endif /* FIGHTSTG_CAMERA_H */
FIGHTSTG's shared declarations: the headers it builds on, the ids its tasks register with,...
CameraView * FIGHTSTG_getFighterView(BattleCamera *task, s32 id, s32 camera)
The view of a fighter's camera (id as Models.getFighter takes it), which ends the battle camera's fad...
FighterCamera * FIGHTSTG_createCamera(s32 fighter, ModelControl *control)
Creates the camera of a fighter of the partner view, on control's model.
void FIGHTSTG_updateCamera(FighterCamera *task)
The fighter camera's task: once layer 0x1009 is there, loads the view and sets it for two frames.
void FIGHTSTG_updateBattleCamera(BattleCamera *task)
The battle camera's task: fades its view from from to to (position, reference, translation,...
void FIGHTSTG_updateShotCamera(ShotCamera *task)
Shared between the overlay's objects.
CameraView * FIGHTSTG_getEnemyView(BattleCamera *task)
The view of the enemy's last camera.
CameraShot FIGHTSTG_cameraShots[4][6]
FIGHTSTG_updateShotCamera's shots: how long each lasts and the substate that makes it,...
Definition shot_camera.c:8
void FIGHTSTG_updateCameraShots(CameraShots *task)
A camera of the European version's own: one of the three lists of shots of FIGHTSTG_euCameraShots,...
Definition camera_task.c:23
void FIGHTSTG_setBattleCameraView(BattleCamera *task, CameraView *view)
BattleCamera.set: puts the battle camera at view.
void FIGHTSTG_applyCamera(FighterCamera *task)
Sets layer 0x1009's view to the fighter camera's, with its rotation and translation,...
void FIGHTSTG_fadeBattleCamera(BattleCamera *task, CameraView *from, CameraView *to, s32 time)
BattleCamera.fade: fades the battle camera from from (or where it is) to to over time frames.
BattleCamera * FIGHTSTG_createBattleCamera(s32 layerId)
Creates the battle camera (BATTLE_TASK_CAMERA) on a layer.
CameraTurn * FIGHTSTG_startCameraTurn(void)
The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS.
Definition camera_turn.h:59
ShotCamera * FIGHTSTG_createShotCamera(void)
Starts the camera that plays lists of shots (FIGHTSTG_updateShotCamera)
CameraShots * FIGHTSTG_startCameraShots(void)
Starts the European version's own camera.
void FIGHTSTG_updateCameraTurn(CameraTurn *task, BattleScript **children)
When the player loses, turns the camera around the fighters, from the first fighter's view 0xB,...
Definition camera_turn.h:10
u8 FIGHTSTG_nextShotLists[8][3]
the lists that can follow each one
Definition shot_camera.c:15
void FIGHTSTG_loadCamera(FighterCamera *task)
Loads a fighter camera's view from its fighter's camera 6, or 7 while the model has an idle motion,...
CameraShot FIGHTSTG_euCameraShots[3][3]
the lists of shots of the European version's own camera (FIGHTSTG_updateCameraShots)
Definition camera_task.c:12
CameraView FIGHTSTG_fighterView
the view FIGHTSTG_getFighterView makes
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
FIGHTSTG's models: meshes and their drawing, bones, motions, the models task and its controls,...
The battle camera (FIGHTSTG_createBattleCamera), registered as BATTLE_TASK_CAMERA on a layer: set put...
Definition camera.h:66
s32 t
0-0x1000
Definition camera.h:72
CameraView current
Definition camera.h:69
CameraView to
Definition camera.h:70
s32 layerId
Definition camera.h:68
s32 tStep
per frame, << 8
Definition camera.h:73
CameraView from
Definition camera.h:71
void(* set)(struct BattleCamera *task, CameraView *view)
Definition camera.h:74
void(* fade)(struct BattleCamera *task, CameraView *from, CameraView *to, s32 time)
from: NULL for the current
Definition camera.h:75
A fighter's battle script (FIGHTSTG_updateBattleScript): a list of s16 commands in an archive entry o...
Definition effect.h:144
A shot of FIGHTSTG_updateShotCamera's camera.
Definition camera.h:26
s16 substate
Definition camera.h:28
s16 time
-1 ends the list
Definition camera.h:27
The European version's camera (FIGHTSTG_startCameraShots): one of three lists of shots (FIGHTSTG_euCa...
Definition camera.h:84
struct Models * models
Definition camera.h:88
s32 pad64
never read or written
Definition camera.h:93
struct BattleCamera * camera
Definition camera.h:86
s32 time
Definition camera.h:94
struct CameraView to
where substates 4 and 5 fade to
Definition camera.h:96
s16 shot
Definition camera.h:90
s16 ry
where the turn of substate 6 starts
Definition camera.h:91
s32 pad6C
never read or written
Definition camera.h:95
struct CameraView * view
Definition camera.h:87
s16 list
Definition camera.h:89
The camera's turn around the fighters when the player loses (FIGHTSTG_updateCameraTurn)
Definition camera.h:101
BattleCamera * camera
Definition camera.h:103
Where the battle camera looks from and to, as a GsRVIEW2 with the transform of its coordinate system.
Definition camera.h:49
s32 vry
Definition camera.h:54
s32 vpy
Definition camera.h:51
s32 tz
Definition camera.h:58
s32 tx
Definition camera.h:56
s32 vrx
Definition camera.h:53
s32 rz
the roll, in degrees
Definition camera.h:60
s32 ty
Definition camera.h:57
SVECTOR rot
Definition camera.h:59
s32 vpx
Definition camera.h:50
s32 vpz
Definition camera.h:52
s32 proj
the projection distance
Definition camera.h:61
s32 vrz
Definition camera.h:55
A fighter's camera (FIGHTSTG_createCamera) on layer 0x1009, from its FighterInfo; frames counts the f...
Definition camera.h:13
GsCOORDINATE2 coord
the view's
Definition camera.h:19
VECTOR trans
Definition camera.h:21
s32 fighter
Definition camera.h:15
s32 proj
the projection distance
Definition camera.h:18
GsRVIEW2 view
Definition camera.h:17
SVECTOR rot
Definition camera.h:20
ModelControl * control
Definition camera.h:16
What drives a Model, owned by whoever created it.
Definition model.h:99
The fighters' models (FIGHTSTG_createModels), registered as BATTLE_TASK_MODELS: up to four,...
Definition model.h:284
A camera (FIGHTSTG_createShotCamera) that goes through lists of shots (FIGHTSTG_cameraShots),...
Definition camera.h:34
s16 ry
where the turn of substate 1 is
Definition camera.h:41
s32 speed
Definition camera.h:44
struct CameraView * view
Definition camera.h:37
s16 shot
Definition camera.h:40
struct BattleCamera * camera
Definition camera.h:36
struct Models * models
Definition camera.h:38
s16 turned
Definition camera.h:42
s32 time
Definition camera.h:43
s16 list
Definition camera.h:39