Class CpuFrustumCuller

java.lang.Object
com.hbm_m.client.render.culling.CpuFrustumCuller

public final class CpuFrustumCuller extends Object
Лёгкий CPU AABB-vs-frustum культинг. Fallback в OcclusionCullingHelper, когда vanilla Frustum недоступен.

Стоимость: 6 dot-product сравнений на BE + одна квадратичная дистанция. На 1000 BE это <0.1 ms, против 7.8 ms у raycast-варианта.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
     
    static boolean
     
    static boolean
    isVisible(net.minecraft.world.phys.AABB box)
    True если хотя бы одна корня AABB внутри/пересекает фрустум.
    static boolean
    isVisibleWithDistance(net.minecraft.world.phys.AABB box, net.minecraft.world.phys.Vec3 cameraPos, double maxDistSq)
     
    static void
    updateFrustum(org.joml.Matrix4f viewProj)
    Извлекает 6 плоскостей фрустума из viewProj-матрицы (Gribb/Hartmann).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • updateFrustum

      public static void updateFrustum(org.joml.Matrix4f viewProj)
      Извлекает 6 плоскостей фрустума из viewProj-матрицы (Gribb/Hartmann). Должен вызываться раз в кадр в render-thread с актуальной матрицей проекции * вида (без перевода в block-space).
    • isVisible

      public static boolean isVisible(net.minecraft.world.phys.AABB box)
      True если хотя бы одна корня AABB внутри/пересекает фрустум.
    • isVisibleWithDistance

      public static boolean isVisibleWithDistance(net.minecraft.world.phys.AABB box, net.minecraft.world.phys.Vec3 cameraPos, double maxDistSq)
    • invalidate

      public static void invalidate()
    • isReady

      public static boolean isReady()