Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(this.m_currentPanDistanceOrAngleIndex + 1) % USER_INPUTS_TO_CONSIDER;
this.m_recentPanDistancesOrAngles[
this.m_currentPanDistanceOrAngleIndex
] = panDistanceOrAngle;
this.m_lastAveragedPanDistanceOrAngle =
this.m_recentPanDistancesOrAngles.reduce((a, b) => a + b) / USER_INPUTS_TO_CONSIDER;
}
if (this.mapView.projection.type === geoUtils.ProjectionType.Planar) {
MapViewUtils.panCameraAboveFlatMap(
this.mapView,
this.m_panDistanceFrameDelta.x,
this.m_panDistanceFrameDelta.y
);
} else if (this.mapView.projection.type === geoUtils.ProjectionType.Spherical) {
MapViewUtils.panCameraAroundGlobe(
this.mapView,
this.m_lastRotateGlobeFromVector,
this.m_tmpVector3
.copy(this.m_lastRotateGlobeFromVector)
.applyQuaternion(this.m_rotateGlobeQuaternion)
);
}
if (!applyInertia) {
this.m_panDistanceFrameDelta.set(0, 0, 0);
this.m_lastRotateGlobeAngle = 0;
}
this.updateMapView();
}