Skip to content

Commit

Permalink
d_a_obj_tumble_weed mostly done (#88)
Browse files Browse the repository at this point in the history
* mostly done

* Update d_t_tumble_weed.cpp

* remove cM::calcTimer

* just regswap on adjustSpeed

* Create inlines for angle between vectors

* name data symbols

---------

Co-authored-by: robojumper <robojumper@gmail.com>
  • Loading branch information
elijah-thomas774 and robojumper authored Nov 6, 2024
1 parent f509c05 commit c235e32
Show file tree
Hide file tree
Showing 34 changed files with 804 additions and 214 deletions.
3 changes: 3 additions & 0 deletions config/SOUE01/rels/d_a_obj_tumble_weedNP/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ REL/global_destructor_chain.c:
REL/d/a/obj/d_a_obj_tumble_weed.cpp:
.text start:0x000000F0 end:0x00002278
.ctors start:0x00000000 end:0x00000004
.rodata start:0x00000000 end:0x000000AC
.data start:0x00000000 end:0x0000024C
.bss start:0x00000008 end:0x000000A0
82 changes: 42 additions & 40 deletions config/SOUE01/rels/d_a_obj_tumble_weedNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@ _unresolved = .text:0x00000060; // type:function size:0x4 scope:global
__register_global_object = .text:0x00000070; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global
dAcOTumbleWeed_c_classInit__Fv = .text:0x000000F0; // type:function size:0x118
fn_475_210 = .text:0x00000210; // type:function size:0x58
__dt__15dShadowCircle_cFv = .text:0x00000210; // type:function size:0x58 scope:weak
__dt__29sFState_c<16dAcOTumbleWeed_c>Fv = .text:0x00000270; // type:function size:0x58
__dt__32sFStateFct_c<16dAcOTumbleWeed_c>Fv = .text:0x000002D0; // type:function size:0x6C
__dt__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000340; // type:function size:0xA0
__dt__55sFStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003E0; // type:function size:0xA4
fn_475_490 = .text:0x00000490; // type:function size:0x80
fn_475_510 = .text:0x00000510; // type:function size:0x1D8
createHeap__16dAcOTumbleWeed_cFv = .text:0x00000490; // type:function size:0x80
actorCreate__16dAcOTumbleWeed_cFv = .text:0x00000510; // type:function size:0x1D8
changeState__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x000006F0; // type:function size:0x10
fn_475_700 = .text:0x00000700; // type:function size:0x8
fn_475_710 = .text:0x00000710; // type:function size:0x8
fn_475_720 = .text:0x00000720; // type:function size:0x314
actorPostCreate__16dAcOTumbleWeed_cFv = .text:0x00000700; // type:function size:0x8
doDelete__16dAcOTumbleWeed_cFv = .text:0x00000710; // type:function size:0x8
actorExecute__16dAcOTumbleWeed_cFv = .text:0x00000720; // type:function size:0x314
executeState__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000A40; // type:function size:0x10
fn_475_A50 = .text:0x00000A50; // type:function size:0x1C
fn_475_A70 = .text:0x00000A70; // type:function size:0xE4
calcTimer<Us>__4sLibFPUs_Us = .text:0x00000A50; // type:function size:0x1C
draw__16dAcOTumbleWeed_cFv = .text:0x00000A70; // type:function size:0xE4
initializeState_Wait__16dAcOTumbleWeed_cFv = .text:0x00000B60; // type:function size:0xC
executeState_Wait__16dAcOTumbleWeed_cFv = .text:0x00000B70; // type:function size:0xD4
finalizeState_Wait__16dAcOTumbleWeed_cFv = .text:0x00000C50; // type:function size:0x4
initializeState_Slope__16dAcOTumbleWeed_cFv = .text:0x00000C60; // type:function size:0x4
executeState_Slope__16dAcOTumbleWeed_cFv = .text:0x00000C70; // type:function size:0xA0
finalizeState_Slope__16dAcOTumbleWeed_cFv = .text:0x00000D10; // type:function size:0x4
fn_475_D20 = .text:0x00000D20; // type:function size:0x118
fn_475_E40 = .text:0x00000E40; // type:function size:0x1C
fn_475_E60 = .text:0x00000E60; // type:function size:0x11C
fn_475_F80 = .text:0x00000F80; // type:function size:0x6C
fn_475_FF0 = .text:0x00000FF0; // type:function size:0x58
fn_475_1050 = .text:0x00001050; // type:function size:0x6C
fn_475_10C0 = .text:0x000010C0; // type:function size:0x684
fn_475_1750 = .text:0x00001750; // type:function size:0x58
fn_475_17B0 = .text:0x000017B0; // type:function size:0x1A8
fn_475_1960 = .text:0x00001960; // type:function size:0x68
fn_475_19D0 = .text:0x000019D0; // type:function size:0xA0
fn_475_1A70 = .text:0x00001A70; // type:function size:0x88
fn_475_1B00 = .text:0x00001B00; // type:function size:0x4C
fn_475_1B50 = .text:0x00001B50; // type:function size:0xD0
fn_475_1C20 = .text:0x00001C20; // type:function size:0x1C
fn_475_1C40 = .text:0x00001C40; // type:function size:0xAC
checkBreak__16dAcOTumbleWeed_cFv = .text:0x00000D20; // type:function size:0x118
fn_475_E40__16dAcOTumbleWeed_cCFv = .text:0x00000E40; // type:function size:0x1C
checkSlope__16dAcOTumbleWeed_cFv = .text:0x00000E60; // type:function size:0x11C
checkCollect__16dAcOTumbleWeed_cFv = .text:0x00000F80; // type:function size:0x6C
checkInvalidGround__16dAcOTumbleWeed_cCFv = .text:0x00000FF0; // type:function size:0x58
doBreak__16dAcOTumbleWeed_cFv = .text:0x00001050; // type:function size:0x6C
calcMatrix__16dAcOTumbleWeed_cFv = .text:0x000010C0; // type:function size:0x684
adjustAngle__16dAcOTumbleWeed_cFv = .text:0x00001750; // type:function size:0x58
adjustSpeed__16dAcOTumbleWeed_cFv = .text:0x000017B0; // type:function size:0x1A8
tumbleBounceMaybe__16dAcOTumbleWeed_cFv = .text:0x00001960; // type:function size:0x68
adjustTimeScale__16dAcOTumbleWeed_cFv = .text:0x000019D0; // type:function size:0xA0
adjustTumble__16dAcOTumbleWeed_cFRC7mVec3_c = .text:0x00001A70; // type:function size:0x88
setWind__16dAcOTumbleWeed_cFRC7mVec3_c = .text:0x00001B00; // type:function size:0x4C
calcWind__16dAcOTumbleWeed_cFv = .text:0x00001B50; // type:function size:0xD0
calcTimer<Uc>__4sLibFPUc_Uc = .text:0x00001C20; // type:function size:0x1C
getPosition__16dAcOTumbleWeed_cCFv = .text:0x00001C40; // type:function size:0xAC
__dt__16dAcOTumbleWeed_cFv = .text:0x00001CF0; // type:function size:0x10C
getStateID__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00001E00; // type:function size:0x10
build__32sFStateFct_c<16dAcOTumbleWeed_c>FRC12sStateIDIf_c = .text:0x00001E10; // type:function size:0x60
Expand Down Expand Up @@ -69,19 +69,21 @@ lbl_475_rodata_5C = .rodata:0x0000005C; // type:object size:0x4 data:float
lbl_475_rodata_60 = .rodata:0x00000060; // type:object size:0x4 data:float
lbl_475_rodata_64 = .rodata:0x00000064; // type:object size:0x48 data:float
g_profile_OBJ_TUMBLE_WEED = .data:0x00000000; // type:object size:0x10 data:4byte
lbl_475_data_10 = .data:0x00000010; // type:object size:0x2C
lbl_475_data_3C = .data:0x0000003C; // type:object size:0x10
lbl_475_data_4C = .data:0x0000004C; // type:object size:0x24
lbl_475_data_70 = .data:0x00000070; // type:object size:0x80
lbl_475_data_F0 = .data:0x000000F0; // type:object size:0x30
lbl_475_data_120 = .data:0x00000120; // type:object size:0x30
lbl_475_data_150 = .data:0x00000150; // type:object size:0x18
lbl_475_data_168 = .data:0x00000168; // type:object size:0x18
lbl_475_data_180 = .data:0x00000180; // type:object size:0x98
lbl_475_data_218 = .data:0x00000218; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
lbl_475_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte
lbl_475_bss_18 = .bss:0x00000018; // type:object size:0x40 data:4byte
lbl_475_bss_58 = .bss:0x00000058; // type:object size:0x30 data:4byte
lbl_475_bss_88 = .bss:0x00000088; // type:object size:0x8 data:byte
lbl_475_bss_90 = .bss:0x00000090; // type:object size:0x10 data:float
sSphSrc__16dAcOTumbleWeed_c = .data:0x00000010; // type:object size:0x2C
lbl_475_data_3C = .data:0x0000003C; // type:object size:0x10 scope:local
lbl_475_data_4C = .data:0x0000004C; // type:object size:0x24 scope:local
__vt__16dAcOTumbleWeed_c = .data:0x00000070; // type:object size:0x80
__vt__55sFStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c> = .data:0x000000F0; // type:object size:0x30
__vt__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x00000120; // type:object size:0x30
__vt__32sFStateFct_c<16dAcOTumbleWeed_c> = .data:0x00000150; // type:object size:0x14
__vt__29sFState_c<16dAcOTumbleWeed_c> = .data:0x00000168; // type:object size:0x18
__vt__15dShadowCircle_c = .data:0x00000180; // type:object size:0xC
lbl_475_data_18C = .data:0x0000018C; // type:object size:0x8C
__vt__31sFStateID_c<16dAcOTumbleWeed_c> = .data:0x00000218; // type:object size:0x34
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global data:4byte
lbl_475_bss_8 = .bss:0x00000008; // type:object size:0xC data:4byte
StateID_Wait__16dAcOTumbleWeed_c = .bss:0x00000018; // type:object size:0x30 data:4byte
lbl_475_bss_40 = .bss:0x00000048; // type:object size:0xC scope:local data:4byte
StateID_Slope__16dAcOTumbleWeed_c = .bss:0x00000058; // type:object size:0x30 data:4byte
@GUARD@draw__16dAcOTumbleWeed_cFv@shadowRot = .bss:0x00000088; // type:object size:0x1 scope:local data:byte
@LOCAL@draw__16dAcOTumbleWeed_cFv@shadowRot = .bss:0x00000090; // type:object size:0x10 scope:local data:float
2 changes: 1 addition & 1 deletion config/SOUE01/rels/d_t_gekotagNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ initializeState_Wait__10dTgGekoTagFv = .text:0x00000660; // type:function size:0
executeState_Wait__10dTgGekoTagFv = .text:0x00000670; // type:function size:0x4
finalizeState_Wait__10dTgGekoTagFv = .text:0x00000680; // type:function size:0x4
doExecute__10dTgGekoTagFv = .text:0x00000690; // type:function size:0x1A8
calcTimer<Us>__2cMFPUs_Us = .text:0x00000840; // type:function size:0x1C
calcTimer<Us>__4sLibFPUs_Us = .text:0x00000840; // type:function size:0x1C
__dt__10dTgGekoTagFv = .text:0x00000860; // type:function size:0xE0
getStateID__79sStateMgr_c<10dTgGekoTag,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00000940; // type:function size:0x10
build__26sFStateFct_c<10dTgGekoTag>FRC12sStateIDIf_c = .text:0x00000950; // type:function size:0x60
Expand Down
2 changes: 1 addition & 1 deletion config/SOUE01/rels/d_t_touchNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ executeState__80sStateMgr_c<11dTgTouchTag,20sStateMethodUsr_FI_c,12sFStateFct_c,
draw__11dTgTouchTagFv = .text:0x00000590; // type:function size:0x8
initializeState_Wait__11dTgTouchTagFv = .text:0x000005A0; // type:function size:0xC
executeState_Wait__11dTgTouchTagFv = .text:0x000005B0; // type:function size:0x138
calcTimer<Us>__2cMFPUs_Us = .text:0x000006F0; // type:function size:0x1C
calcTimer<Us>__4sLibFPUs_Us = .text:0x000006F0; // type:function size:0x1C
finalizeState_Wait__11dTgTouchTagFv = .text:0x00000710; // type:function size:0x4
__dt__11dTgTouchTagFv = .text:0x00000720; // type:function size:0xC8
getStateID__80sStateMgr_c<11dTgTouchTag,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x000007F0; // type:function size:0x10
Expand Down
2 changes: 1 addition & 1 deletion config/SOUE01/rels/d_t_tumble_weedNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ changeState__84sStateMgr_c<15dTgTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct
doDelete__15dTgTumbleWeed_cFv = .text:0x00000490; // type:function size:0x8
actorExecute__15dTgTumbleWeed_cFv = .text:0x000004A0; // type:function size:0x48
executeState__84sStateMgr_c<15dTgTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x000004F0; // type:function size:0x10
decr__FPUs = .text:0x00000500; // type:function size:0x1C
calcTimer<Us>__4sLibFPUs_Us = .text:0x00000500; // type:function size:0x1C
draw__15dTgTumbleWeed_cFv = .text:0x00000520; // type:function size:0x8
initializeState_AreaOut__15dTgTumbleWeed_cFv = .text:0x00000530; // type:function size:0x4
executeState_AreaOut__15dTgTumbleWeed_cFv = .text:0x00000540; // type:function size:0xA0
Expand Down
21 changes: 17 additions & 4 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1418,13 +1418,13 @@ fn_80037A30 = .text:0x80037A30; // type:function size:0xCC
fn_80037B00 = .text:0x80037B00; // type:function size:0x20
fn_80037B20 = .text:0x80037B20; // type:function size:0x4C
fn_80037B70 = .text:0x80037B70; // type:function size:0x1D4
calcTimer<Us>__2cMFPUs_Us = .text:0x80037D50; // type:function size:0x1C
calcTimer<Us>__4sLibFPUs_Us = .text:0x80037D50; // type:function size:0x1C
fn_80037D70 = .text:0x80037D70; // type:function size:0x158
fn_80037ED0 = .text:0x80037ED0; // type:function size:0x14
fn_80037EF0 = .text:0x80037EF0; // type:function size:0xA4
fn_80037FA0 = .text:0x80037FA0; // type:function size:0x220
fn_800381C0 = .text:0x800381C0; // type:function size:0x2F0
calcTimer<Uc>__2cMFPUc_Uc = .text:0x800384B0; // type:function size:0x1C
calcTimer<Uc>__4sLibFPUc_Uc = .text:0x800384B0; // type:function size:0x1C
fn_800384D0 = .text:0x800384D0; // type:function size:0x64
fn_80038540 = .text:0x80038540; // type:function size:0x108
fn_80038650 = .text:0x80038650; // type:function size:0x144
Expand Down Expand Up @@ -43853,7 +43853,20 @@ PARTICLE_RESOURCE_ID_MAPPING_721_ = .sdata2:0x8057A952; // type:object size:0x8
PARTICLE_RESOURCE_ID_MAPPING_725_ = .sdata2:0x8057A95A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_726_ = .sdata2:0x8057A95C; // type:object size:0x1A data:2byte
PARTICLE_RESOURCE_ID_MAPPING_739_ = .sdata2:0x8057A976; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_740_ = .sdata2:0x8057A978; // type:object size:0x1C data:2byte
PARTICLE_RESOURCE_ID_MAPPING_740_ = .sdata2:0x8057A978; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_741_ = .sdata2:0x8057A97A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_742_ = .sdata2:0x8057A97C; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_743_ = .sdata2:0x8057A97E; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_744_ = .sdata2:0x8057A980; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_745_ = .sdata2:0x8057A982; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_746_ = .sdata2:0x8057A984; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_747_ = .sdata2:0x8057A986; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_748_ = .sdata2:0x8057A988; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_749_ = .sdata2:0x8057A98A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_750_ = .sdata2:0x8057A98C; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_751_ = .sdata2:0x8057A98E; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_752_ = .sdata2:0x8057A990; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_753_ = .sdata2:0x8057A992; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_754_ = .sdata2:0x8057A994; // type:object size:0x18 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_766_ = .sdata2:0x8057A9AC; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_767_ = .sdata2:0x8057A9AE; // type:object size:0x2 data:2byte
Expand Down Expand Up @@ -45917,7 +45930,7 @@ lbl_8057CD8C = .sdata2:0x8057CD8C; // type:object size:0x4 data:float
sHalfCircleDeg__4mAng = .sdata2:0x8057CD90; // type:object size:0x4 data:float
sAngToDeg__4mAng = .sdata2:0x8057CD94; // type:object size:0x4 data:float
sAngToRad__4mAng = .sdata2:0x8057CD98; // type:object size:0x4 data:float
NotSure__4mAng = .sdata2:0x8057CD9C; // type:object size:0x4 data:float
sAngToNorm__4mAng = .sdata2:0x8057CD9C; // type:object size:0x4 data:float
sDegToRad__4mAng = .sdata2:0x8057CDA0; // type:object size:0x4 data:float
sDegToAng__4mAng = .sdata2:0x8057CDA4; // type:object size:0x4 data:float
sRadToAng__4mAng = .sdata2:0x8057CDA8; // type:object size:0x4 data:float
Expand Down
7 changes: 2 additions & 5 deletions include/c/c_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ f32 rndF(f32 max);
f32 rndFX(f32 amp);

template <typename T>
T calcTimer(T *value) {
if (*(T *)value != 0) {
*value = *value - 1;
}
return *value;
inline T minMaxLimit(T val, T min, T max) {
return (T)((T)val < (T)min ? (T)min : ((T)val > (T)max ? (T)max : (T)val));
}

} // namespace cM
Expand Down
2 changes: 1 addition & 1 deletion include/d/a/d_a_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class dAcPy_c : public dAcObjBase_c {
/* vt 0x284 */ virtual bool isUsingBugnet() const;
/* vt 0x288 */ virtual const mVec3_c &getBugNetPos() const;
/* vt 0x28C */ virtual void isUsingBugnet1();
/* vt 0x290 */ virtual void bugNetCollectTreasure();
/* vt 0x290 */ virtual void bugNetCollectTreasure(u32 itemId);
/* vt 0x294 */ virtual void somethingSwitchDials();
/* vt 0x298 */ virtual void vt_0x298();
/* vt 0x29C */ virtual void getDieLargeDamageDir();
Expand Down
10 changes: 9 additions & 1 deletion include/d/a/obj/d_a_obj_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#include "d/a/d_a_base.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_aab.h"
#include "egg/math/eggMath.h"
#include "m/m3d/m_shadow.h"
#include "m/m3d/m_smdl.h"
#include "m/m_angle.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "m/types_m.h"


// Size: 0xA8
struct ActorCarryStruct {
/* 0x00 */ fLiNdBa_c actorLink;
Expand Down Expand Up @@ -89,6 +89,14 @@ class dAcObjBase_c : public dAcBase_c {
return angle;
}

f32 getVelocityMag() const {
return fabsf(nw4r::math::VEC3LenSq(velocity));
}

bool isStopped() const {
return getVelocityMag() <= EGG::Math<f32>::epsilon();
}

// could be their own thing?
/* 8002de40 */ static void *getOarcFile(const char *oarcName, const char *fileName);
/* 8002de60 */ static void *getOarcSubEntry(const char *oarcName, const char *fileName);
Expand Down
76 changes: 73 additions & 3 deletions include/d/a/obj/d_a_obj_tumble_weed.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,90 @@
#ifndef D_A_OBJ_TUMBLE_WEED_H
#define D_A_OBJ_TUMBLE_WEED_H

#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_acch.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_shadow.h"
#include "m/m3d/m_smdl.h"
#include "m/m_mtx.h"
#include "m/m_quat.h"
#include "m/m_vec.h"
#include "nw4r/g3d/g3d_resfile.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/time_area_mgr.h"

class dAcOTumbleWeed_c : public dAcObjBase_c {
public:
dAcOTumbleWeed_c() : mStateMgr(*this, sStateID::null) {}
dAcOTumbleWeed_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE), mStateMgr(*this, sStateID::null) {}
virtual ~dAcOTumbleWeed_c() {}

virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual int actorCreate() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;

bool checkCollect();
bool checkBreak();
void doBreak();

void adjustTimeScale();
void adjustTumble(const mVec3_c &dir);
void calcWind();
mVec3_c getPosition() const;
void calcMatrix();

void adjustAngle();
void adjustSpeed();
void tumbleBounceMaybe();

void setWind(const mVec3_c &);

bool checkSlope();

bool fn_475_E40() const;
bool checkInvalidGround() const;

// Look at `isStopped` in dAcObjBase. This may be a diff inline
f32 getWindMag() const {
return fabsf(nw4r::math::VEC3LenSq(mWind));
}
bool isWindStop() const {
return getWindMag() <= EGG::Math<f32>::epsilon();
}

STATE_FUNC_DECLARE(dAcOTumbleWeed_c, Wait);
STATE_FUNC_DECLARE(dAcOTumbleWeed_c, Slope);

private:
/* 0x??? */ STATE_MGR_DECLARE(dAcOTumbleWeed_c);
/* 0x330 */ nw4r::g3d::ResFile mResFile;
/* 0x334 */ m3d::smdl_c mMdl;
/* 0x350 */ dShadowCircle_c mShdw;
/* 0x358 */ dCcD_Sph mSph;
/* 0x4A8 */ dBgS_AcchCir mAcchCir;
/* 0x504 */ dBgS_ObjAcch mObjAcch;
/* 0x8B4 */ DowsingTarget mDowsingTarget;
/* 0x8D4 */ STATE_MGR_DECLARE(dAcOTumbleWeed_c);
/* 0x910 */ mQuat_c mField_0x910;
/* 0x920 */ TimeAreaStruct mTimeArea;
/* 0x92C */ mMtx_c mShadowMtx;
/* 0x95C */ mVec3_c mWind;
/* 0x968 */ mVec3_c mField_0x968;
/* 0x974 */ f32 mField_0x974;
/* 0x978 */ f32 mField_0x978;
/* 0x97C */ f32 mField_0x97C;
/* 0x980 */ f32 mField_0x980;
/* 0x984 */ f32 mSpeedTarget;
/* 0x988 */ u16 mTumbleTimer;
/* 0x98A */ u8 mWindTimer;
/* 0x98B */ u8 mField_0x98B;
/* 0x98C */ u8 mField_0x98C;
/* 0x98D */ bool mbOnGround;

static dCcD_SrcSph sSphSrc;
};

#endif
12 changes: 12 additions & 0 deletions include/d/col/bg/d_bg_pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ enum dBgPc_ECode {
/* 0x80000000 */ CODE_UNUSED_8000_0000 = 0x80000000,
};

enum dBgPc_Attribute {
POLY_ATTR_NORMAL = 0,
POLY_ATTR_SLOPE = 1,
POLY_ATTR_LAVA = 7,
POLY_ATTR_SAND_SHALLOW = 9,
POLY_ATTR_SAND_MED = 10,
POLY_ATTR_SAND_DEEP_INSTANT = 11,
POLY_ATTR_WATER = 12,
POLY_ATTR_DAMAGE = 13,
POLY_ATTR_SLOPE_RUN = 15,
POLY_ATTR_SAND_DEEP_SLOW = 16,
};
class dBgPc {
public:
void setCode(sBgPc &);
Expand Down
4 changes: 4 additions & 0 deletions include/d/col/bg/d_bg_s_acch.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
return mFlags & GROUND_HIT;
}

dBgS_GndChk &GetGnd() {
return mGnd;
}

public:
/* 0x040 */ u32 mFlags;
/* 0x044 */ mVec3_c *mpPos;
Expand Down
Loading

0 comments on commit c235e32

Please sign in to comment.