Interface VisualizationContext
- All Known Subinterfaces:
VisualEmbedding
A context object passed on visual creation.
-
Method Summary
Modifier and TypeMethodDescriptioncreateEmbedding(net.minecraft.core.Vec3i renderOrigin) Create a new embedding to compose visuals.net.minecraft.core.Vec3iAll models render as if this position is (0, 0, 0).
-
Method Details
-
instancerProvider
InstancerProvider instancerProvider()- Returns:
- The
InstancerProviderthat the visual can use to get instancers to render models.
-
renderOrigin
net.minecraft.core.Vec3i renderOrigin()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.
- Returns:
- The origin of the renderer as a level position.
-
createEmbedding
Create a new embedding to compose visuals.- Parameters:
renderOrigin- The renderOrigin the embedding will appear to have.- Returns:
- The embedding.
- See Also:
-