Reimplemented LOD

This commit is contained in:
KiritoDev 2021-05-22 11:56:16 -05:00
parent f56db9b48b
commit f354acac3d
1 changed files with 4 additions and 2 deletions

View File

@ -267,8 +267,10 @@ static void geo_process_perspective(struct GraphNodePerspective *node) {
* range of this node. * range of this node.
*/ */
static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) { static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) {
// We assume modern hardware is powerful enough to draw the most detailed variant // The fixed point Mtx type is defined as 16 longs, but it's actually 16
s16 distanceFromCam = 0; // shorts for the integer parts followed by 16 shorts for the fraction parts
Mtx *mtx = gMatStackFixed[gMatStackIndex];
s16 distanceFromCam = (s32) -mtx->m[3][2]; // z-component of the translation column
if (node->minDistance <= distanceFromCam && distanceFromCam < node->maxDistance) { if (node->minDistance <= distanceFromCam && distanceFromCam < node->maxDistance) {
if (node->node.children != 0) { if (node->node.children != 0) {