Class EngineImpl
java.lang.Object
dev.engine_room.flywheel.backend.engine.EngineImpl
- All Implemented Interfaces:
Engine
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.engine_room.flywheel.api.backend.Engine
Engine.CrumblingBlock -
Constructor Summary
ConstructorsConstructorDescriptionEngineImpl(net.minecraft.world.level.LevelAccessor level, DrawManager<? extends AbstractInstancer<?>> drawManager, int maxOriginDistance) -
Method Summary
Modifier and TypeMethodDescriptionCreate a plan that will start execution after the start of the level render and finish execution beforeEngine.render(dev.engine_room.flywheel.api.backend.RenderContext)is called.Create a visualization context that will be used to create visuals of the given type.voiddelete()Free all resources associated with this engine.DrawManager<? extends AbstractInstancer<?>> instancer(Environment environment, InstanceType<I> type, Model model, int bias) voidlightSections(it.unimi.dsi.fastutil.longs.LongSet sections) Assign the set of sections that visuals have requested GPU light for.voidonLightUpdate(net.minecraft.core.SectionPos sectionPos, net.minecraft.world.level.LightLayer layer) voidrender(RenderContext context) Render all instances necessary for the given visual type.voidrenderCrumbling(RenderContext context, List<Engine.CrumblingBlock> crumblingBlocks) Render the given instances as a crumbling overlay.net.minecraft.core.Vec3ibooleanupdateRenderOrigin(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
public EngineImpl(net.minecraft.world.level.LevelAccessor level, DrawManager<? extends AbstractInstancer<?>> drawManager, int maxOriginDistance)
-
-
Method Details
-
createVisualizationContext
Description copied from interface:EngineCreate a visualization context that will be used to create visuals of the given type.- Specified by:
createVisualizationContextin interfaceEngine- Returns:
- A new visualization context.
-
createFramePlan
Description copied from interface:EngineCreate a plan that will start execution after the start of the level render and finish execution beforeEngine.render(dev.engine_room.flywheel.api.backend.RenderContext)is called.- Specified by:
createFramePlanin interfaceEngine- Returns:
- A new plan.
-
renderOrigin
public net.minecraft.core.Vec3i renderOrigin()- Specified by:
renderOriginin interfaceEngine- Returns:
- The current render origin.
-
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.
-
lightSections
public void lightSections(it.unimi.dsi.fastutil.longs.LongSet sections) Description copied from interface:EngineAssign the set of sections that visuals have requested GPU light for.This will be called at most once per frame, and not necessarily every frame.
- Specified by:
lightSectionsin interfaceEngine- Parameters:
sections- The set of sections.
-
onLightUpdate
public void onLightUpdate(net.minecraft.core.SectionPos sectionPos, net.minecraft.world.level.LightLayer layer) - Specified by:
onLightUpdatein interfaceEngine
-
render
Description copied from interface:EngineRender all instances necessary for the given visual type.This method is guaranteed to be called after the frame plan has finished execution and before
Engine.renderCrumbling(dev.engine_room.flywheel.api.backend.RenderContext, java.util.List<dev.engine_room.flywheel.api.backend.Engine.CrumblingBlock>)are called. This method is guaranteed to be called on the render thread. -
renderCrumbling
Description copied from interface:EngineRender the given instances as a crumbling overlay.This method is guaranteed to be called after
Engine.render(dev.engine_room.flywheel.api.backend.RenderContext)for the current level render. This method is guaranteed to be called on the render thread.- Specified by:
renderCrumblingin interfaceEngine- Parameters:
context- The context for the current level render.crumblingBlocks- The instances to render. This list is never empty.
-
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.
This method is guaranteed to be called on the render thread.
-
instancer
public <I extends Instance> Instancer<I> instancer(Environment environment, InstanceType<I> type, Model model, int bias) -
environmentStorage
-
lightStorage
-
drawManager
-