|
@@ -194,8 +194,8 @@ window.initHot = function(model){
|
|
|
|
|
|
//没有单独设置position的漫游点使用的position
|
|
|
this.position.copy(curPanoTransform.pos || info.position)
|
|
|
- this.rotation.copy(info.rotation)
|
|
|
- this.scale.copy(info.scale)
|
|
|
+ this.quaternion.copy(curPanoTransform.quaternion || info.quaternion)
|
|
|
+ this.scale.copy(curPanoTransform.scale || info.scale)
|
|
|
|
|
|
this.changeTexType(info.texType, media)
|
|
|
|
|
@@ -527,12 +527,14 @@ window.initHot = function(model){
|
|
|
|
|
|
|
|
|
if(info.quaternion){
|
|
|
- info.rotation = new THREE.Euler().setFromVector3(convertValue(info.quaternion, THREE.Quaternion ))
|
|
|
+ if(info.quaternion){
|
|
|
+ info.quaternion = convertValue(info.quaternion, THREE.Quaternion )
|
|
|
}else{
|
|
|
- info.rotation = new THREE.Euler().setFromVector3(convertValue(info.rotation, THREE.Vector3 )) //热点的旧数据很多是字符串
|
|
|
+ info.rotation = convertValue(info.rotation, THREE.Vector3 )
|
|
|
+ info.quaternion = new THREE.Quaternion().setFromEuler( new THREE.Euler().setFromVector3(info.rotation)) //热点的旧数据很多是字符串
|
|
|
}
|
|
|
|
|
|
- var s = Hot.getDefaulScale(info.hotIconScale)
|
|
|
+ var s = Hot.getDefaulScale(info.hotIconScale) //旧版的大小,统一转换成新版
|
|
|
info.scale = new THREE.Vector3(s,s,0.02)
|
|
|
|
|
|
|
|
@@ -554,7 +556,7 @@ window.initHot = function(model){
|
|
|
|
|
|
delete info.media
|
|
|
|
|
|
- info.rotation = new THREE.Euler().setFromQuaternion(convertValue(info.qua, THREE.Quaternion ))
|
|
|
+ info.quaternion = convertValue(info.qua, THREE.Quaternion)
|
|
|
info.position = info.pos
|
|
|
delete info.pos;
|
|
|
delete info.qua;
|
|
@@ -572,7 +574,7 @@ window.initHot = function(model){
|
|
|
delete info.file
|
|
|
}else{
|
|
|
|
|
|
- info.rotation = new THREE.Euler().fromArray(info.rotation)//.setFromVector3(info.rotation)
|
|
|
+ info.quaternion = new THREE.Quaternion().setFromEuler(new THREE.Euler().fromArray(info.rotation))//.setFromVector3(info.rotation)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -583,6 +585,10 @@ window.initHot = function(model){
|
|
|
info.video = info.video || []
|
|
|
info.iframe = info.iframe || []
|
|
|
info.styleImg = info.styleImg || []
|
|
|
+ info.imagesDesc = info.imagesDesc || []
|
|
|
+ info.videosDesc = info.videosDesc || []
|
|
|
+ info.titleShowType = info.titleShowType || 'hover'
|
|
|
+ info.titlePos = info.titlePos || 'right'
|
|
|
|
|
|
}
|
|
|
|
|
@@ -596,15 +602,17 @@ window.initHot = function(model){
|
|
|
//为了兼容旧数据,尽量和hot的数据靠近,最后保存在hot里
|
|
|
info.position = convertValue(info.position, THREE.Vector3)
|
|
|
info.scale = convertValue(info.scale, THREE.Vector3)
|
|
|
- delete info.quaternion
|
|
|
+ delete info.rotation //暂时不用,只有保存时才存为roration
|
|
|
|
|
|
info.linkType = info.linkType || "common"
|
|
|
|
|
|
|
|
|
for (let i in info.transformAtPanos) {
|
|
|
info.transformAtPanos[i].pos = new THREE.Vector3().fromArray(info.transformAtPanos[i].pos)
|
|
|
- //info.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(info.transformAtPanos[i].qua)
|
|
|
+ info.transformAtPanos[i].qua && (info.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(info.transformAtPanos[i].qua))
|
|
|
+ info.transformAtPanos[i].scale && (info.transformAtPanos[i].scale = new THREE.Vector3().fromArray(info.transformAtPanos[i].scale))
|
|
|
}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -692,7 +700,7 @@ window.initHot = function(model){
|
|
|
var getPos = (position)=>{//每个overlay位置对应5个坐标,plane中心和四个角的位置
|
|
|
if(this.plane){
|
|
|
return cornerPoint.map(e=>{
|
|
|
- return e.clone().applyEuler(this.info.rotation).add(position)
|
|
|
+ return e.clone().applyQuaternion(this.info.quaternion).add(position)
|
|
|
})
|
|
|
|
|
|
}else{
|