Class SimpleInstanceType<I extends Instance>
- All Implemented Interfaces:
InstanceType<I>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSimpleInstanceType.Builder<I extends Instance>static interfaceSimpleInstanceType.Factory<I extends Instance> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleInstanceType(SimpleInstanceType.Factory<I> factory, Layout layout, InstanceWriter<I> writer, net.minecraft.resources.ResourceLocation vertexShader, net.minecraft.resources.ResourceLocation cullShader) -
Method Summary
Modifier and TypeMethodDescriptionstatic <I extends Instance>
SimpleInstanceType.Builder<I>builder(SimpleInstanceType.Factory<I> factory) create(InstanceHandle handle) net.minecraft.resources.ResourceLocationThe cull shader of this instance type.layout()The native memory layout of this instance type.net.minecraft.resources.ResourceLocationThe vertex shader of an InstanceType is responsible for transforming vertices from mesh space to world space in whatever way the instance type requires.writer()The writer of this instance type.
-
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
- Specified by:
createin interfaceInstanceType<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
Description copied from interface:InstanceTypeThe 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:
layoutin interfaceInstanceType<I extends Instance>- Returns:
- The layout of this instance type.
-
writer
Description copied from interface:InstanceTypeThe 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:
writerin interfaceInstanceType<I extends Instance>- Returns:
- The writer for this instance type.
-
vertexShader
public net.minecraft.resources.ResourceLocation vertexShader()Description copied from interface:InstanceTypeThe 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:
vertexShaderin interfaceInstanceType<I extends Instance>- Returns:
- The vertex shader for this instance type.
-
cullShader
public net.minecraft.resources.ResourceLocation cullShader()Description copied from interface:InstanceTypeThe 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:
cullShaderin interfaceInstanceType<I extends Instance>- Returns:
- The cull shader for this instance type.
-