MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / update_flights

Function update_flights

libs/mapv/mapv.3d.js:1909–1931  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1907}
1908
1909function update_flights() {
1910 if (!flight_point_cloud_geom) {
1911 return;
1912 }
1913 flight_point_cloud_geom.attributes.position.needsUpdate = true;
1914
1915 for (var i = start_flight_idx; i < end_flight_idx; ++i) {
1916
1917 if (Date.now() > flight_point_start_time[i]) {
1918 var ease_val = easeOutQuadratic(Date.now() - flight_point_start_time[i], 0, 1, flight_point_end_time[i] - flight_point_start_time[i]);
1919
1920 if (ease_val < 0 || flight_point_speed_changed) {
1921 ease_val = 0;
1922 setFlightTimes(i);
1923 }
1924
1925 var pos = flight_path_splines[i].getPoint(ease_val);
1926 positions[3 * i + 0] = pos.x;
1927 positions[3 * i + 1] = pos.y;
1928 positions[3 * i + 2] = pos.z;
1929 }
1930 }
1931}
1932
1933function setFlightTimes(index) {
1934 var scaling_factor = (flight_point_speed_scaling - flight_point_speed_min_scaling) / (flight_point_speed_max_scaling - flight_point_speed_min_scaling);

Callers 1

mapv.3d.jsFile · 0.85

Calls 2

easeOutQuadraticFunction · 0.85
setFlightTimesFunction · 0.85

Tested by

no test coverage detected