fix: align world splat initial orientation
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-05-25 21:15:44 +08:00
parent 026bfd0615
commit 446b87443c

View File

@ -100,6 +100,8 @@ const DEFAULT_MESH_SETTINGS: Model3DViewerSettings = {
wireframe: false, wireframe: false,
}; };
const WORLDLABS_ASSET_ROTATION: [number, number, number] = [Math.PI, 0, 0];
const EMPTY_MOVEMENT_STATE: MovementState = { const EMPTY_MOVEMENT_STATE: MovementState = {
forward: false, forward: false,
backward: false, backward: false,
@ -1322,7 +1324,7 @@ function WorldSplatScene({
revealCompletedRef.current = false; revealCompletedRef.current = false;
setParticleCloudData(null); setParticleCloudData(null);
splatMesh.frustumCulled = false; splatMesh.frustumCulled = false;
splatMesh.rotation.set(0, 0, 0); splatMesh.rotation.set(...WORLDLABS_ASSET_ROTATION);
applySparkRevealProfile(sparkRenderer, splatMesh, SPLAT_LOADING_PROFILE); applySparkRevealProfile(sparkRenderer, splatMesh, SPLAT_LOADING_PROFILE);
let cancelled = false; let cancelled = false;
@ -1949,7 +1951,7 @@ function WorldSplatViewer({
<Model3DViewer <Model3DViewer
emptyStateTitle="准备加载 3D Mesh" emptyStateTitle="准备加载 3D Mesh"
layerVisibility={fallbackMeshLayerVisibility} layerVisibility={fallbackMeshLayerVisibility}
modelRotation={[Math.PI, 0, 0]} modelRotation={WORLDLABS_ASSET_ROTATION}
modelUrl={resolvedFallbackMeshUrl} modelUrl={resolvedFallbackMeshUrl}
onCaptureReady={onCaptureReady} onCaptureReady={onCaptureReady}
onLayersChange={onFallbackMeshLayersChange} onLayersChange={onFallbackMeshLayersChange}
@ -2087,7 +2089,7 @@ export function World3DViewer({
<Model3DViewer <Model3DViewer
emptyStateTitle={emptyStateTitle} emptyStateTitle={emptyStateTitle}
layerVisibility={meshLayerVisibility} layerVisibility={meshLayerVisibility}
modelRotation={[Math.PI, 0, 0]} modelRotation={WORLDLABS_ASSET_ROTATION}
modelUrl={meshUrl} modelUrl={meshUrl}
onLayersChange={onMeshLayersChange} onLayersChange={onMeshLayersChange}
onStatsChange={onMeshStatsChange} onStatsChange={onMeshStatsChange}