diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index d5bf5778..1479c5c3 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -267,8 +267,10 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { * range of this node. */ static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) { - // We assume modern hardware is powerful enough to draw the most detailed variant - s16 distanceFromCam = 0; + // The fixed point Mtx type is defined as 16 longs, but it's actually 16 + // 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->node.children != 0) {