Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
fighter_camera.c
Go to the documentation of this file.
1/* FIGHTSTG's fighter cameras, which a fighter's model control moves. */
2
4
5/* Sets layer 0x1009's view to the fighter camera's, with its rotation and
6 translation, and counts down one of the frames it is set for */
8 Layer *layer;
9
10 RotMatrixYXZ_gte(&task->rot, &task->coord.coord);
11 task->coord.flg = 0;
12 task->view.super = &task->coord;
13 task->coord.coord.t[0] = task->trans.vx;
14 task->coord.coord.t[1] = task->trans.vy;
15 task->coord.coord.t[2] = task->trans.vz;
16 GsSetRefView2(&task->view);
17 layer = GFX.funcs.getLayer(0x1009);
18 layer->setKeepView(layer, 1, task->proj);
19 task->frames--;
20}
21
22/* Loads a fighter camera's view from its fighter's camera 6, or 7 while the
23 model has an idle motion, with no rotation or translation */
26 s32 i = 6;
27
28 if (task->control->idleMotion != 0) {
29 i = 7;
30 }
31 task->view.vpx = info->camPos[i].x;
32 task->view.vpy = -info->camPos[i].y;
33 task->view.vpz = -info->camPos[i].z;
34 task->view.vrx = info->camRef[i].x;
35 task->view.vry = -info->camRef[i].y;
36 task->view.vrz = -info->camRef[i].z;
37 task->proj = info->camProj[i];
38 task->rot.vx = 0;
39 task->rot.vy = 0;
40 task->rot.vz = 0;
41 task->trans.vx = 0;
42 task->trans.vy = 0;
43 task->trans.vz = 0;
44}
45
46/* The fighter camera's task: once layer 0x1009 is there, loads the view and
47 sets it for two frames */
49 switch (task->state) {
50 case TASK_INIT:
51 default:
52 task->nextState(task);
53 /* fallthrough */
54 case TASK_RUN:
55 switch (task->step) {
56 case 0:
57 default:
58 if (GFX.funcs.getLayer(0x1009) != NULL) {
60 task->frames = 2;
61 task->nextStep(task);
62 }
63 break;
64 case 1:
65 break;
66 }
67 if (task->frames != 0) {
69 }
70 break;
71 case TASK_DONE:
72 case TASK_KILL:
73 break;
74 }
75}
76
77/* Creates the camera of a fighter of the partner view, on control's model */
80
81 task->fighter = fighter;
82 task->control = control;
83 return task;
84}
FighterCache FIGHTSTG_fighterCache
the fighters' data, loaded one at a time
Definition battle.c:21
FIGHTSTG.PRO: the battle.
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
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_applyCamera(FighterCamera *task)
Sets layer 0x1009's view to the fighter camera's, with its rotation and translation,...
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,...
FighterInfoFuncs funcs
Definition model.h:272
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
void(* nextStep)(struct FighterCamera *task)
Definition camera.h:14
void(* nextState)(struct FighterCamera *task)
Definition camera.h:14
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
FighterInfo *(* getInfo)(s32 id)
Definition model.h:258
A fighter's entry in its file, from FIGHTSTG_fighterCache.funcs.getInfo.
Definition model.h:225
s16 camProj[12]
Definition model.h:236
ShortVec3 camPos[12]
the cameras that look at it; an enemy has 3 of each and then their count
Definition model.h:233
ShortVec3 camRef[12]
Definition model.h:235
struct Layer *(* getLayer)(s32 id)
Definition gfx.h:28
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* setKeepView)()
Definition gfx.h:164
What drives a Model, owned by whoever created it.
Definition model.h:99
s32 idleMotion
Definition model.h:106
s16 x
Definition model.h:15
s16 z
Definition model.h:17
s16 y
Definition model.h:16
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105