Class SimpleInstanceType<I extends Instance>

java.lang.Object
dev.engine_room.flywheel.lib.instance.SimpleInstanceType<I>
All Implemented Interfaces:
InstanceType<I>

public final class SimpleInstanceType<I extends Instance> extends Object implements InstanceType<I>
  • Constructor Details

    • SimpleInstanceType

      public SimpleInstanceType(SimpleInstanceType.Factory<I> factory, Layout layout, InstanceWriter<I> writer, net.minecraft.resources.ResourceLocation vertexShader, net.minecraft.resources.ResourceLocation cullShader)
  • Method Details

    • builder

      public static <I extends Instance> SimpleInstanceType.Builder<I> builder(SimpleInstanceType.Factory<I> factory)
    • create

      public I create(InstanceHandle handle)
      Specified by:
      create in interface InstanceType<I extends Instance>
      Parameters:
      handle - A handle that allows you to mark the instance as dirty or deleted.
      Returns:
      A new, zeroed instance of I.
    • layout

      public Layout layout()
      Description copied from interface: InstanceType
      The native memory layout of this instance type.

      This layout determines what fields are made available to the instance type's shaders as well as determining how the fields are arranged in memory.

      Specified by:
      layout in interface InstanceType<I extends Instance>
      Returns:
      The layout of this instance type.
    • writer

      public InstanceWriter<I> writer()
      Description copied from interface: InstanceType
      The writer of this instance type.

      The writer of an InstanceType is responsible for translating java instance objects into contiguous native memory. The instance writer must write to the given pointer according to the layout of this instance type.

      It is undefined behavior to write outside the half closed range [ptr, ptr + layout().byteSize()).

      Specified by:
      writer in interface InstanceType<I extends Instance>
      Returns:
      The writer for this instance type.
    • vertexShader

      public net.minecraft.resources.ResourceLocation vertexShader()
      Description copied from interface: InstanceType

      The vertex shader of an InstanceType is responsible for transforming vertices from mesh space to world space in whatever way the instance type requires.

      Specified by:
      vertexShader in interface InstanceType<I extends Instance>
      Returns:
      The vertex shader for this instance type.
    • cullShader

      public net.minecraft.resources.ResourceLocation cullShader()
      Description copied from interface: InstanceType
      The cull shader of this instance type.

      The cull shader of an InstanceType is responsible for transforming bounding spheres from mesh space to world space, such that a mesh contained by the input bounding sphere and transformed by the vertex shader would be contained by the output bounding sphere.

      Specified by:
      cullShader in interface InstanceType<I extends Instance>
      Returns:
      The cull shader for this instance type.