Class EmbeddedEnvironment

java.lang.Object
dev.engine_room.flywheel.backend.engine.embed.EmbeddedEnvironment
All Implemented Interfaces:
VisualEmbedding, VisualizationContext, Environment

public class EmbeddedEnvironment extends Object implements VisualEmbedding, Environment
  • Field Details

    • matrixIndex

      public int matrixIndex
  • Constructor Details

    • EmbeddedEnvironment

      public EmbeddedEnvironment(EngineImpl engine, net.minecraft.core.Vec3i renderOrigin, @Nullable @Nullable EmbeddedEnvironment parent)
    • EmbeddedEnvironment

      public EmbeddedEnvironment(EngineImpl engine, net.minecraft.core.Vec3i renderOrigin)
  • Method Details

    • transforms

      public void transforms(org.joml.Matrix4fc pose, org.joml.Matrix3fc normal)
      Description copied from interface: VisualEmbedding
      Set the transformation matrices for the embedding.
      Specified by:
      transforms in interface VisualEmbedding
      Parameters:
      pose - The model matrix.
      normal - The normal matrix.
    • instancerProvider

      public InstancerProvider instancerProvider()
      Specified by:
      instancerProvider in interface VisualizationContext
      Returns:
      The InstancerProvider that the visual can use to get instancers to render models.
    • renderOrigin

      public net.minecraft.core.Vec3i renderOrigin()
      Description copied from interface: VisualizationContext
      All models render as if this position is (0, 0, 0).

      For a Visual to appear in the correct position in the world, it must render at its actual world position minus this renderOrigin.
      i.e. be.getBlockPos() - visualizationContext.renderOrigin()

      This exists to prevent floating point precision issues when the camera is far away from the level's origin.

      Specified by:
      renderOrigin in interface VisualizationContext
      Returns:
      The origin of the renderer as a level position.
    • createEmbedding

      public VisualEmbedding createEmbedding(net.minecraft.core.Vec3i renderOrigin)
      Description copied from interface: VisualizationContext
      Create a new embedding to compose visuals.
      Specified by:
      createEmbedding in interface VisualizationContext
      Parameters:
      renderOrigin - The renderOrigin the embedding will appear to have.
      Returns:
      The embedding.
      See Also:
    • contextShader

      public ContextShader contextShader()
      Specified by:
      contextShader in interface Environment
    • setupDraw

      public void setupDraw(GlProgram program)
      Specified by:
      setupDraw in interface Environment
    • matrixIndex

      public int matrixIndex()
      Specified by:
      matrixIndex in interface Environment
    • flush

      public void flush(long ptr)
    • isDeleted

      public boolean isDeleted()
    • delete

      public void delete()
      Called by visuals
      Specified by:
      delete in interface VisualEmbedding