import { Fragment, useCallback } from "react"; import { Entity, LabelGraphics, ModelGraphics, useCesium } from "resium"; import arrowRound from "@/assets/arrow_round.glb"; import { CallbackProperty, Cartesian2, Cartesian3, Color, ColorBlendMode, LabelStyle, } from "cesium"; let totalSeconds = 60; let numberOfSamples = 120; let wheelAngle = 0; function Cyclone() { const { viewer } = useCesium(); // 自转 // const position = new Cesium.SampledPositionProperty(); // const velocityVectorProperty = new Cesium.VelocityVectorProperty( // position, // false // ); // const velocityVector = new Cesium.Cartesian3(); // const wheelAngleProperty = new Cesium.SampledProperty(Number); // for (let index = 0; index < numberOfSamples; index++) { // const factor = index / numberOfSamples; // const time = Cesium.JulianDate.addSeconds( // startTime, // factor * totalSeconds, // new Cesium.JulianDate() // ); // velocityVectorProperty.getValue(time, velocityVector); // wheelAngle -= 3; // wheelAngleProperty.addSample(time, wheelAngle); // } // const rotationProperty = new Cesium.CallbackProperty(function (time, result) { // return Cesium.Quaternion.fromAxisAngle( // Cesium.Cartesian3.UNIT_Z, // wheelAngleProperty.getValue(time) || wheelAngleProperty._values[0], // result // ); // }, false); const getPassTime = useCallback(() => { const { startTime, currentTime } = viewer.clock; const _time = Math.floor(currentTime.secondsOfDay - startTime.secondsOfDay); return _time; }, [viewer]); const anticycloneColor = Color.fromCssColorString("#f70000"); const cycloneColor = Color.fromCssColorString("#00AC4D"); return ( ); } export default Cyclone;