fix: 优化空格播放和截图角色标签对不上

This commit is contained in:
2026-09-17 19:39:24 +08:00
parent 8d67f17a84
commit e66e3374bf
19 changed files with 633 additions and 58 deletions

View File

@@ -41,6 +41,7 @@ import { getEffectiveGroundOpacity } from "./panoramaMath";
import { getGroundAxisLines } from "./sceneAxes";
import { GROUND_GRID_ELEVATION, GROUND_PLANE_SIZE, GROUND_SURFACE_SIDE } from "./sceneGround";
import { getSceneGroupTransform } from "./sceneTransform";
import { HIDE_FROM_VIEWPORT_CAPTURE_KEY } from "./viewportCapture";
import { getCrowdAnchorTransform } from "../store/directorStore";
export { getEffectiveGroundOpacity, getPanoramaRotationRadians } from "./panoramaMath";
@@ -55,7 +56,6 @@ const VIEWPORT_CAMERA_LINE_OPACITY = 0.92;
const VIEWPORT_CAMERA_HIT_PADDING = 0.06;
const VIEWPORT_CAMERA_FORWARD = new Vector3(0, 0, 1);
const VIEWPORT_CAMERA_WORLD_UP = new Vector3(0, 1, 0);
const HIDE_FROM_VIEWPORT_CAPTURE_KEY = "hideFromViewportCapture";
const VIEWPORT_CAMERA_BODY_CENTER: CameraWirePoint = [0, 0, -0.52 * VIEWPORT_CAMERA_VISUAL_SCALE];
const VIEWPORT_CAMERA_BODY_SIZE: CameraWirePoint = [
0.4 * VIEWPORT_CAMERA_VISUAL_SCALE,
@@ -967,14 +967,17 @@ function TrajectoryPath({
<circleGeometry args={[0.3, 24]} />
<meshBasicMaterial depthWrite={false} opacity={0} transparent />
</mesh>
{/* 实心小球:选中用高亮色,否则用角色色 */}
{/* 实心小球:选中用高亮色,否则用角色色。
这里必须写深度(用材质默认值 true,别改成 false):地面是 transparent 材质,
即使透明度为 1 也走透明通道、排在所有不透明物体之后渲染;
小球一旦不写深度,地面就会整片盖住它 —— 表现就是「地面不透明时看不到轨迹点」。 */}
<mesh
name={`trajectory-point-${point.id}`}
userData={{ [HIDE_FROM_VIEWPORT_CAPTURE_KEY]: true }}
onClick={interactive ? (event) => selectPoint(point.id, event) : undefined}
>
<sphereGeometry args={[0.1, 18, 14]} />
<meshBasicMaterial color={selected ? TRAJECTORY_SELECTED_COLOR : color} depthWrite={false} />
<meshBasicMaterial color={selected ? TRAJECTORY_SELECTED_COLOR : color} />
</mesh>
</group>
);
@@ -1073,7 +1076,7 @@ export function SceneRoot() {
<mesh position={[0, scene.groundHeight, 0]} rotation={[-Math.PI / 2, 0, 0]}>
<planeGeometry args={[GROUND_PLANE_SIZE, GROUND_PLANE_SIZE]} />
<meshBasicMaterial
color="#303640"
color={scene.groundColor}
opacity={getEffectiveGroundOpacity(scene.groundOpacity, Boolean(panoramaAsset))}
polygonOffset
polygonOffsetFactor={1}