Pārlūkot izejas kodu

imporve the track interpolation

tags/2.2.5
Caven Chen pirms 4 gadiem
vecāks
revīzija
60a846358f
1 mainītis faili ar 20 papildinājumiem un 5 dzēšanām
  1. 20
    5
      modules/history-track/Track.js

+ 20
- 5
modules/history-track/Track.js Parādīt failu



const DEF_OPTS = { const DEF_OPTS = {
clampToGround: false, clampToGround: false,
clampToTileset: false
clampToTileset: false,
interpolationType: 'Hermite',
interpolationDegree: 2
} }


const DEF_PATH_STYLE = { const DEF_PATH_STYLE = {
) )
this._sampledPosition.forwardExtrapolationType = this._sampledPosition.forwardExtrapolationType =
Cesium.ExtrapolationType.HOLD Cesium.ExtrapolationType.HOLD
this._sampledPosition.setInterpolationOptions({
interpolationDegree: 5,
interpolationAlgorithm: Cesium.HermitePolynomialApproximation
})
/// setInterpolationOptions
if (this._options.interpolationType === 'Hermite') {
this._sampledPosition.setInterpolationOptions({
interpolationDegree: this._options.interpolationDegree || 2,
interpolationAlgorithm: Cesium.HermitePolynomialApproximation
})
} else if (this._options.interpolationType === 'Linear') {
this._sampledPosition.setInterpolationOptions({
interpolationDegree: this._options.interpolationDegree || 1,
interpolationAlgorithm: Cesium.LinearApproximation
})
} else if (this._options.interpolationType === 'Lagrange') {
this._sampledPosition.setInterpolationOptions({
interpolationDegree: this._options.interpolationDegree || 5,
interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
})
}
this._delegate.orientation = new Cesium.VelocityOrientationProperty( this._delegate.orientation = new Cesium.VelocityOrientationProperty(
this._sampledPosition this._sampledPosition
) )

Notiek ielāde…
Atcelt
Saglabāt