import { Object3D } from "three" ; import { createEarthImageMesh } from "./earth" ; import { earthGlow } from "./glow" ; import { GlobalConfig } from "../config/index" ; import { countryLine } from "./countryPolygon" ; import type { City , FlyData } from "../types/index" ; import { getCityMeshGroup } from "./cityPoint" ; import { earthAddFlyLine } from "./flyLine" ; import earthGlowPng from "../img/earth_glow.png" ; import earthGlowLightPng from "../img/earth_glow_light.png" ; export const earth3dObj = ( cityList ? , flyLineData ? ) => { var object3D = new Object3D ( ) ; let earthMesh = createEarthImageMesh ( GlobalConfig . earthRadius ) ; let glow = earthGlow ( GlobalConfig . earthRadius , earthGlowPng , 3.05 ) ; let glowLight = earthGlow ( GlobalConfig . earthRadius , earthGlowLightPng , 3.15 ) ; object3D . add ( countryLine ( GlobalConfig . earthRadius + 0.01 ) ) ; object3D . add ( earthMesh ) ; object3D . add ( glow ) ; object3D . add ( glowLight ) ; if ( cityList && flyLineData ) { let { waveMeshArr , pointMeshArr } = getCityMeshGroup ( cityList ) ; for ( let index = 0 ; index < waveMeshArr . length ; index ++ ) { const cityWaveMesh = waveMeshArr [ index ] ; const cityMesh = pointMeshArr [ index ] ; object3D . add ( cityMesh ) ; object3D . add ( cityWaveMesh ) ; } let flyManager = earthAddFlyLine ( object3D , flyLineData , cityList ) ; return { object3D , waveMeshArr , flyManager } ; } return { object3D } ; } ;