z_collision_check.c (#58)

* setup

* Progress on z_collision_check.c

* Further progress on z_collision_check.c

* renamed code_0x800E03A0 to z_collision_btltbls, z_collision_check.c decompiled besides bss

* Structs changes

* Document functions

* overlayhelpers folder, colliderinit.py and ichaindis.py

* Flags, format existing ColliderInits

* Fix merge

* Few more small improvements

* Review suggestions
This commit is contained in:
Tharo
2021-03-22 17:48:15 -04:00
committed by GitHub
parent 32d0e622fd
commit 1a2e6d7ffe
28 changed files with 6520 additions and 918 deletions
+232 -232
View File
File diff suppressed because it is too large Load Diff
+62 -79
View File
@@ -358,11 +358,11 @@ extern DmaEntry dmadata[1568];
// extern UNK_TYPE1 D_801AAAB0;
// extern UNK_TYPE1 D_801AD370;
extern ActorInit En_A_Obj_InitVars;
extern ColCylinderInit enAObjCylinderInit;
extern ColliderCylinderInit enAObjCylinderInit;
extern InitChainEntry enAObjInitVar;
extern u32 enAObjDisplayLists[2];
extern ActorInit En_Item00_InitVars;
extern ColCylinderInit enItem00CylinderInit;
extern ColliderCylinderInit enItem00CylinderInit;
extern InitChainEntry enItem00InitVars[1];
// extern UNK_TYPE1 D_801ADF10;
// extern UNK_TYPE1 D_801ADF14;
@@ -856,39 +856,32 @@ extern camera_update_func cameraUpdateFuncs[71];
// extern UNK_TYPE4 D_801B9ED4;
// extern UNK_TYPE4 D_801B9F04;
// extern UNK_TYPE2 D_801B9F0C;
// extern UNK_TYPE4 D_801B9F10;
extern s800E03A0 D_801B9F20[23];
extern f32 gDamageMultipliers[16];
extern ColCommon defaultColCommon;
extern ColTouch defaultColTouch;
extern ColBump defaultColBump;
extern ColBodyInfo defaultColBodyInfo;
extern ColSphereParams defaultColSphereInfo;
extern ColCylinderParams defaultColCylinderInfo;
extern ColTriParams defaultColTriParams;
extern ColQuadParams defaultColQuadParams;
// extern UNK_TYPE1 D_801BA32C;
extern collision_add_func collisionAddATFuncs[5];
extern collision_add_func collisionAddACFuncs[5];
extern collision_add_func collisionAddOTFuncs[5];
extern UNK_PTR D_801BA374;
// extern UNK_TYPE1 D_801BA38C;
// extern UNK_TYPE1 D_801BA38D;
extern UNK_PTR D_801BA3A8;
extern collision_func collisionFuncTableATwithAC[25];
extern collision_func collisionFuncTableOTwithOT[25];
extern CollisionCheckInfo D_801BA484;
extern UNK_PTR D_801BA4A0;
// extern UNK_TYPE1 D_801BA4B4;
extern EffShieldParticleInit D_801BA4C8;
// extern UNK_TYPE1 D_801BA4F6;
// extern UNK_TYPE1 D_801BA4F8;
// extern UNK_TYPE1 D_801BA4FA;
extern EffShieldParticleInit D_801BA508;
// extern UNK_TYPE1 D_801BA536;
// extern UNK_TYPE1 D_801BA538;
// extern UNK_TYPE1 D_801BA53A;
// extern UNK_TYPE1 D_801BA550;
extern UNK_TYPE4 D_801B9F10;
extern DamageTable sDamageTablePresets[23];
extern f32 damageMultipliers[16];
extern Collider defaultCollider;
extern ColliderTouch defaultColliderTouch;
extern ColliderBump defaultColliderBump;
extern ColliderInfo defaultColliderInfo;
extern ColliderJntSphElementDim defaultColliderJntSphElementDim;
extern Cylinder16 defaultColliderCylinderDim;
extern TriNorm defaultColliderTrisElementDim;
extern ColliderQuadDim defaultColliderQuadDim;
extern Vec3f defaultLinePoint;
extern ColChkResetFunc sATResetFuncs[COLSHAPE_MAX];
extern ColChkResetFunc sACResetFuncs[COLSHAPE_MAX];
extern ColChkResetFunc sOCResetFuncs[COLSHAPE_MAX];
extern ColChkBloodFunc sBloodFuncs[6];
extern HitInfo sHitInfo[14];
extern ColChkApplyFunc sColChkApplyFuncs[COLSHAPE_MAX];
extern ColChkVsFunc sACVsFuncs[COLSHAPE_MAX][COLSHAPE_MAX];
extern ColChkVsFunc sOCVsFuncs[COLSHAPE_MAX][COLSHAPE_MAX];
extern CollisionCheckInfo defaultColChkInfo;
extern ColChkApplyFunc sApplyDamageFuncs[COLSHAPE_MAX];
extern ColChkLineFunc sOCLineCheckFuncs[COLSHAPE_MAX];
extern EffShieldParticleInit shieldParticleInitMetal;
extern EffShieldParticleInit shieldParticleInitWood;
extern UNK_TYPE1 D_801BA550;
// extern UNK_TYPE1 D_801BA750;
// extern UNK_TYPE1 D_801BA790;
// extern UNK_TYPE1 D_801BA7F0;
@@ -940,7 +933,7 @@ extern Actor* actorCutsceneCurrentCutsceneActor;
extern GlobalContext* actorCutscenesGlobalCtxt;
extern s16 actorCutsceneReturnCamera;
extern s16 D_801BD8C6;
extern ColCylinderInit fireObjCollisionInit;
extern ColliderCylinderInit fireObjCollisionInit;
extern FireObjLightParams D_801BD8FC[2];
extern GameStateOverlay initialGameStateInfo;
extern GameStateOverlay D_801BD940;
@@ -3866,8 +3859,8 @@ extern f32 D_801EDB98;
extern f32 D_801EDB9C;
extern f32 D_801EDBA0;
// extern UNK_TYPE1 D_801EDBA4;
extern ColSphereCollisionInfo D_801EDBA8;
extern ColTriParams D_801EDBB0;
extern Sphere16 D_801EDBA8;
extern TriNorm D_801EDBB0;
// extern UNK_TYPE1 D_801EDBD4;
// extern UNK_TYPE1 D_801EDBD8;
// extern UNK_TYPE1 D_801EDBDC;
@@ -3894,54 +3887,44 @@ extern s16 D_801EDBF0;
// extern UNK_TYPE1 D_801EDDE0;
// extern UNK_TYPE1 D_801EDDF0;
extern Vec3f D_801EDE00;
// extern UNK_TYPE1 D_801EDE10;
extern Vec3f D_801EDE10;
extern Vec3f D_801EDE20;
// extern UNK_TYPE1 D_801EDE30;
// extern UNK_TYPE1 D_801EDE40;
// extern UNK_TYPE1 D_801EDE78;
// extern UNK_TYPE1 D_801EDEB0;
// extern UNK_TYPE1 D_801EDEBC;
// extern UNK_TYPE1 D_801EDEC8;
// extern UNK_TYPE1 D_801EDF00;
// extern UNK_TYPE1 D_801EDF38;
// extern UNK_TYPE1 D_801EDF48;
// extern UNK_TYPE1 D_801EDF58;
// extern UNK_TYPE1 D_801EDF90;
// extern UNK_TYPE1 D_801EDFC8;
// extern UNK_TYPE1 D_801EDFD4;
// extern UNK_TYPE1 D_801EDFE0;
// extern UNK_TYPE1 D_801EDFF0;
// extern UNK_TYPE1 D_801EE000;
// extern UNK_TYPE1 D_801EE038;
// extern UNK_TYPE1 D_801EE070;
// extern UNK_TYPE1 D_801EE0A4;
// extern UNK_TYPE1 D_801EE0D8;
// extern UNK_TYPE1 D_801EE0E8;
// extern UNK_TYPE1 D_801EE11C;
// extern UNK_TYPE1 D_801EE150;
// extern UNK_TYPE1 D_801EE188;
// extern UNK_TYPE1 D_801EE1C0;
// extern UNK_TYPE1 D_801EE1C4;
// extern UNK_TYPE1 D_801EE1C8;
// extern UNK_TYPE1 D_801EE1D0;
// extern UNK_TYPE1 D_801EE1D4;
// extern UNK_TYPE1 D_801EE1D8;
// extern UNK_TYPE1 D_801EE1E0;
// extern UNK_TYPE1 D_801EE1E4;
// extern UNK_TYPE1 D_801EE1E8;
// extern UNK_TYPE1 D_801EE1F0;
extern Vec3f D_801EDE30;
extern TriNorm D_801EDE40;
extern TriNorm D_801EDE78;
extern LineSegment D_801EDEB0;
extern TriNorm D_801EDEC8;
extern TriNorm D_801EDF00;
extern Vec3f D_801EDF38;
extern Vec3f D_801EDF48;
extern TriNorm D_801EDF58;
extern TriNorm D_801EDF90;
extern LineSegment D_801EDFC8;
extern Vec3f D_801EDFE0;
extern Vec3f D_801EDFF0;
extern TriNorm D_801EE000;
extern TriNorm D_801EE038;
extern TriNorm D_801EE070[2];
extern Vec3f D_801EE0D8;
extern TriNorm D_801EE0E8[2];
extern TriNorm D_801EE150;
extern TriNorm D_801EE188;
extern Vec3f D_801EE1C0;
extern Vec3f D_801EE1D0;
extern Vec3f D_801EE1E0;
extern Vec3f D_801EE1F0;
// extern UNK_TYPE1 D_801EE1F4;
// extern UNK_TYPE1 D_801EE1F8;
extern EffSparkParams D_801EE200;
extern ColTriParams D_801EE6C8;
extern ColTriParams D_801EE700;
extern TriNorm D_801EE6C8;
extern TriNorm D_801EE700;
extern EffSparkParams D_801EE738;
extern EffSparkParams D_801EEC00;
extern EffSparkParams D_801EF0C8;
// extern UNK_TYPE1 D_801EF590;
// extern UNK_TYPE1 D_801EF5C8;
extern ColTriParams D_801EF600;
extern ColTriParams D_801EF638;
extern TriNorm D_801EF590;
extern TriNorm D_801EF5C8;
extern TriNorm D_801EF600;
extern TriNorm D_801EF638;
// extern UNK_TYPE1 D_801EF66D;
extern SaveContext gSaveContext;
// extern UNK_TYPE2 D_801F3F38;
+16 -23
View File
@@ -446,10 +446,6 @@ typedef void(*osCreateThread_func)(void*);
typedef void*(*printf_func)(void*, char*, size_t);
typedef struct {
/* 0x00 */ UNK_TYPE1 pad0[0x20];
} s800E03A0; // size = 0x20
typedef struct {
/* 0x000 */ OSThread unk0;
/* 0x1B0 */ s8 argCount;
@@ -627,11 +623,6 @@ typedef struct {
/* 0x12 */ OSContPad rel; // X/Y store adjusted
} Input; // size = 0x18
typedef struct {
/* 0x00 */ Vec3f a;
/* 0x0C */ Vec3f b;
} LineSegment; // size = 0x18
// Permanent save context, kept in regular save files
typedef struct {
/* 0x0000 */ u32 entranceIndex; // bits 0-3 : offset; 4-8: spawn index; 9-15: scene index
@@ -1264,6 +1255,12 @@ typedef struct AudioThreadStruct AudioThreadStruct;
typedef struct GlobalContext GlobalContext;
typedef s32 (*ColChkResetFunc)(GlobalContext*, Collider*);
typedef void (*ColChkBloodFunc)(GlobalContext*, Collider*, Vec3f*);
typedef void (*ColChkApplyFunc)(GlobalContext*, CollisionCheckContext*, Collider*);
typedef void (*ColChkVsFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Collider*);
typedef s32 (*ColChkLineFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*);
typedef struct {
/* 0x0 */ GlobalContext* ctxt;
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
@@ -1271,10 +1268,6 @@ typedef struct {
/* 0xA */ s16 state; // 0 - stopped, 1 - active, 2 - setup
} Quake2Context; // size = 0xC
typedef s32(*collision_add_func)(GlobalContext*, ColCommon*);
typedef void(*collision_func)(GlobalContext*, CollisionCheckContext*, ColCommon*, ColCommon*);
typedef void(*cutscene_update_func)(GlobalContext* ctxt, CutsceneContext* cCtxt);
typedef void(*draw_func)(GlobalContext* ctxt, s16 index);
@@ -1526,7 +1519,7 @@ struct FireObj {
/* 0x28 */ u8 flags; // bit 0 - ?, bit 1 - ?
/* 0x29 */ UNK_TYPE1 pad29[0x1];
/* 0x2A */ s16 ignitionDelay;
/* 0x2C */ ColCylinder collision;
/* 0x2C */ ColliderCylinder collision;
/* 0x78 */ FireObjLight light;
}; // size = 0x8B
@@ -1687,8 +1680,8 @@ typedef struct {
typedef struct {
/* 0x000 */ Actor base;
/* 0x144 */ ColQuad unk144;
/* 0x1C4 */ ColQuad unk1C4;
/* 0x144 */ ColliderQuad unk144;
/* 0x1C4 */ ColliderQuad unk1C4;
/* 0x244 */ Vec3f unk244;
/* 0x250 */ f32 unk250;
/* 0x254 */ f32 unk254;
@@ -1711,9 +1704,9 @@ struct ActorEnBji01 {
struct ActorEnBom {
/* 0x000 */ Actor base;
/* 0x144 */ ColCylinder unk144;
/* 0x190 */ ColSphereGroup unk190;
/* 0x1B0 */ ColSphereGroupElement unk1B0[1];
/* 0x144 */ ColliderCylinder unk144;
/* 0x190 */ ColliderJntSph unk190;
/* 0x1B0 */ ColliderJntSphElement unk1B0[1];
/* 0x1F0 */ s16 unk1F0;
/* 0x1F2 */ UNK_TYPE1 pad1F2[0x6];
/* 0x1F8 */ u8 unk1F8;
@@ -1741,7 +1734,7 @@ struct ActorEnFirefly {
/* 0x2EC */ f32 unk2EC;
/* 0x2F0 */ f32 unk2F0;
/* 0x2F4 */ UNK_TYPE1 pad2F4[0x28];
/* 0x31C */ ColSphere collision;
/* 0x31C */ ColliderSphere collision;
}; // size = 0x374
struct ActorEnTest {
@@ -1771,8 +1764,8 @@ typedef struct {
struct ActorObjBell {
/* 0x000 */ Actor base;
/* 0x144 */ UNK_TYPE1 pad144[0x18];
/* 0x15C */ ColSphere unk15C;
/* 0x1B4 */ ColSphere unk1B4;
/* 0x15C */ ColliderSphere unk15C;
/* 0x1B4 */ ColliderSphere unk1B4;
/* 0x20C */ UNK_TYPE1 pad20C[0x2];
/* 0x20E */ s16 unk20E;
/* 0x210 */ UNK_TYPE1 pad210[0x4];
@@ -1782,7 +1775,7 @@ struct ActorObjBell {
struct ActorBgIknvObj {
/* 0x000 */ DynaPolyActor bg;
/* 0x15C */ ColCylinder collision;
/* 0x15C */ ColliderCylinder collision;
/* 0x1A8 */ u32 displayListAddr;
/* 0x1AC */ ActorFunc updateFunc;
}; // size = 0x1B0
+35 -18
View File
@@ -6,6 +6,9 @@
#include <z64collision_check.h>
#include <unk.h>
#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions
#define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects.
struct Actor;
struct GlobalContext;
struct LightMapper;
@@ -19,9 +22,38 @@ typedef struct {
} PosRot; // size = 0x14
typedef struct {
/* 0x00 */ u8 table[32];
/* 0x00 */ u8 attack[32];
} DamageTable; // size = 0x20
typedef struct {
/* 0x00 */ u8 health;
/* 0x02 */ s16 cylRadius;
/* 0x04 */ s16 cylHeight;
/* 0x06 */ u8 mass;
} CollisionCheckInfoInit;
typedef struct {
/* 0x00 */ u8 health;
/* 0x02 */ s16 cylRadius;
/* 0x04 */ s16 cylHeight;
/* 0x06 */ s16 cylYShift;
/* 0x08 */ u8 mass;
} CollisionCheckInfoInit2;
typedef struct {
/* 0x00 */ DamageTable* damageTable;
/* 0x04 */ Vec3f displacement;
/* 0x10 */ s16 cylRadius;
/* 0x12 */ s16 cylHeight;
/* 0x14 */ s16 cylYShift;
/* 0x16 */ u8 mass;
/* 0x17 */ u8 health;
/* 0x18 */ u8 damage;
/* 0x19 */ u8 damageEffect;
/* 0x1A */ u8 atHitEffect;
/* 0x1B */ u8 acHitEffect;
} CollisionCheckInfo; // size = 0x1C
typedef struct {
/* 0x00 */ s32 unk0;
/* 0x04 */ s32 unk4;
@@ -43,21 +75,6 @@ typedef struct {
/* 0x3A */ s16 unk3A;
} ActorEnTest20C; // size = 0x3C
// Related to collision?
typedef struct {
/* 0x00 */ DamageTable* damageTable;
/* 0x04 */ Vec3f displacement; // Amount to correct velocity (0x5C) by when colliding into a body
/* 0x10 */ s16 cylRadius; // Used for various purposes
/* 0x12 */ s16 cylHeight; // Used for various purposes
/* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg
/* 0x16 */ u8 mass; // Used to compute displacement for OC collisions
/* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one
/* 0x18 */ u8 damage; // Amount to decrement health by
/* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon
/* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC
/* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT
} CollisionCheckInfo; // size = 0x1C
typedef struct {
/* 0x00 */ s16 id;
/* 0x02 */ u8 type;
@@ -248,14 +265,14 @@ typedef struct {
/* 0x150 */ s16 unk150;
/* 0x152 */ s16 unk152;
/* 0x154 */ f32 unk154;
/* 0x158 */ ColCylinder collision;
/* 0x158 */ ColliderCylinder collision;
/* 0x1A4 */ UNK_TYPE1 pad1A4[0x4];
} ActorEnItem00; // size = 0x1A8
typedef struct {
/* 0x000 */ Actor base;
/* 0x144 */ ActorFunc update;
/* 0x148 */ ColCylinder collision;
/* 0x148 */ ColliderCylinder collision;
/* 0x194 */ UNK_TYPE1 pad194[0x14];
} ActorEnAObj; // size = 0x1A8
File diff suppressed because it is too large Load Diff
+87 -9
View File
@@ -5,16 +5,94 @@
#define SHT_MAX 32767.0f
typedef struct {
/* 0x0 */ f32 x;
/* 0x4 */ f32 y;
/* 0x8 */ f32 z;
} Vec3f; // size = 0xC
#define VEC_SET(V,X,Y,Z) V.x=X;V.y=Y;V.z=Z
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 z;
} Vec3s; // size = 0x6
/* 0x00 */ f32 x;
/* 0x04 */ f32 y;
} Vec2f; // size = 0x08
typedef struct {
/* 0x00 */ f32 x;
/* 0x04 */ f32 y;
/* 0x08 */ f32 z;
} Vec3f; // size = 0x0C
typedef struct {
/* 0x00 */ u16 x;
/* 0x02 */ u16 y;
/* 0x04 */ u16 z;
} Vec3us; // size = 0x06
typedef struct {
/* 0x00 */ s16 x;
/* 0x02 */ s16 y;
/* 0x04 */ s16 z;
} Vec3s; // size = 0x06
typedef struct {
/* 0x00 */ s32 x;
/* 0x04 */ s32 y;
/* 0x08 */ s32 z;
} Vec3i; // size = 0x0C
typedef struct {
/* 0x00 */ Vec3s center;
/* 0x06 */ s16 radius;
} Sphere16; // size = 0x08
typedef struct {
/* 0x00 */ Vec3f center;
/* 0x0C */ f32 radius;
} Spheref; // size = 0x10
typedef struct {
/* 0x00 */ Vec3f normal;
/* 0x0C */ f32 originDist;
} Plane; // size = 0x10
typedef struct {
/* 0x00 */ Vec3f vtx[3];
/* 0x24 */ Plane plane;
} TriNorm; // size = 0x34
typedef struct {
/* 0x00 */ s16 radius;
/* 0x02 */ s16 height;
/* 0x04 */ s16 yShift;
/* 0x06 */ Vec3s pos;
} Cylinder16; // size = 0x0C
typedef struct {
/* 0x00 */ f32 radius;
/* 0x04 */ f32 height;
/* 0x08 */ f32 yShift;
/* 0x0C */ Vec3f pos;
} Cylinderf; // size = 0x18
typedef struct {
/* 0x00 */ Vec3f point;
/* 0x0C */ Vec3f dir;
} InfiniteLine; // size = 0x18
typedef struct {
/* 0x00 */ Vec3f a;
/* 0x0C */ Vec3f b;
} LineSegment; // size = 0x18
// Defines a point in the spherical coordinate system
typedef struct {
/* 0x00 */ f32 r; // radius
/* 0x04 */ s16 pitch; // polar (zenith) angle
/* 0x06 */ s16 yaw; // azimuthal angle
} VecSph; // size = 0x08
#define IS_ZERO(f) (fabsf(f) < 0.008f)
// Vector macros
#define SQXZ(vec) ((vec.x) * (vec.x) + (vec.z) * (vec.z))
#define DOTXZ(vec1, vec2) ((vec1.x) * (vec2.x) + (vec1.z) * (vec2.z))
#define SQXYZ(vec) ((vec.x) * (vec.x) + (vec.y) * (vec.y) + (vec.z) * (vec.z))
#define DOTXYZ(vec1, vec2) ((vec1.x) * (vec2.x) + (vec1.y) * (vec2.y) + (vec1.z) * (vec2.z))
#endif
+5 -4
View File
@@ -337,9 +337,9 @@ SECTIONS
build/src/code/code_0x800CAE10.o(.text)
build/asm/code/code_0x800CB000.o(.text)
build/asm/code/z_camera.o(.text)
build/src/code/code_0x800E03A0.o(.text)
build/src/code/z_collision_btltbls.o(.text)
. += 0x10;
build/asm/code/z_collision_check.o(.text)
build/src/code/z_collision_check.o(.text)
build/src/code/code_0x800E8EA0.o(.text)
build/asm/code/code_0x800E9360.o(.text)
build/asm/code/z_debug.o(.text)
@@ -473,7 +473,8 @@ SECTIONS
build/src/code/z_actor_dlftbls.o(.data)
build/asm/code/code_data_z_bgcheck.o(.data)
build/asm/code/code_data_z_camera.o(.data)
build/asm/code/code_data_z_collision_check.o(.data)
build/src/code/z_collision_btltbls.o(.data)
build/src/code/z_collision_check.o(.data)
build/asm/code/code_data_z_debug_display.o(.data)
build/asm/code/code_data_z_debug_mode.o(.data)
build/asm/code/code_data_z_draw.o(.data)
@@ -549,7 +550,7 @@ SECTIONS
build/asm/code/code_rodata_z_bgcheck.o(.rodata)
build/asm/code/code_rodata_0x800CB000.o(.rodata)
build/asm/code/code_rodata_z_camera.o(.rodata)
build/asm/code/code_rodata_z_collision_check.o(.rodata)
build/src/code/z_collision_check.o(.rodata)
build/asm/code/code_rodata_0x800E8EA0.o(.rodata)
build/asm/code/code_rodata_z_debug_mode.o(.rodata)
build/asm/code/code_rodata_z_draw.o(.rodata)
+7 -5
View File
@@ -8,16 +8,18 @@ void EnAObj_Init(ActorEnAObj* this, GlobalContext* ctxt) {
s0->base.textId = ((s0->base.params >> 8) & 0xFF) | 0x300;
s0->base.params = (s0->base.params & 0xFF) - 9;
Actor_ProcessInitChain((Actor*)s0, &enAObjInitVar);
Actor_SetDrawParams(&s0->base.shape, 0, (ActorShadowFunc)func_800B3FC0, 12);
Collision_InitCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
Collision_CylinderMoveToActor((Actor*)s0, &s0->collision);
Collider_InitAndSetCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
Collider_UpdateCylinder((Actor*)s0, &s0->collision);
s0->base.colChkInfo.mass = 255;
s0->update = (ActorFunc)EnAObj_Update1;
}
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* ctxt) {
ColCylinder* a2 = &this->collision;
Collision_FiniCylinder(ctxt, a2);
ColliderCylinder* a2 = &this->collision;
Collider_DestroyCylinder(ctxt, a2);
}
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* ctxt) {
@@ -43,7 +45,7 @@ void EnAObj_Update2(ActorEnAObj* this, GlobalContext* ctxt) {
void EnAObj_Update(ActorEnAObj* this, GlobalContext* ctxt) {
(this->update)((Actor*)this, (GlobalContext*)ctxt);
Actor_SetHeight((Actor*)this, 45.0f);
Collision_AddOT(ctxt, &ctxt->colCheckCtx, (ColCommon*)&this->collision);
CollisionCheck_SetOC(ctxt, &ctxt->colCheckCtx, (Collider*)&this->collision);
}
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* ctxt) {
-17
View File
@@ -1,17 +0,0 @@
#include <ultra64.h>
#include <global.h>
s800E03A0* func_800E03A0(s32 a0) {
if ((a0 < 0) || (a0 > 22)) return 0;
return &(D_801B9F20[a0]);
}
// Probably zeroes out a s800E03A0?
void func_800E03CC(u8* a0) {
s32 i;
u8* v1;
for (i = 0, v1 = a0; i < 32; i++) {
*v1++ = 0;
}
}
+1 -1
View File
@@ -230,7 +230,7 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
actor->meshAttachedTo = 0x32;
actor->sqrdDistToLink = D_801DCA54;
func_800E7494(&actor->colChkInfo);
CollisionCheck_InitInfo(&actor->colChkInfo);
actor->uncullZoneForward = 1000.0f;
actor->uncullZoneScale = 350.0f;
actor->uncullZoneDownward = 700.0f;
+1 -1
View File
@@ -76,7 +76,7 @@ void BgCheck_CreateVertexFromVec3f(BgVertex* vertex, Vec3f* vector) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C01B8.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/BgCheck_CreateColTriParamsFromPolygon.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/BgCheck_CreateTriNormFromPolygon.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C02C0.asm")
+74
View File
@@ -0,0 +1,74 @@
#include <ultra64.h>
#include <global.h>
DamageTable sDamageTablePresets[] = {
{ { 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x31, 0x01, 0x00, 0x00,
0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00,
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x00, 0xE2, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00,
0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x02, 0x22, 0x01, 0x01, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x00, 0x02, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00,
0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x01, 0xF2, 0xE0, 0x01, 0xD2, 0x10, 0x01, 0x02, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00,
0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x10, 0x01, 0x00, 0xF0, 0x10, 0x01, 0xF0, 0x10, 0x01, 0x02, 0x02, 0x00, 0x12, 0x00, 0x00, 0x00,
0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 } },
};
/**
* Returns a pointer to one of the 23 damage table presets, or NULL if the index
* is out of range.
*/
DamageTable* DamageTable_Get(s32 index) {
if (index < 0 || index > ARRAY_COUNT(sDamageTablePresets)-1) {
return NULL;
}
return &sDamageTablePresets[index];
}
/**
* Sets all entries in a damage table to 0
*/
void DamageTable_Clear(DamageTable* damageTable) {
s32 i;
for (i = 0; i < ARRAY_COUNT(damageTable->attack); i++) {
damageTable->attack[i] = 0;
}
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -146,7 +146,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
actors[0] = actor;
actors[1] = globalCtx->actorCtx.actorList[2].first; // TODO PLAYER macro
if (func_800E7DCC(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
func_8013A41C(0x3b);
ret |= 0x3b;
}
+30 -17
View File
@@ -24,10 +24,24 @@ const ActorInit Arms_Hook_InitVars = {
(ActorFunc)ArmsHook_Draw
};
ColQuadInit D_808C1BC0 = {
{ 10, 0x09, 0x00, 0x00, 0x08, 3 },
{ 0x02, { 0x00000080, 0x00, 0x02 }, { 0xF7CFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 },
{ 0 },
ColliderQuadInit D_808C1BC0 = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_PLAYER,
AC_NONE,
OC1_NONE,
OC2_TYPE_PLAYER,
COLSHAPE_QUAD,
},
{
ELEMTYPE_UNK2,
{ 0x00000080, 0x00, 0x02 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
};
Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f };
@@ -47,8 +61,8 @@ void ArmsHook_SetupAction(ArmsHook* this, ArmsHookActionFunc actionFunc) {
void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx) {
ArmsHook* this = THIS;
Collision_InitQuadDefault(globalCtx, &this->collider);
Collision_InitQuadWithData(globalCtx, &this->collider, &this->actor, &D_808C1BC0);
Collider_InitQuad(globalCtx, &this->collider);
Collider_SetQuad(globalCtx, &this->collider, &this->actor, &D_808C1BC0);
ArmsHook_SetupAction(this, ArmsHook_Wait);
this->unk1E0 = this->actor.world.pos;
}
@@ -59,7 +73,7 @@ void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) {
if (this->grabbed != NULL) {
this->grabbed->flags &= ~0x2000;
}
Collision_FiniQuad(globalCtx, &this->collider);
Collider_DestroyQuad(globalCtx, &this->collider);
}
void ArmsHook_Wait(ArmsHook* this, GlobalContext* globalCtx) {
@@ -125,10 +139,11 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
func_800B8F98(&player->base, 0x100B);
ArmsHook_CheckForCancel(this);
if (this->timer != 0 && (this->collider.base.flagsAT & 2) && (this->collider.body.unk20->unk14 != 4)) {
Actor* touchedActor = this->collider.base.collisionAT;
if (this->timer != 0 && (this->collider.base.atFlags & AT_HIT) &&
(this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
Actor* touchedActor = this->collider.base.at;
if ((touchedActor->update != NULL) && (touchedActor->flags & 0x600)) {
if (this->collider.body.unk20->unk16 & 4) {
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
ArmsHook_AttachHookToActor(this, touchedActor);
if ((touchedActor->flags & 0x400) == 0x400) {
func_808C1154(this);
@@ -170,8 +185,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
{
f32 velocity;
bodyDistDiff =
Math_Vec3f_DistXYZAndStoreDiff(&player->unk368, &this->actor.world.pos, &bodyDistDiffVec);
bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk368, &this->actor.world.pos, &bodyDistDiffVec);
if (bodyDistDiff < 30.0f) {
velocity = 0.0f;
phi_f16 = 0.0f;
@@ -244,15 +258,14 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (func_800C9CEC(&globalCtx->colCtx, poly, bgId)) {
{
DynaPolyActor* dynaPolyActor;
if (bgId != 0x32 &&
(dynaPolyActor = BgCheck_GetActorOfMesh(&globalCtx->colCtx, bgId)) != NULL) {
if (bgId != 0x32 && (dynaPolyActor = BgCheck_GetActorOfMesh(&globalCtx->colCtx, bgId)) != NULL) {
ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor);
}
}
func_808C1154(this);
func_8019F1C0(&this->actor.projectedPos, 0x1829);
} else {
func_800E8668(globalCtx, &this->actor.world.pos);
CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.world.pos);
func_8019F1C0(&this->actor.projectedPos, 0x1813);
}
} else {
@@ -305,8 +318,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(sp44->polyOpa.p++, SysMatrix_AppendStateToPolyOpaDisp(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(sp44->polyOpa.p++, D_0601D960);
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, MTXMODE_NEW);
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
MTXMODE_NEW);
Math_Vec3f_Diff(&player->unk368, &this->actor.world.pos, &sp68);
sp48 = SQ(sp68.x) + SQ(sp68.z);
sp4C = sqrtf(sp48);
@@ -9,7 +9,7 @@ typedef void (*ArmsHookActionFunc)(struct ArmsHook*, GlobalContext*);
typedef struct ArmsHook {
/* 0x000 */ Actor actor;
/* 0x144 */ ColQuad collider;
/* 0x144 */ ColliderQuad collider;
/* 0x1C4 */ s32 unk1C4;
/* 0x1C8 */ char unk1C8[0x18];
/* 0x1E0 */ Vec3f unk1E0;
@@ -26,30 +26,28 @@ const ActorInit Bg_Ikana_Ray_InitVars = {
(ActorFunc)BgIkanaRay_Draw
};
// TODO better formatting
ColCylinderInit bgIkanaRayCylinderInit = {
{ 10, 33, 0, 0, 0, 1 },
{ 0, { 0x00200000, 0, 0 }, { 0, 0, 0 }, 25, 0, 1 },
{ 90, 420, 65116}
ColliderCylinderInit bgIkanaRayCylinderInit = {
{ COLTYPE_NONE, AT_ON | AT_TYPE_OTHER, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00200000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_ON, },
{ 90, 420, -420, { 0, 0, 0 } },
};
// TODO macro
InitChainEntry bgIkanaRayCompInit[] = {
{1, 6, 0x0FC, 4000},
{1, 6, 0x100, 1000},
{1, 6, 0x104, 1000},
{0, 9, 0x058, 100}
InitChainEntry bgIkanaRayCompInit[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
ColCylinder* collision = &THIS->collision;
ColliderCylinder* collision = &THIS->collision;
u32 pad;
Actor_ProcessInitChain(thisx, bgIkanaRayCompInit);
Collision_InitCylinderDefault(globalCtx, collision);
Collision_InitCylinderWithData(globalCtx, collision, thisx, &bgIkanaRayCylinderInit);
Collision_CylinderMoveToActor(thisx, &THIS->collision);
Collider_InitCylinder(globalCtx, collision);
Collider_SetCylinder(globalCtx, collision, thisx, &bgIkanaRayCylinderInit);
Collider_UpdateCylinder(thisx, &THIS->collision);
THIS->animatedTextures = (AnimatedTexture*)Lib_PtrSegToVirt(object_ikana_obj_001228);
@@ -61,8 +59,8 @@ void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
}
void BgIkanaRay_Destroy(Actor* thisx, GlobalContext* globalCtx) {
ColCylinder* collision = &THIS->collision;
Collision_FiniCylinder(globalCtx, collision);
ColliderCylinder* collision = &THIS->collision;
Collider_DestroyCylinder(globalCtx, collision);
}
void BgIkanaRay_SetDeactivated(BgIkanaRay* this) {
@@ -84,7 +82,7 @@ void BgIkanaRay_SetActivated(BgIkanaRay* this) {
}
void BgIkanaRay_UpdateActivated(BgIkanaRay* this, GlobalContext* globalCtx) {
Collision_AddAT(globalCtx, &globalCtx->colCheckCtx, &this->collision.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collision.base);
}
void BgIkanaRay_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -7,7 +7,7 @@ struct BgIkanaRay;
typedef struct BgIkanaRay {
/* 0x000 */ Actor base;
/* 0x144 */ ColCylinder collision;
/* 0x144 */ ColliderCylinder collision;
/* 0x190 */ AnimatedTexture* animatedTextures;
/* 0x194 */ void (*update)(struct BgIkanaRay*, GlobalContext*);
} BgIkanaRay; // size = 0x198
+8 -9
View File
@@ -26,10 +26,9 @@ const ActorInit En_Nnh_InitVars = {
(ActorFunc)EnNnh_Draw
};
ColCylinderInit D_80C08A00 =
{
{ 0x0D, 0x00, 0x09, 0x39, 0x10, 0x01 },
{ 0x01, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
ColliderCylinderInit D_80C08A00 = {
{ COLTYPE_TREE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
{ 20, 50, 0, { 0, 0, 0 } },
};
@@ -39,8 +38,8 @@ void EnNnh_Init(Actor *thisx, GlobalContext *globalCtx) {
EnNnh* this = THIS;
Actor_SetScale(&this->actor, 0.01f);
Collision_InitCylinderDefault(globalCtx, &this->collider);
Collision_InitCylinderWithData(globalCtx, &this->collider, &this->actor, &D_80C08A00);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80C08A00);
this->actor.targetMode = 1;
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 30.0f;
@@ -50,7 +49,7 @@ void EnNnh_Init(Actor *thisx, GlobalContext *globalCtx) {
void EnNnh_Destroy(Actor *thisx, GlobalContext *globalCtx) {
EnNnh* this = THIS;
Collision_FiniCylinder(globalCtx, &this->collider);
Collider_DestroyCylinder(globalCtx, &this->collider);
}
void func_80C08828(EnNnh* this) {
@@ -81,8 +80,8 @@ void EnNnh_Update(Actor *thisx, GlobalContext *globalCtx) {
s32 pad;
this->actionFunc(this, globalCtx);
Collision_CylinderMoveToActor(&this->actor, &this->collider);
Collision_AddOT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
}
void EnNnh_Draw(Actor *thisx, GlobalContext *globalCtx) {
+1 -1
View File
@@ -9,7 +9,7 @@ typedef void (*EnNnhActionFunc)(struct EnNnh*, GlobalContext*);
typedef struct EnNnh {
/* 0x000 */ Actor actor;
/* 0x144 */ ColCylinder collider;
/* 0x144 */ ColliderCylinder collider;
/* 0x190 */ EnNnhActionFunc actionFunc;
} EnNnh; // size = 0x194

Some files were not shown because too many files have changed in this diff Show More