Interface InstanceType<I extends Instance>
- Type Parameters:
I- The java representation of the instance.
- All Known Implementing Classes:
SimpleInstanceType
-
Method Summary
Modifier and TypeMethodDescriptioncreate(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.
-
Method Details
-
create
- Parameters:
handle- A handle that allows you to mark the instance as dirty or deleted.- Returns:
- A new, zeroed instance of I.
-
layout
Layout layout()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.
- Returns:
- The layout of this instance type.
-
writer
InstanceWriter<I> writer()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()).- Returns:
- The writer for this instance type.
-
vertexShader
net.minecraft.resources.ResourceLocation vertexShader()The vertex shader of an InstanceType is responsible for transforming vertices from mesh space to world space in whatever way the instance type requires.
- Returns:
- The vertex shader for this instance type.
-
cullShader
net.minecraft.resources.ResourceLocation cullShader()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.
- Returns:
- The cull shader for this instance type.
-