Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const currentTime = Date.now();
if (
this.m_animatedExtrusionStartTime === undefined ||
this.m_animatedExtrusionStartTime <= 0
) {
this.m_animatedExtrusionStartTime = currentTime;
}
const timeProgress = Math.min(
currentTime - this.m_animatedExtrusionStartTime,
this.m_animatedExtrusionDuration
);
this.extrusionRatio = MathUtils.easeInOutCubic(
ExtrusionFeature.DEFAULT_RATIO_MIN,
ExtrusionFeature.DEFAULT_RATIO_MAX,
timeProgress / this.m_animatedExtrusionDuration
);
if (timeProgress >= this.m_animatedExtrusionDuration) {
this.m_animatedExtrusionState = AnimatedExtrusionState.Finished;
this.stopExtrusionAnimation();
}
this.m_tile.dataSource.requestUpdate();
};
}