1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
/**
* d_a_obj_wood_pendulum.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_wood_pendulum.h"
static int CheckCreateHeap(fopAc_ac_c* i_this) {
return static_cast<daObjWPndlm_c*>(i_this)->CreateHeap();
}
void daObjWPndlm_c::initBaseMtx() {
mpModel->setBaseScale(scale);
setBaseMtx();
}
void daObjWPndlm_c::setBaseMtx() {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z + field_0x958);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
const static dCcD_SrcSph l_sph_src = {
{
{0x0, {{AT_TYPE_CSTATUE_SWING, 0x0, 0xd}, {0x0, 0x10}, 0x0}}, // mObj
{dCcD_SE_NONE, 0x0, 0x1, 0x0, 0x8}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 150.0f} // mSph
} // mSphAttr
};
const static dCcD_SrcSph l_sph_src2 = {
{
{0x0, {{0x0, 0x0, 0xc}, {0xd8fafdff, 0x11}, 0x0}}, // mObj
{dCcD_SE_NONE, 0x0, 0x1, 0x0, 0x8}, // mGObjAt
{dCcD_SE_NONE, 0x2, 0x0, 0x0, 0x3}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 120.0f} // mSph
} // mSphAttr
};
int daObjWPndlm_c::Create() {
initBaseMtx();
cullMtx = mpModel->getBaseTRMtx();
mStts.Init(0xff, 0xff, this);
mSph.Set(l_sph_src);
mSph.SetStts(&mStts);
for (int i = 0; i < 2; i++) {
field_0x6e8[i].Set(l_sph_src2);
field_0x6e8[i].SetStts(&mStts);
}
fopAcM_setCullSizeBox2(this, mpModel->getModelData());
u8 arg0 = getArg0();
if (arg0 == 0 || arg0 == 255) {
arg0 = 0;
}
field_0x958 = DEG2S(arg0);
return 1;
}
static char* l_arcName = "A_Turuki";
int daObjWPndlm_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 3);
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (mpModel == NULL) {
return 0;
}
return 1;
}
int daObjWPndlm_c::create() {
int phase;
fopAcM_ct(this, daObjWPndlm_c);
phase = dComIfG_resLoad(&mPhaseReq, l_arcName);
if (phase == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x1be0)) {
return cPhs_ERROR_e;
} else if (!Create()) {
return cPhs_ERROR_e;
}
}
return phase;
}
int daObjWPndlm_c::execute() {
u8 arg1 = getArg1();
if (arg1 == 0 || arg1 == 255) {
arg1 = 10;
}
if (field_0x958 > 0) {
field_0x95c = -arg1;
} else if (field_0x958 < 0) {
field_0x95c = arg1;
} else {
field_0x95c = 0;
}
field_0x95a += field_0x95c;
field_0x958 += field_0x95a;
setBaseMtx();
cXyz local_48(0, -1200, 0);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z + field_0x958);
mDoMtx_stack_c::multVec(&local_48, &local_48);
mSph.SetC(local_48);
dComIfG_Ccsp()->Set(&mSph);
Vec lit_3826[2] = {{-60.0f, -1120.0f, 100.0f}, {80.0f, -1230.0f, -50.0f}};
for (int i = 0; i < 2; i++) {
local_48 = lit_3826[i];
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z + field_0x958);
mDoMtx_stack_c::multVec(&local_48, &local_48);
field_0x6e8[i].SetC(local_48);
dComIfG_Ccsp()->Set(&field_0x6e8[i]);
}
return 1;
}
int daObjWPndlm_c::draw() {
g_env_light.settingTevStruct(0, &this->current.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
mDoExt_modelUpdateDL(mpModel);
return 1;
}
int daObjWPndlm_c::_delete() {
dComIfG_resDelete(&mPhaseReq, l_arcName);
return 1;
}
static int daObjWPndlm_Draw(daObjWPndlm_c* i_this) {
return static_cast<daObjWPndlm_c*>(i_this)->draw();
}
static int daObjWPndlm_Execute(daObjWPndlm_c* i_this) {
return static_cast<daObjWPndlm_c*>(i_this)->execute();
}
static int daObjWPndlm_Delete(daObjWPndlm_c* i_this) {
return static_cast<daObjWPndlm_c*>(i_this)->_delete();
}
static int daObjWPndlm_Create(fopAc_ac_c* i_this) {
return static_cast<daObjWPndlm_c*>(i_this)->create();
}
static actor_method_class l_daObjWPndlm_Method = {
(process_method_func)daObjWPndlm_Create, (process_method_func)daObjWPndlm_Delete,
(process_method_func)daObjWPndlm_Execute, 0,
(process_method_func)daObjWPndlm_Draw,
};
actor_process_profile_definition g_profile_Obj_WoodPendulum = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 7,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_Obj_WoodPendulum_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daObjWPndlm_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_Obj_WoodPendulum_e,
/* Actor SubMtd */ &l_daObjWPndlm_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|