diff options
| author | fig02 <fig02srl@gmail.com> | 2024-12-13 08:12:52 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-13 08:12:52 -0500 |
| commit | 016aef482b2f9354db8c1abec2bf08e36c55f5ad (patch) | |
| tree | ad4863749880c2a8b36f4f82cec12ae6e2bf59bf /include | |
| parent | a897017af5c169718e983cd62d90334196d9856f (diff) | |
Document Culling (#2318)
* document culling
* format
* depth -> distance
* format
* var name
* new graph link
* rephrase actor flags
* tharo's comments + some more tweaks
* is this causing the problem?
* change wording
* cant scope the temp
* format
* dragorn review
* bad merge
* player -> camera in descriptions
* more its
* cadmic review
* goddamn it why do i have that habit
* projected
Diffstat (limited to 'include')
| -rw-r--r-- | include/z64actor.h | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/include/z64actor.h b/include/z64actor.h index 344f5e15c..c134d4d65 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -130,14 +130,25 @@ typedef struct ActorShape { // What actually matters is the presence or lack of `ACTOR_FLAG_HOSTILE`. #define ACTOR_FLAG_FRIENDLY (1 << 3) -// -#define ACTOR_FLAG_4 (1 << 4) - -// -#define ACTOR_FLAG_5 (1 << 5) - -// -#define ACTOR_FLAG_6 (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) @@ -277,9 +288,9 @@ typedef struct Actor { /* 0x0B4 */ ActorShape shape; // Variables related to the physical shape of the actor /* 0x0E4 */ Vec3f projectedPos; // Position of the actor in projected space /* 0x0F0 */ f32 projectedW; // w component of the projected actor position - /* 0x0F4 */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space) - /* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space) - /* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space) + /* 0x0F4 */ f32 cullingVolumeDistance; // Forward distance of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information. + /* 0x0F8 */ f32 cullingVolumeScale; // Scale of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information. + /* 0x0FC */ f32 cullingVolumeDownward; // Downward height of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information. /* 0x100 */ Vec3f prevPos; // World position from the previous update cycle /* 0x10C */ u8 isLockedOn; // Set to true if the actor is currently locked-on by Player /* 0x10D */ u8 attentionPriority; // Lower values have higher priority. Resets to 0 when lock-on is released. @@ -886,7 +897,7 @@ s32 func_8002F9EC(struct PlayState* play, Actor* actor, struct CollisionPoly* po void Actor_DisableLens(struct PlayState* play); void Actor_InitContext(struct PlayState* play, ActorContext* actorCtx, struct ActorEntry* playerEntry); void Actor_UpdateAll(struct PlayState* play, ActorContext* actorCtx); -s32 func_800314D4(struct PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3); +s32 Actor_CullingVolumeTest(struct PlayState* play, Actor* actor, Vec3f* projPos, f32 projW); void func_800315AC(struct PlayState* play, ActorContext* actorCtx); void Actor_KillAllWithMissingObject(struct PlayState* play, ActorContext* actorCtx); void func_80031B14(struct PlayState* play, ActorContext* actorCtx); |
