Fix frustum filtering tracker do not respect switch
This commit is contained in:
+4
@@ -11,4 +11,8 @@ public class FrustumFilteringTrackerConfig implements IConfigModule {
|
||||
public static boolean enabled = false;
|
||||
@ConfigInfo(name = "min_force_visible_distance")
|
||||
public static double minForceVisibleDistance = 5.0D;
|
||||
@ConfigInfo(name = "camera_fov")
|
||||
public static double camera_fov = 90;
|
||||
@ConfigInfo(name = "aspect")
|
||||
public static double aspect = 1.0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.nanachiyo0721.shiroha.utils;
|
||||
|
||||
import io.nanachiyo0721.shiroha.config.modules.optimizations.FrustumFilteringTrackerConfig;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
@@ -20,6 +21,15 @@ public class Culling {
|
||||
private final Player player;
|
||||
private float[] planes;
|
||||
|
||||
public static Culling fromConfig(Player player) {
|
||||
return new Builder()
|
||||
.fov((float) Math.toRadians(FrustumFilteringTrackerConfig.camera_fov))
|
||||
.near(NEAR)
|
||||
.aspect((float) FrustumFilteringTrackerConfig.aspect)
|
||||
.far(FAR)
|
||||
.build(player);
|
||||
}
|
||||
|
||||
@Contract(value = "_ -> new", pure = true)
|
||||
public static @NonNull Culling newDefault(Player player) {
|
||||
return fromBuilder(new Builder(), player);
|
||||
|
||||
Reference in New Issue
Block a user