Class BillboardStrategy
java.lang.Object
cromveil.combatnumbers.client.render.BillboardStrategy
- All Implemented Interfaces:
Strategy
- Direct Known Subclasses:
ScreenStrategy, WorldStrategy
public abstract sealed class BillboardStrategy
extends Object
implements Strategy
permits WorldStrategy, ScreenStrategy
Shared base for strategies related to world space rendered text.
Both
WorldStrategy and ScreenStrategy cull against the view
frustum and emit glyphs with an identical face-camera / offset / rotate /
scale transform; they differ only in how the glyph anchor is placed and which
depth drives the GUI-pixel-to-world scale.-
Nested Class Summary
Nested classes/interfaces inherited from interface Strategy
Strategy.GlyphPlacement -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBillboardStrategy(com.mojang.blaze3d.vertex.PoseStack ps, net.minecraft.client.renderer.SubmitNodeCollector collector, net.minecraft.client.renderer.state.level.CameraRenderState cam) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract floatanchor(net.minecraft.world.phys.Vec3 worldPos) Translate the pose to this text's anchor and return the GUI-pixel-to-world factor used for the subsequent offset and scale steps.net.minecraft.world.phys.Vec3camPos()Camera position used by the shared driver for distance-based fade and scaling.static BillboardStrategycreate(RenderOption option, com.mojang.blaze3d.vertex.PoseStack ps, net.minecraft.client.renderer.SubmitNodeCollector collector, net.minecraft.client.renderer.state.level.CameraRenderState cam) booleancull(FloatingText text) Per-text visibility test.voiddraw(FloatingText text, int charIndex, boolean perChar, Strategy.GlyphPlacement placement) Emit a single glyph (the whole text, or one staggered character).
-
Field Details
-
ps
protected final com.mojang.blaze3d.vertex.PoseStack ps -
collector
protected final net.minecraft.client.renderer.SubmitNodeCollector collector -
cam
protected final net.minecraft.client.renderer.state.level.CameraRenderState cam
-
-
Constructor Details
-
BillboardStrategy
protected BillboardStrategy(com.mojang.blaze3d.vertex.PoseStack ps, net.minecraft.client.renderer.SubmitNodeCollector collector, net.minecraft.client.renderer.state.level.CameraRenderState cam)
-
-
Method Details
-
create
public static BillboardStrategy create(RenderOption option, com.mojang.blaze3d.vertex.PoseStack ps, net.minecraft.client.renderer.SubmitNodeCollector collector, net.minecraft.client.renderer.state.level.CameraRenderState cam) -
camPos
-
cull
Description copied from interface:StrategyPer-text visibility test. Implementations may stash strategy-specific data (e.g. projected screen coordinates) as a side effect. -
draw
public void draw(FloatingText text, int charIndex, boolean perChar, Strategy.GlyphPlacement placement) Description copied from interface:StrategyEmit a single glyph (the whole text, or one staggered character). -
anchor
protected abstract float anchor(net.minecraft.world.phys.Vec3 worldPos) Translate the pose to this text's anchor and return the GUI-pixel-to-world factor used for the subsequent offset and scale steps.
-