mirror of
https://github.com/zeldaret/oot
synced 2026-06-27 10:42:55 -04:00
Document Camera BgCamData (#1232)
* Document bgCamData * More changes and cleanup * More docs * Clarify comments * PR Feedback, rename bgcheck functions * remove fallthrough cleanup (other pr that deals with that) * PR Suggestions * bug report * bgCamDataIndexBeforeUnderwater * PR/Discord Discussions * Missed some * sync function header args * Another suggestion * cleanup * Comments * Change bgCamData to s16 for now * PR suggestions * the * use "info" * Missed a suggestion * Discord Discussion * Revert bgCamFuncData to Vec3s * format
This commit is contained in:
+10
-10
@@ -628,12 +628,12 @@ s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionP
|
||||
void CollisionHeader_GetVirtual(void* colHeader, CollisionHeader** dest);
|
||||
void func_800418D0(CollisionContext* colCtx, PlayState* play);
|
||||
void BgCheck_ResetPolyCheckTbl(SSNodeList* nodeList, s32 numPolys);
|
||||
u32 SurfaceType_GetCamDataIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u16 func_80041A4C(CollisionContext* colCtx, u32 camId, s32 bgId);
|
||||
u16 SurfaceType_GetCameraSType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u16 SurfaceType_GetNumCameras(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
Vec3s* func_80041C10(CollisionContext* colCtx, s32 camId, s32 bgId);
|
||||
Vec3s* SurfaceType_GetCamPosData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u32 SurfaceType_GetBgCamIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u16 BgCheck_GetBgCamSettingImpl(CollisionContext* colCtx, u32 bgCamIndex, s32 bgId);
|
||||
u16 BgCheck_GetBgCamSetting(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u16 BgCheck_GetBgCamCount(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
Vec3s* BgCheck_GetBgCamFuncDataImpl(CollisionContext* colCtx, s32 bgCamIndex, s32 bgId);
|
||||
Vec3s* BgCheck_GetBgCamFuncData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u32 SurfaceType_GetSceneExitIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u32 func_80041D4C(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
u32 func_80041D70(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
|
||||
@@ -662,8 +662,8 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos,
|
||||
WaterBox** outWaterBox);
|
||||
s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox);
|
||||
u32 WaterBox_GetCamDataIndex(CollisionContext* colCtx, WaterBox* waterBox);
|
||||
u16 WaterBox_GetCameraSType(CollisionContext* colCtx, WaterBox* waterBox);
|
||||
u32 WaterBox_GetBgCamIndex(CollisionContext* colCtx, WaterBox* waterBox);
|
||||
u16 WaterBox_GetBgCamSetting(CollisionContext* colCtx, WaterBox* waterBox);
|
||||
u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox);
|
||||
s32 func_80042708(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* point, Vec3f* closestPoint);
|
||||
s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec3f* pointB, Vec3f* closestPoint);
|
||||
@@ -690,7 +690,7 @@ void Camera_Finish(Camera* camera);
|
||||
s32 Camera_ChangeMode(Camera* camera, s16 mode);
|
||||
s32 Camera_CheckValidMode(Camera* camera, s16 mode);
|
||||
s32 Camera_ChangeSetting(Camera* camera, s16 setting);
|
||||
s32 Camera_ChangeDataIdx(Camera* camera, s32 camDataIdx);
|
||||
s32 Camera_ChangeBgCamIndex(Camera* camera, s32 bgCamIndex);
|
||||
s16 Camera_GetInputDirYaw(Camera* camera);
|
||||
Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera);
|
||||
s16 Camera_GetCamDirPitch(Camera* camera);
|
||||
@@ -703,7 +703,7 @@ s16 func_8005AD1C(Camera* camera, s16 arg1);
|
||||
s32 Camera_ResetAnim(Camera* camera);
|
||||
s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCameraPoint* eyePoints, Player* player,
|
||||
s16 relativeToPlayer);
|
||||
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 camDataIdx, f32 arg3, s16 timer1, s16 timer2,
|
||||
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2,
|
||||
s16 timer3);
|
||||
s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera);
|
||||
Vec3f* Camera_GetSkyboxOffset(Vec3f* dst, Camera* camera);
|
||||
|
||||
+22
-6
@@ -52,10 +52,26 @@ typedef struct {
|
||||
} CollisionPoly; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 cameraSType;
|
||||
/* 0x02 */ s16 numCameras;
|
||||
/* 0x04 */ Vec3s* camPosData;
|
||||
} CamData;
|
||||
/* 0x0 */ u16 setting; // camera setting described by CameraSettingType enum
|
||||
/* 0x2 */ s16 count; // only used when `bgCamFuncData` is a list of points used for crawlspaces
|
||||
/* 0x4 */ Vec3s* bgCamFuncData; // s16 data grouped in threes (ex. Vec3s), is usually of type `BgCamFuncData`, but can be a list of points of type `Vec3s` for crawlspaces
|
||||
} BgCamInfo; // size = 0x8
|
||||
|
||||
typedef BgCamInfo CamData; // Todo: Zapd compatibility
|
||||
|
||||
// The structure used for all instances of s16 data from `BgCamInfo` with the exception of crawlspaces.
|
||||
// See `Camera_Subj4` for Vec3s data usage in crawlspaces
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3s pos;
|
||||
/* 0x06 */ Vec3s rot;
|
||||
/* 0x0C */ s16 fov;
|
||||
/* 0x0E */ union {
|
||||
s16 jfifId;
|
||||
s16 timer;
|
||||
s16 flags;
|
||||
};
|
||||
/* 0x10 */ s16 unk_10; // unused
|
||||
} BgCamFuncData; // size = 0x12
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 xMin;
|
||||
@@ -68,7 +84,7 @@ typedef struct {
|
||||
// 0x0008_0000 = ?
|
||||
// 0x0007_E000 = Room Index, 0x3F = all rooms
|
||||
// 0x0000_1F00 = Lighting Settings Index
|
||||
// 0x0000_00FF = CamData index
|
||||
// 0x0000_00FF = BgCam Index
|
||||
} WaterBox; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
@@ -86,7 +102,7 @@ typedef struct {
|
||||
/* 0x14 */ u16 numPolygons;
|
||||
/* 0x18 */ CollisionPoly* polyList;
|
||||
/* 0x1C */ SurfaceType* surfaceTypeList;
|
||||
/* 0x20 */ CamData* cameraDataList;
|
||||
/* 0x20 */ BgCamInfo* bgCamList;
|
||||
/* 0x24 */ u16 numWaterBoxes;
|
||||
/* 0x28 */ WaterBox* waterBoxes;
|
||||
} CollisionHeader; // original name: BGDataInfo
|
||||
|
||||
+10
-10
@@ -906,7 +906,7 @@ typedef struct {
|
||||
/* 0x00 */ PosRot eyePosRot;
|
||||
/* 0x14 */ char unk_14[0x8];
|
||||
/* 0x1C */ s16 fov;
|
||||
/* 0x1E */ s16 jfifId;
|
||||
/* 0x1E */ s16 flags;
|
||||
} Data4ReadWriteData; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
@@ -976,7 +976,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ struct Actor* doorActor;
|
||||
/* 0x4 */ s16 camDataIdx;
|
||||
/* 0x4 */ s16 bgCamIndex;
|
||||
/* 0x6 */ s16 timer1;
|
||||
/* 0x8 */ s16 timer2;
|
||||
/* 0xA */ s16 timer3;
|
||||
@@ -1010,7 +1010,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* 0x00 */ Vec3f initalPos;
|
||||
/* 0x0C */ s16 animTimer;
|
||||
/* 0x10 */ InfiniteLine sceneCamPosPlayerLine;
|
||||
/* 0x10 */ InfiniteLine eyeAndDirection;
|
||||
} Unique0ReadWriteData; // size = 0x28
|
||||
|
||||
typedef struct {
|
||||
@@ -1363,8 +1363,8 @@ typedef struct {
|
||||
/* 0x104 */ f32 playerGroundY;
|
||||
/* 0x108 */ Vec3f floorNorm;
|
||||
/* 0x114 */ f32 waterYPos;
|
||||
/* 0x118 */ s32 waterPrevCamIdx;
|
||||
/* 0x11C */ s32 waterPrevCamSetting;
|
||||
/* 0x118 */ s32 bgCamIndexBeforeUnderwater;
|
||||
/* 0x11C */ s32 waterCamSetting;
|
||||
/* 0x120 */ s32 waterQuakeId;
|
||||
/* 0x124 */ void* data0;
|
||||
/* 0x128 */ void* data1;
|
||||
@@ -1377,23 +1377,23 @@ typedef struct {
|
||||
/* 0x140 */ s16 status;
|
||||
/* 0x142 */ s16 setting;
|
||||
/* 0x144 */ s16 mode;
|
||||
/* 0x146 */ s16 bgCheckId;
|
||||
/* 0x148 */ s16 camDataIdx;
|
||||
/* 0x146 */ s16 bgId; // bgId the camera is currently interacting with
|
||||
/* 0x148 */ s16 bgCamIndex;
|
||||
/* 0x14A */ s16 unk_14A;
|
||||
/* 0x14C */ s16 unk_14C;
|
||||
/* 0x14E */ s16 childCamId;
|
||||
/* 0x150 */ s16 waterDistortionTimer;
|
||||
/* 0x152 */ s16 distortionFlags;
|
||||
/* 0x154 */ s16 prevSetting;
|
||||
/* 0x156 */ s16 nextCamDataIdx;
|
||||
/* 0x158 */ s16 nextBGCheckId;
|
||||
/* 0x156 */ s16 nextBgCamIndex;
|
||||
/* 0x158 */ s16 nextBgId;
|
||||
/* 0x15A */ s16 roll;
|
||||
/* 0x15C */ s16 paramFlags;
|
||||
/* 0x15E */ s16 animState;
|
||||
/* 0x160 */ s16 timer;
|
||||
/* 0x162 */ s16 parentCamId;
|
||||
/* 0x164 */ s16 camId;
|
||||
/* 0x166 */ s16 prevCamDataIdx;
|
||||
/* 0x166 */ s16 prevBgCamIndex;
|
||||
/* 0x168 */ s16 csId;
|
||||
/* 0x16A */ s16 unk_16A;
|
||||
} Camera; // size = 0x16C
|
||||
|
||||
+1
-1
@@ -521,7 +521,7 @@ typedef struct Player {
|
||||
/* 0x0450 */ Vec3f unk_450;
|
||||
/* 0x045C */ Vec3f unk_45C;
|
||||
/* 0x0468 */ char unk_468[0x002];
|
||||
/* 0x046A */ s16 unk_46A;
|
||||
/* 0x046A */ s16 doorBgCamIndex;
|
||||
/* 0x046C */ s16 subCamId;
|
||||
/* 0x046E */ char unk_46E[0x02A];
|
||||
/* 0x0498 */ ColliderCylinder cylinder;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
struct {
|
||||
s8 room; // Room to switch to
|
||||
s8 effects; // How the camera reacts during the transition
|
||||
s8 bgCamIndex; // How the camera reacts during the transition. See `Camera_ChangeDoorCam`
|
||||
} /* 0x00 */ sides[2]; // 0 = front, 1 = back
|
||||
/* 0x04 */ s16 id;
|
||||
/* 0x06 */ Vec3s pos;
|
||||
|
||||
Reference in New Issue
Block a user