1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

Sphere16 MeshHeaderCullEntry.bounds

This commit is contained in:
Dragorn421 2022-06-16 20:32:06 +02:00
parent e4fe9d63cd
commit cbe55e8090
No known key found for this signature in database
GPG key ID: 32B53D2D16FC4118
2 changed files with 6 additions and 7 deletions

View file

@ -128,8 +128,7 @@ typedef struct {
} MeshHeaderPrerenderMulti; // size = 0x10
typedef struct {
/* 0x00 */ Vec3s pos;
/* 0x06 */ s16 radius;
/* 0x00 */ Sphere16 bounds;
/* 0x08 */ Gfx* opa;
/* 0x0C */ Gfx* xlu;
} MeshHeaderCullEntry; // size = 0x10

View file

@ -135,16 +135,16 @@ void Room_DrawCullMeshes(PlayState* play, Room* room, u32 flags) {
for (i = 0; i < meshHeaderCull->numEntries; i++, meshHeaderCullEntry++) {
// Project the entry position, to get the depth it is at.
pos.x = meshHeaderCullEntry->pos.x;
pos.y = meshHeaderCullEntry->pos.y;
pos.z = meshHeaderCullEntry->pos.z;
pos.x = meshHeaderCullEntry->bounds.center.x;
pos.y = meshHeaderCullEntry->bounds.center.y;
pos.z = meshHeaderCullEntry->bounds.center.z;
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &projectedPos, &projectedW);
// If the entry isn't fully before the rendered depth range
if (-(f32)meshHeaderCullEntry->radius < projectedPos.z) {
if (-(f32)meshHeaderCullEntry->bounds.radius < projectedPos.z) {
// Compute the depth at which this entry starts
entryStartZ = projectedPos.z - meshHeaderCullEntry->radius;
entryStartZ = projectedPos.z - meshHeaderCullEntry->bounds.radius;
// If the entry isn't fully beyond the rendered depth range
if (entryStartZ < play->lightCtx.fogFar) {