12-17
This commit is contained in:
@ -642,7 +642,7 @@ class TrajectoryMotion extends Base {
|
||||
set state(v) {
|
||||
this.options.state = v
|
||||
cancelAnimationFrame(this._requestAnimationFrameEventId)
|
||||
if (this.editObj) {
|
||||
if (this.options.state && this.editObj) {
|
||||
this.editObj.destroy()
|
||||
this.editObj = null
|
||||
if (this._DialogObject && this._DialogObject._element && this._DialogObject._element.content) {
|
||||
@ -1573,11 +1573,15 @@ class TrajectoryMotion extends Base {
|
||||
animateUpdate
|
||||
)
|
||||
if (_this.options.firstPersonView) {
|
||||
let targetHeading = _this.model.heading + 90 + _this.firstPersonHeadingPitch.heading
|
||||
if(!_this.routeDirection) {
|
||||
targetHeading = 180 - targetHeading
|
||||
}
|
||||
let positionCamera = { ..._this.sdk.viewer.camera._position }
|
||||
_this.sdk.viewer.camera.setView({
|
||||
destination: positionCamera,
|
||||
orientation: {
|
||||
heading: Cesium.Math.toRadians(_this.model.heading + 90 + _this.firstPersonHeadingPitch.heading),
|
||||
heading: Cesium.Math.toRadians(targetHeading),
|
||||
pitch: Cesium.Math.toRadians(_this.firstPersonHeadingPitch.pitch),
|
||||
roll: 0
|
||||
}
|
||||
@ -1805,10 +1809,14 @@ class TrajectoryMotion extends Base {
|
||||
if (_this.viewFollow) {
|
||||
// console.log(Cesium.Math.toDegrees(_this.sdk.viewer.camera.pitch))
|
||||
if (_this.options.firstPersonView) {
|
||||
let targetHeading = heading + 90 + _this.firstPersonHeadingPitch.heading
|
||||
if(!_this.routeDirection) {
|
||||
targetHeading = 180 - targetHeading
|
||||
}
|
||||
_this.sdk.viewer.camera.setView({
|
||||
destination: positionCamera,
|
||||
orientation: {
|
||||
heading: Cesium.Math.toRadians(heading + 90 + _this.firstPersonHeadingPitch.heading),
|
||||
heading: Cesium.Math.toRadians(targetHeading),
|
||||
pitch: Cesium.Math.toRadians(_this.firstPersonHeadingPitch.pitch),
|
||||
roll: 0
|
||||
}
|
||||
@ -2296,6 +2304,7 @@ class TrajectoryMotion extends Base {
|
||||
this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].innerHTML = '开始调整'
|
||||
this._DialogObject._element.content.getElementsByClassName('model-rotate-btn')[0].className = 'btn model-rotate-btn'
|
||||
}
|
||||
return false
|
||||
}
|
||||
else {
|
||||
if (this.viewFollow) {
|
||||
@ -2344,6 +2353,8 @@ class TrajectoryMotion extends Base {
|
||||
Cesium.Matrix4.multiply(originalMatrix, rotationY, originalMatrix)
|
||||
Cesium.Matrix4.multiply(originalMatrix, rotationZ, this.entity.modelMatrix)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@ -2384,7 +2395,7 @@ class TrajectoryMotion extends Base {
|
||||
// maximumScale: 100000,
|
||||
}
|
||||
const getAnimationsList = () => {
|
||||
if (this.options.model.url === this.originalOptions.model.url) {
|
||||
if (this.originalOptions && this.options.model.url === this.originalOptions.model.url) {
|
||||
this.modelAnimate = this.originalOptions.model.animate
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user