diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2024-12-15 19:11:29 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-15 19:11:29 +1100 |
| commit | 6156df5fee16f528d9949a87b27943c5f747a11d (patch) | |
| tree | e2d077e0915da35b5c3f7b5052f1f7a468e5d500 /include | |
| parent | 9e2ef99d2ecdd6c13612b79809ef5fe112b72ad9 (diff) | |
Document Culling (#1759)
* culling docs
* cleanup
* PR suggestions
Diffstat (limited to 'include')
| -rw-r--r-- | include/z64actor.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/include/z64actor.h b/include/z64actor.h index 0faa4ff0d..24f28abdd 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -131,9 +131,9 @@ typedef struct Actor { /* 0x0BC */ ActorShape shape; // Variables related to the physical shape of the actor /* 0x0EC */ Vec3f projectedPos; // Position of the actor in projected space /* 0x0F8 */ f32 projectedW; // w component of the projected actor position - /* 0x0FC */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space) - /* 0x100 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space) - /* 0x104 */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space) + /* 0x0FC */ f32 cullingVolumeDistance; // Forward distance of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information. + /* 0x100 */ f32 cullingVolumeScale; // Scale of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information. + /* 0x104 */ f32 cullingVolumeDownward; // Downward height of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information. /* 0x108 */ Vec3f prevPos; // World position from the previous update cycle /* 0x114 */ u8 isLockedOn; // Set to true if the actor is currently being targeted by the player /* 0x115 */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting @@ -480,12 +480,25 @@ typedef enum DoorLockType { // What actually matters is the presence or lack of `ACTOR_FLAG_HOSTILE`. #define ACTOR_FLAG_FRIENDLY (1 << 3) -// -#define ACTOR_FLAG_10 (1 << 4) -// -#define ACTOR_FLAG_20 (1 << 5) -// -#define ACTOR_FLAG_40 (1 << 6) +// Culling of the actor's update process is disabled. +// In other words, the actor will keep updating even if the actor is outside its own culling volume. +// See `Actor_CullingCheck` for more information about culling. +// See `Actor_CullingVolumeTest` for more information on the test used to determine if an actor should be culled. +#define ACTOR_FLAG_UPDATE_CULLING_DISABLED (1 << 4) + +// Culling of the actor's draw process is disabled. +// In other words, the actor will keep drawing even if the actor is outside its own culling volume. +// See `Actor_CullingCheck` for more information about culling. +// See `Actor_CullingVolumeTest` for more information on the test used to determine if an actor should be culled. +// (The original name for this flag is `NO_CULL_DRAW`, known from the Majora's Mask Debug ROM) +#define ACTOR_FLAG_DRAW_CULLING_DISABLED (1 << 5) + +// Set if the actor is currently within the bounds of its culling volume. +// In most cases, this flag can be used to determine whether or not an actor is currently culled. +// However this flag still updates even if `ACTOR_FLAG_UPDATE_CULLING_DISABLED` or `ACTOR_FLAG_DRAW_CULLING_DISABLED` +// are set. Meaning, the flag can still have a value of "false" even if it is not actually culled. +// (The original name for this flag is `NO_CULL_FLAG`, known from the Majora's Mask Debug ROM) +#define ACTOR_FLAG_INSIDE_CULLING_VOLUME (1 << 6) // hidden or revealed by Lens of Truth (depending on room lensMode) #define ACTOR_FLAG_REACT_TO_LENS (1 << 7) |
