Class EngineImpl
java.lang.Object
com.jozufozu.flywheel.backend.engine.EngineImpl
- All Implemented Interfaces:
Engine
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jozufozu.flywheel.api.backend.Engine
Engine.CrumblingBlock -
Constructor Summary
ConstructorsConstructorDescriptionEngineImpl(DrawManager<? extends AbstractInstancer<?>> drawManager, int maxOriginDistance) -
Method Summary
Modifier and TypeMethodDescriptionCreate a plan that will be executed every frame.Create a visualization context that will render to the given stage.voiddelete()Free all resources associated with this engine.instancer(Environment environment, InstanceType<I> type, Model model, RenderStage stage) voidrenderCrumbling(TaskExecutor executor, RenderContext context, List<Engine.CrumblingBlock> crumblingBlocks) Render the given instances as a crumbling overlay.net.minecraft.core.Vec3ivoidrenderStage(TaskExecutor executor, RenderContext context, RenderStage stage) Render all instances necessary for the given stage.booleanupdateRenderOrigin(net.minecraft.client.Camera camera) Maintain the render origin to be within a certain distance from the camera in all directions, preventing floating point precision issues at high coordinates.
-
Constructor Details
-
EngineImpl
-
-
Method Details
-
createFramePlan
Description copied from interface:EngineCreate a plan that will be executed every frame.- Specified by:
createFramePlanin interfaceEngine- Returns:
- A new plan.
-
renderStage
Description copied from interface:EngineRender all instances necessary for the given stage.- Specified by:
renderStagein interfaceEngine- Parameters:
executor- The task executor running the frame plan.context- The render context for this frame.stage- The stage to render.
-
renderCrumbling
public void renderCrumbling(TaskExecutor executor, RenderContext context, List<Engine.CrumblingBlock> crumblingBlocks) Description copied from interface:EngineRender the given instances as a crumbling overlay.
This is guaranteed to be called between the first and last calls toEngine.renderStage(com.jozufozu.flywheel.api.task.TaskExecutor, com.jozufozu.flywheel.api.event.RenderContext, com.jozufozu.flywheel.api.event.RenderStage)for the current frame.- Specified by:
renderCrumblingin interfaceEngine- Parameters:
executor- The task executor running the frame plan.context- The render context for this frame.crumblingBlocks- The instances to render. This list is never empty.
-
createVisualizationContext
Description copied from interface:EngineCreate a visualization context that will render to the given stage.- Specified by:
createVisualizationContextin interfaceEngine- Parameters:
stage- The stage to render to.- Returns:
- A new visualization context.
-
updateRenderOrigin
public boolean updateRenderOrigin(net.minecraft.client.Camera camera) Description copied from interface:EngineMaintain the render origin to be within a certain distance from the camera in all directions, preventing floating point precision issues at high coordinates.- Specified by:
updateRenderOriginin interfaceEngine- Returns:
trueif the render origin changed,falseotherwise.
-
renderOrigin
public net.minecraft.core.Vec3i renderOrigin()- Specified by:
renderOriginin interfaceEngine- Returns:
- The current render origin.
-
delete
public void delete()Description copied from interface:EngineFree all resources associated with this engine.
This engine will not be used again after this method is called. -
instancer
public <I extends Instance> Instancer<I> instancer(Environment environment, InstanceType<I> type, Model model, RenderStage stage) -
environmentStorage
-