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
This commit is contained in:
@@ -109,12 +109,6 @@ func (in *inputState) cursorCallback(_ *glfw.Window, x, y float64) {
|
||||
const sens = 0.0025
|
||||
in.dyaw += dx * sens
|
||||
in.dpitch -= dy * sens
|
||||
if in.dpitch > math.Pi/2-0.01 {
|
||||
in.dpitch = math.Pi/2 - 0.01
|
||||
}
|
||||
if in.dpitch < -math.Pi/2+0.01 {
|
||||
in.dpitch = -math.Pi/2 + 0.01
|
||||
}
|
||||
}
|
||||
|
||||
// scrollCallback 滚轮切热键栏(UI与输入.md §6)。
|
||||
@@ -131,12 +125,21 @@ func (in *inputState) apply(s *game.Session) {
|
||||
cam := s.Cam
|
||||
p := s.Player
|
||||
|
||||
// 视角
|
||||
// 视角(俯仰钳制在相机上,而非增量上——旧实现钳增量,抬头可翻转超过 ±90°)
|
||||
if in.dyaw != 0 || in.dpitch != 0 {
|
||||
cam.Yaw += in.dyaw
|
||||
cam.Pitch += in.dpitch
|
||||
in.dyaw, in.dpitch = 0, 0
|
||||
const maxPitch = math.Pi/2 - 0.01
|
||||
if cam.Pitch > maxPitch {
|
||||
cam.Pitch = maxPitch
|
||||
}
|
||||
if cam.Pitch < -maxPitch {
|
||||
cam.Pitch = -maxPitch
|
||||
}
|
||||
}
|
||||
// 游戏中左键=破坏,不是 UI 点击:清除遗留点击状态,防止暂停菜单收到过期点击
|
||||
in.clicked = false
|
||||
|
||||
// 水平移动(物理与碰撞.md §3:走/冲刺/潜行)
|
||||
f := cam.Forward()
|
||||
|
||||
Reference in New Issue
Block a user