FlameFeatureRenderer.java
net.minecraft.client.renderer.feature.FlameFeatureRenderer
信息
- 全限定名:net.minecraft.client.renderer.feature.FlameFeatureRenderer
- 类型:public class
- 包:net.minecraft.client.renderer.feature
- 源码路径:src/main/java/net/minecraft/client/renderer/feature/FlameFeatureRenderer.java
- 起始行号:L19
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public void renderSolid(SubmitNodeCollection nodeCollection, MultiBufferSource.BufferSource bufferSource, AtlasManager atlasManager) @ L20
- 方法名:renderSolid
- 源码定位:L20
- 返回类型:void
- 修饰符:public
参数:
- nodeCollection: SubmitNodeCollection
- bufferSource: MultiBufferSource.BufferSource
- atlasManager: AtlasManager
说明:
TODO
private void renderFlame(PoseStack.Pose pose, MultiBufferSource bufferSource, EntityRenderState state, Quaternionf rotation, AtlasManager atlasManager) @ L26
- 方法名:renderFlame
- 源码定位:L26
- 返回类型:void
- 修饰符:private
参数:
- pose: PoseStack.Pose
- bufferSource: MultiBufferSource
- state: EntityRenderState
- rotation: Quaternionf
- atlasManager: AtlasManager
说明:
TODO
private static void fireVertex(PoseStack.Pose pose, VertexConsumer buffer, float x, float y, float z, float u, float v, int lightCoords) @ L64
- 方法名:fireVertex
- 源码定位:L64
- 返回类型:void
- 修饰符:private static
参数:
- pose: PoseStack.Pose
- buffer: VertexConsumer
- x: float
- y: float
- z: float
- u: float
- v: float
- lightCoords: int
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class FlameFeatureRenderer {
public void renderSolid(SubmitNodeCollection nodeCollection, MultiBufferSource.BufferSource bufferSource, AtlasManager atlasManager) {
for (SubmitNodeStorage.FlameSubmit flameSubmit : nodeCollection.getFlameSubmits()) {
this.renderFlame(flameSubmit.pose(), bufferSource, flameSubmit.entityRenderState(), flameSubmit.rotation(), atlasManager);
}
}
private void renderFlame(PoseStack.Pose pose, MultiBufferSource bufferSource, EntityRenderState state, Quaternionf rotation, AtlasManager atlasManager) {
TextureAtlasSprite fire1 = atlasManager.get(ModelBakery.FIRE_0);
TextureAtlasSprite fire2 = atlasManager.get(ModelBakery.FIRE_1);
float s = state.boundingBoxWidth * 1.4F;
pose.scale(s, s, s);
float r = 0.5F;
float xo = 0.0F;
float h = state.boundingBoxHeight / s;
float yo = 0.0F;
pose.rotate(rotation);
pose.translate(0.0F, 0.0F, 0.3F - (int)h * 0.02F);
float zo = 0.0F;
int ss = 0;
VertexConsumer buffer = bufferSource.getBuffer(Sheets.cutoutBlockSheet());
for (int lightCoords = LightCoordsUtil.withBlock(state.lightCoords, 15); h > 0.0F; ss++) {
TextureAtlasSprite tex = ss % 2 == 0 ? fire1 : fire2;
float u0 = tex.getU0();
float v0 = tex.getV0();
float u1 = tex.getU1();
float v1 = tex.getV1();
if (ss / 2 % 2 == 0) {
float tmp = u1;
u1 = u0;
u0 = tmp;
}
fireVertex(pose, buffer, -r - 0.0F, 0.0F - yo, zo, u1, v1, lightCoords);
fireVertex(pose, buffer, r - 0.0F, 0.0F - yo, zo, u0, v1, lightCoords);
fireVertex(pose, buffer, r - 0.0F, 1.4F - yo, zo, u0, v0, lightCoords);
fireVertex(pose, buffer, -r - 0.0F, 1.4F - yo, zo, u1, v0, lightCoords);
h -= 0.45F;
yo -= 0.45F;
r *= 0.9F;
zo -= 0.03F;
}
}
private static void fireVertex(PoseStack.Pose pose, VertexConsumer buffer, float x, float y, float z, float u, float v, int lightCoords) {
buffer.addVertex(pose, x, y, z).setColor(-1).setUv(u, v).setUv1(0, 10).setLight(lightCoords).setNormal(pose, 0.0F, 1.0F, 0.0F);
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Sheets.cutoutBlockSheet()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
LightCoordsUtil.withBlock()
- 引用位置: