Files
ngzz-mc/cmd/client/entities_gl.go
NianGao Dev d52bf1126f feat(client): 植被染色、破坏裂纹叠加、手持方块与实体广告牌渲染;原版 HUD 精灵
- 植被染色(渲染.md §4.1):blocks.json 增 tint 标记,图集构建后按
  colormap/grass|foliage 中心色乘色——原版材质包草顶/树叶为灰度图,不染色全灰
- 破坏裂纹(方块交互与动画.md §4):destroy_stage_0..9 裂纹盒叠加破坏目标方块
- 第一人称手持方块(渲染.md §5.2):选中槽放置方块六面 UV 视图空间立方体
- 实体广告牌(渲染.md §5.3):僵尸/村民/动物按贴图渲染,动物按 ID 轮换外观
- HUD 换原版精灵:crosshair/hotbar/hotbar_selection/heart/food(UI还原.md §3.4)
- 主菜单标题/按钮标签按请求字号光栅化(修复 24px 固定字号);版本角标 CJK
- 恢复背面剔除(相机修复后 '脚下黑块' 误诊解除);ESC 光标请求原子化防竞态
- dev 测试参数:-give/-crackstage/-spawntest/-esctest
2026-08-16 10:08:40 +08:00

31 lines
812 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//go:build gl
// 实体可视映射:实体类型 → 广告牌贴图键与高度(渲染.md §5.3)。
package main
import "mc/internal/entity"
// entityVisual 返回实体的贴图键与身高(米)。
// 动物按 ID 轮换四种外观(cow/pig/sheep/chicken)。
func entityVisual(e *entity.Entity) (key string, height float32) {
switch e.Kind {
case entity.KindZombie:
return "entity/zombie/zombie", 1.95
case entity.KindVillager:
return "entity/villager/villager", 1.95
case entity.KindAnimal:
switch e.ID % 4 {
case 0:
return "entity/cow/cow_temperate", 1.4
case 1:
return "entity/pig/pig_temperate", 0.9
case 2:
return "entity/sheep/sheep", 1.3
default:
return "entity/chicken/chicken_temperate", 0.7
}
default:
return "", 0 // 掉落物等后置接入
}
}