Class AbstractEntityVisual<T extends net.minecraft.world.entity.Entity>

java.lang.Object
dev.engine_room.flywheel.lib.visual.AbstractVisual
dev.engine_room.flywheel.lib.visual.AbstractEntityVisual<T>
Type Parameters:
T - The type of Entity.
All Implemented Interfaces:
EntityVisual<T>, Visual
Direct Known Subclasses:
ComponentEntityVisual

public abstract class AbstractEntityVisual<T extends net.minecraft.world.entity.Entity> extends AbstractVisual implements EntityVisual<T>
The layer between an Entity and the Flywheel backend.

There are a few additional features that overriding classes can opt in to: See the interfaces' documentation for more information about each one.
Implementing one or more of these will give an AbstractEntityVisual access to more interesting and regular points within a tick or a frame.
  • Field Details

    • entity

      protected final T extends net.minecraft.world.entity.Entity entity
    • visibilityTester

      protected final EntityVisibilityTester visibilityTester
  • Constructor Details

    • AbstractEntityVisual

      public AbstractEntityVisual(VisualizationContext ctx, T entity, float partialTick)
  • Method Details

    • distanceSquared

      public double distanceSquared(double x, double y, double z)
      Calculate the distance squared between this visual and the given level position.
      Parameters:
      x - The x coordinate.
      y - The y coordinate.
      z - The z coordinate.
      Returns:
      The distance squared between this visual and the given position.
    • getVisualPosition

      public org.joml.Vector3f getVisualPosition()
      In order to accommodate for floating point precision errors at high coordinates, VisualizationManagers are allowed to arbitrarily adjust the origin, and shift the level matrix provided as a shader uniform accordingly.
      Returns:
      The position this visual should be rendered at to appear in the correct location.
    • getVisualPosition

      public org.joml.Vector3f getVisualPosition(float partialTick)
      In order to accommodate for floating point precision errors at high coordinates, VisualizationManagers are allowed to arbitrarily adjust the origin, and shift the level matrix provided as a shader uniform accordingly.
      Returns:
      The position this visual should be rendered at to appear in the correct location.
    • isVisible

      public boolean isVisible(org.joml.FrustumIntersection frustum)
    • computePackedLight

      protected int computePackedLight(float partialTick)
    • relight

      protected void relight(float partialTick, @Nullable @Nullable FlatLit... instances)