Class EntityVisibilityTester
java.lang.Object
dev.engine_room.flywheel.lib.visual.EntityVisibilityTester
A helper class for testing whether an Entity is visible.
The last visible AABB is also checked to prevent the Entity from freezing when it goes offscreen.
-
Constructor Summary
ConstructorsConstructorDescriptionEntityVisibilityTester(net.minecraft.world.entity.Entity entity, net.minecraft.core.Vec3i renderOrigin, float scale) Create a new EntityVisibilityTester. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck(org.joml.FrustumIntersection frustum) Check whether the Entity is visible.
-
Constructor Details
-
EntityVisibilityTester
public EntityVisibilityTester(net.minecraft.world.entity.Entity entity, net.minecraft.core.Vec3i renderOrigin, float scale) Create a new EntityVisibilityTester.- Parameters:
entity- The Entity to test.renderOrigin- The render origin according to the VisualizationContext.scale- Multiplier for the Entity's size, can be used to adjust for when an entity's model is larger than its hitbox.
-
-
Method Details
-
check
public boolean check(org.joml.FrustumIntersection frustum) Check whether the Entity is visible.- Parameters:
frustum- The frustum to test against.- Returns:
trueif the Entity is visible,falseotherwise.
-