Interface DynamicInstance
- All Superinterfaces:
Instance
- All Known Implementing Classes:
BellInstance,ChestInstance,MinecartInstance,ShulkerBoxInstance
An interface giving
If your goal is offloading work to shaders, but you're unsure exactly how you need to parameterize the instances, you're encouraged to implement this for prototyping.
BlockEntityInstances a hook to have a function called at
the start of a frame. By implementing DynamicInstance, a BlockEntityInstance
can animate its models in ways that could not be easily achieved by shader attribute
parameterization.
If your goal is offloading work to shaders, but you're unsure exactly how you need to parameterize the instances, you're encouraged to implement this for prototyping.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled every frame, and after initialization.default booleanAs a further optimization, dynamic instances that are far away are ticked less often.Methods inherited from interface com.jozufozu.flywheel.api.instance.Instance
getWorldPosition
-
Method Details
-
beginFrame
void beginFrame()Called every frame, and after initialization.
DISPATCHED IN PARALLEL, don't attempt to mutate anything outside this instance.
Instancer/InstanceDatacreation/acquisition is safe here. -
decreaseFramerateWithDistance
default boolean decreaseFramerateWithDistance()As a further optimization, dynamic instances that are far away are ticked less often. This behavior can be disabled by returning false.
You might want to opt out of this if you want your animations to remain smooth even when far away from the camera. It is recommended to keep this as is, however.- Returns:
trueif your instance should be slow ticked.
-