mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Sphere16
MeshHeaderCullEntry.bounds
This commit is contained in:
parent
e4fe9d63cd
commit
cbe55e8090
2 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue