Files
cmr-mini/doc/rendering/轨迹可视化方案.md

91 lines
1.4 KiB
Markdown
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.
# 轨迹可视化方案
> 文档版本v1.0
> 最后更新2026-04-02
本文档定义用户轨迹的显示模式、默认策略与配置结构。
目标:
- 支持 `none / full / tail` 三种轨迹模式
- `tail` 模式有更强的实时感和游戏感
- 兼顾低端机性能
## 模式定义
### `none`
- 不显示轨迹
- 只显示当前 GPS 点
### `full`
- 显示从开始到当前的完整轨迹
### `tail`
- 只显示最近一小段拖尾轨迹
- 头部更亮、更粗
- 尾部逐步变淡、变细
- 用户停止移动后,轨迹会逐步缩短到消失
## 推荐默认值
### 顺序赛
- `mode = full`
- `style = classic`
### 积分赛
- `mode = tail`
- `style = neon`
## 推荐配置
```json
"game": {
"presentation": {
"track": {
"mode": "tail",
"style": "neon",
"tailMeters": 60,
"tailMaxSeconds": 30,
"fadeOutWhenStill": true,
"stillSpeedKmh": 0.6,
"fadeOutDurationMs": 3000,
"colorHex": "#176d5d",
"headColorHex": "#54f3d8",
"widthPx": 5,
"headWidthPx": 10,
"glowStrength": 0.42
}
}
}
```
## 当前实现约定
当前第一版实现支持:
- `mode`
- `style`
- `tailMeters`
- `tailMaxSeconds`
- `fadeOutWhenStill`
- `stillSpeedKmh`
- `fadeOutDurationMs`
- `colorHex`
- `headColorHex`
- `widthPx`
- `headWidthPx`
- `glowStrength`
## 后续扩展
- 轨迹颜色按心率区间变化
- 轨迹颜色按速度变化
- `standard / lite` 下自动降级 glow