Files
inspectredcandGarrett Cox 04d56e8fbd 'Free/Debug' Camera & Free Look Camera (#323)
* Remove BenPort.h from functions.h

* use specific z64 includes

* free cam

* this -> thisx

* fl newline

* whitespace

* remove debugging stuff

* min and max cam heights. use correct func_800CBFA4 arg

* document and re-organise free cam

* fix linux building

* Custom Camera VB

* remove redundant section in header

* fix hook and re-organise menu

* Free Cam

* fix control flipping and some speed tweaks

* Fix Player flags not being reset

* Fix movement under roll: todo fix rotation under roll

* six degrees of freedom

* Multiple camera mode options, remove black bars, start with focal point by eye

* update free look

* cvar rename, menu disabling

* remove player state flag change

* renaming and remove some camera jumpiness

* remove scam comment

* remove port selection

* correct debugcam at initialised position

* fix focal point for non roll
2024-05-22 09:05:04 -05:00

46 lines
1.7 KiB
C

#ifndef CAMERA_UTILS_H
#define CAMERA_UTILS_H
#include "ultratypes.h"
// Camera will reload its paramData. Usually that means setting the read-only data from what is stored in
// CameraModeValue arrays. Although sometimes some read-write data is reset as well
#define RELOAD_PARAMS(camera) ((camera->animState == 0) || (camera->animState == 10) || (camera->animState == 20))
/**
* Camera data is stored in both read-only data and OREG as s16, and then converted to the appropriate type during
* runtime. If a small f32 is being stored as an s16, it is common to store that value 100 times larger than the
* original value. This is then scaled back down during runtime with the CAM_RODATA_UNSCALE macro.
*/
#define CAM_RODATA_SCALE(x) ((x)*100.0f)
#define CAM_RODATA_UNSCALE(x) ((x)*0.01f)
// Load the next value from camera read-only data stored in CameraModeValue
#define GET_NEXT_RO_DATA(values) ((values++)->val)
// Load the next value and scale down from camera read-only data stored in CameraModeValue
#define GET_NEXT_SCALED_RO_DATA(values) CAM_RODATA_UNSCALE(GET_NEXT_RO_DATA(values))
typedef struct {
/* 0x0 */ s16 val;
/* 0x2 */ s16 param;
} CameraModeValue; // size = 0x4
typedef struct {
/* 0x0 */ s16 funcId;
/* 0x2 */ s16 numValues;
/* 0x4 */ CameraModeValue* values;
} CameraMode; // size = 0x8
/**
* Flags:
* (flags & 0xF): Priority (lower value has higher priority)
* (flags & 0x40000000): Store previous setting and bgCamData, also ignores water checks
* (flags & 0x80000000): Set camera setting based on bg/scene data and reset action function state
*/
typedef struct {
/* 0x0 */ u32 validModes;
/* 0x4 */ u32 flags;
/* 0x8 */ CameraMode* cameraModes;
} CameraSetting; // size = 0xC
#endif // CAMERA_UTILS_H