fix: 使用 demo 真实视角 yaw 替代速度向量绘制朝向箭头 - #11
Open
Halcy0nS wants to merge 1 commit into
Open
Conversation
parse_positions 额外提取 yaw 字段,路径采样从 [t,x,y] 扩展为 [t,x,y,yaw]。replay.js _interp 支持返回 yaw(跳过 ±180° 跨越 不插值),drawAt 优先用 -yaw*π/180 计算箭头角度(雷达 Y 翻转), 无 yaw 时回退到原有速度向量方向。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
箭头方向从「移动方向(速度向量)」升级为「真实视角方向(yaw)」。
原问题
原代码用位置差算速度向量
atan2(vy, vx)画箭头,显示的是玩家移动方向而非视角方向。玩家横移、架枪、急停时两者差别很大。修复
server/parse.pyparse_positions额外提取yaw,路径从[t,x,y]扩展为[t,x,y,yaw]server/static/replay.js_interp返回 yaw(±180° 跨越时不插值),drawAt优先用-yaw*π/180画箭头,无 yaw 时回退到速度方向验证