fix(render): 方格垂直面被背面剔除(立面透明空洞/闪烁)+ 鼠标左右反转

- mesh.faceDef 六面绕序铁律:旧定义只有顶面是窗口空间顺时针
  (FrontFace=CW 的正面),底/东/西/南/北五面是逆时针被全部剔除——
  世界只剩顶面、立面透明、移动时面闪烁(数值投影验证 5 面 area>0 被剔)
- 覆盖层 cubeFaces(裂纹盒/手持方块)同步反转
- 鼠标右移应右转:yaw=0 朝 -Z,右转朝 +X 需 yaw 减小,dyaw 取反
  (原实现 dyaw += dx 左右颠倒)
This commit is contained in:
NianGao Dev
2026-08-16 20:01:13 +08:00
parent 768a9b8096
commit ea97eaa616
3 changed files with 18 additions and 12 deletions

View File

@@ -97,6 +97,8 @@ func (in *inputState) mouseButtonCallback(_ *glfw.Window, button glfw.MouseButto
}
// cursorCallback 鼠标移动:yaw/pitch 累积(渲染.md §2 主线程消费)。
// 约定:鼠标右移 dx>0 应右转(yaw 减小——yaw=0 朝向 -Z,右转朝 +X);
// 鼠标上移 dy<0 应抬头(pitch 增大)。
func (in *inputState) cursorCallback(_ *glfw.Window, x, y float64) {
in.cursorX, in.cursorY = x, y
if in.firstMouse {
@@ -107,7 +109,7 @@ func (in *inputState) cursorCallback(_ *glfw.Window, x, y float64) {
dx, dy := x-in.lastX, y-in.lastY
in.lastX, in.lastY = x, y
const sens = 0.0025
in.dyaw += dx * sens
in.dyaw -= dx * sens
in.dpitch -= dy * sens
}