Skip to content

KBE3D / KBCore / Cesium / Math / incrementWrap

函数: incrementWrap()

incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number

Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.

参数

n?

number

The number to be incremented.

maximumValue?

number

The maximum incremented value before rolling over to the minimum value.

minimumValue?

number

The number reset to after the maximum value has been exceeded.

返回

number

The incremented number.

示例

ts
const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0

KBE3D @3.0.0 Copyright © 2024-present KBE3D