Class ShadowComponent
java.lang.Object
dev.engine_room.flywheel.lib.visual.component.ShadowComponent
- All Implemented Interfaces:
EntityComponent
A component that uses instances to render an entity's shadow.
Use radius(float) to set the radius of the shadow, in blocks.
Use strength(float) to set the strength of the shadow.
The shadow will be cast on blocks at most min(radius, 2 * strength) blocks below the entity.
-
Constructor Summary
ConstructorsConstructorDescriptionShadowComponent(VisualizationContext context, net.minecraft.world.entity.Entity entity) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginFrame(DynamicVisual.Context context) Update the shadow instances.voiddelete()floatradius()radius(float radius) Set the radius of the shadow, in blocks, clamped to a maximum of 32.floatstrength()strength(float strength) Set the strength of the shadow.
-
Constructor Details
-
ShadowComponent
-
-
Method Details
-
radius
public float radius() -
strength
public float strength() -
radius
Set the radius of the shadow, in blocks, clamped to a maximum of 32.Setting this to
<= 0will disable the shadow.- Parameters:
radius- The radius of the shadow, in blocks.
-
strength
Set the strength of the shadow.- Parameters:
strength- The strength of the shadow.
-
beginFrame
Update the shadow instances. You'd typically call this in your visual'sbeginFramemethod.- Specified by:
beginFramein interfaceEntityComponent- Parameters:
context- The frame context.
-
delete
public void delete()- Specified by:
deletein interfaceEntityComponent
-