Class EmbeddedEnvironment
java.lang.Object
dev.engine_room.flywheel.backend.engine.embed.EmbeddedEnvironment
- All Implemented Interfaces:
VisualEmbedding,VisualizationContext,Environment
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedEnvironment(EngineImpl engine, net.minecraft.core.Vec3i renderOrigin) EmbeddedEnvironment(EngineImpl engine, net.minecraft.core.Vec3i renderOrigin, @Nullable EmbeddedEnvironment parent) -
Method Summary
Modifier and TypeMethodDescriptioncreateEmbedding(net.minecraft.core.Vec3i renderOrigin) Create a new embedding to compose visuals.voiddelete()Called by visualsvoidflush(long ptr) booleanintnet.minecraft.core.Vec3iAll models render as if this position is (0, 0, 0).voidvoidtransforms(org.joml.Matrix4fc pose, org.joml.Matrix3fc normal) Set the transformation matrices for the embedding.
-
Field Details
-
matrixIndex
public int matrixIndex
-
-
Constructor Details
-
EmbeddedEnvironment
public EmbeddedEnvironment(EngineImpl engine, net.minecraft.core.Vec3i renderOrigin, @Nullable @Nullable EmbeddedEnvironment parent) -
EmbeddedEnvironment
-
-
Method Details
-
transforms
public void transforms(org.joml.Matrix4fc pose, org.joml.Matrix3fc normal) Description copied from interface:VisualEmbeddingSet the transformation matrices for the embedding.- Specified by:
transformsin interfaceVisualEmbedding- Parameters:
pose- The model matrix.normal- The normal matrix.
-
instancerProvider
- Specified by:
instancerProviderin interfaceVisualizationContext- Returns:
- The
InstancerProviderthat the visual can use to get instancers to render models.
-
renderOrigin
public net.minecraft.core.Vec3i renderOrigin()Description copied from interface:VisualizationContextAll 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:
renderOriginin interfaceVisualizationContext- Returns:
- The origin of the renderer as a level position.
-
createEmbedding
Description copied from interface:VisualizationContextCreate a new embedding to compose visuals.- Specified by:
createEmbeddingin interfaceVisualizationContext- Parameters:
renderOrigin- The renderOrigin the embedding will appear to have.- Returns:
- The embedding.
- See Also:
-
contextShader
- Specified by:
contextShaderin interfaceEnvironment
-
setupDraw
- Specified by:
setupDrawin interfaceEnvironment
-
matrixIndex
public int matrixIndex()- Specified by:
matrixIndexin interfaceEnvironment
-
flush
public void flush(long ptr) -
isDeleted
public boolean isDeleted() -
delete
public void delete()Called by visuals- Specified by:
deletein interfaceVisualEmbedding
-