How to use the @here/harp-materials.ExtrusionFeature.DEFAULT_RATIO_MIN function in @here/harp-materials

To help you get started, we’ve selected a few @here/harp-materials examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-mapview / lib / AnimatedExtrusionHandler.ts View on Github external
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();
    };
}