|
@@ -2,10 +2,13 @@ var g_ProjectName = window.location.pathname.substring(
|
|
|
window.location.pathname.indexOf('/') + 1,
|
|
|
window.location.pathname.lastIndexOf('/')
|
|
|
)
|
|
|
-var g_Prefix = 'https://super.4dage.com/'
|
|
|
-// var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
|
|
|
+// var g_Prefix = 'https://super.4dage.com/'
|
|
|
+var g_Prefix = window.location.href.substring(0, window.location.href.indexOf("/index.html") + 1)
|
|
|
+console.log(g_Prefix)
|
|
|
var s = window.location.href.split('/')
|
|
|
s.pop()
|
|
|
+window.isLocal = true
|
|
|
+
|
|
|
//var g_Prefix = s.join('/');
|
|
|
var g_index = null
|
|
|
var g_modeldata = null
|
|
@@ -92,8 +95,8 @@ window.browser = {
|
|
|
return 'boolean' == typeof t
|
|
|
? 'true' === r || '1' === r
|
|
|
: 'number' == typeof t
|
|
|
- ? parseFloat(r)
|
|
|
- : window.decodeURIComponent(r)
|
|
|
+ ? parseFloat(r)
|
|
|
+ : window.decodeURIComponent(r)
|
|
|
},
|
|
|
urlHasValue: function (key, isGetValue) {
|
|
|
let querys = window.location.search.substr(1).split('&')
|
|
@@ -145,6 +148,7 @@ var settings = {
|
|
|
hotFastTran: false,
|
|
|
transparentBg: false,
|
|
|
bgImg: null,
|
|
|
+ localPrefix: '',
|
|
|
|
|
|
tileClass: {
|
|
|
//默认全景贴图加载的清晰度
|
|
@@ -283,7 +287,7 @@ var LineDraw = {
|
|
|
opacity: o.opacity != void 0 ? o.opacity : 1
|
|
|
}
|
|
|
if (o.deshed) {
|
|
|
- ;(prop.dashSize = o.dashSize || 0.1), (prop.gapSize = o.gapSize || 0.1)
|
|
|
+ ; (prop.dashSize = o.dashSize || 0.1), (prop.gapSize = o.gapSize || 0.1)
|
|
|
}
|
|
|
mat = new THREE[o.deshed ? 'LineDashedMaterial' : 'LineBasicMaterial'](prop)
|
|
|
}
|
|
@@ -352,12 +356,12 @@ var convertTool = {
|
|
|
var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
|
|
|
|
|
|
/* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
|
|
|
- var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
|
|
|
- }else{ */
|
|
|
+ var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
|
|
|
+ }else{ */
|
|
|
let colliders = player.model.allFloorsVisible
|
|
|
? player.model.colliders
|
|
|
: (floorIndex != void 0 ? player.model.floors.index[floorIndex] : player.model.currentFloor)
|
|
|
- .collider.children
|
|
|
+ .collider.children
|
|
|
//let colliders = (floorIndex == void 0 ) ? player.model.colliders : player.model.floors.index[floorIndex].collider.children
|
|
|
var o = ray.intersectObjects(colliders)
|
|
|
//}
|
|
@@ -374,7 +378,7 @@ var convertTool = {
|
|
|
/*
|
|
|
拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
|
|
|
但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
|
|
|
- */
|
|
|
+ */
|
|
|
getPosAtPlane: function (pos, info /* , mouse, camera */) {
|
|
|
//pos:与intersectPlane的交点 见笔记
|
|
|
var A = pos
|
|
@@ -437,12 +441,12 @@ var convertTool = {
|
|
|
var y = t * (A.y - O.y) + O.y
|
|
|
var z = t * (A.z - O.z) + O.z
|
|
|
/*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
|
|
|
- 求直线L与平面π的交点的坐标。
|
|
|
- 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
|
|
|
- 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
|
|
|
- A(mt+a)+B(nt+b)+C(pt+c)+D=0
|
|
|
- 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
|
|
|
- 再代入参数方程即得交点的坐标(x,y,z). */
|
|
|
+ 求直线L与平面π的交点的坐标。
|
|
|
+ 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
|
|
|
+ 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
|
|
|
+ A(mt+a)+B(nt+b)+C(pt+c)+D=0
|
|
|
+ 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
|
|
|
+ 再代入参数方程即得交点的坐标(x,y,z). */
|
|
|
} else if (N.x == 0) {
|
|
|
//z与pullPos相等
|
|
|
var z = P.z
|
|
@@ -679,22 +683,22 @@ window.expandCommon = function (common) {
|
|
|
return 0 === i.length
|
|
|
? null
|
|
|
: (i = i
|
|
|
- .map(function (e) {
|
|
|
- let scores = rank.map(function (f) {
|
|
|
- return f(e)
|
|
|
- }) //add
|
|
|
-
|
|
|
- return {
|
|
|
- item: e,
|
|
|
- scores,
|
|
|
- score: scores.reduce(function (t, i) {
|
|
|
- return t + i
|
|
|
- }, 0)
|
|
|
- }
|
|
|
- })
|
|
|
- .sort(function (e, t) {
|
|
|
- return t.score - e.score
|
|
|
- }))
|
|
|
+ .map(function (e) {
|
|
|
+ let scores = rank.map(function (f) {
|
|
|
+ return f(e)
|
|
|
+ }) //add
|
|
|
+
|
|
|
+ return {
|
|
|
+ item: e,
|
|
|
+ scores,
|
|
|
+ score: scores.reduce(function (t, i) {
|
|
|
+ return t + i
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .sort(function (e, t) {
|
|
|
+ return t.score - e.score
|
|
|
+ }))
|
|
|
},
|
|
|
|
|
|
getVisiblePano: function (positions = [], panos, options = {}) {
|
|
@@ -783,10 +787,10 @@ window.expandMath = function (math) {
|
|
|
//管理js文件 获取modeldata.js 判断是否有特殊的字段,如果有就先加载SpecialScene.js 里面有对特殊场景处理的代码 否则就直接加载main
|
|
|
|
|
|
var Manage = function () {
|
|
|
- ;(this.weixinURL = 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js'),
|
|
|
+ ; (this.weixinURL = 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js'),
|
|
|
(this.time = '?' + new Date().getTime())
|
|
|
this.loadAudio()
|
|
|
- this.loadWeixin()
|
|
|
+ // this.loadWeixin()
|
|
|
}
|
|
|
//动态加载js文件
|
|
|
Manage.prototype.LoadJs = function (_files, succes) {
|
|
@@ -837,7 +841,7 @@ Manage.prototype.LoadJs = function (_files, succes) {
|
|
|
fileObj.type = 'text/css'
|
|
|
fileObj.rel = 'stylesheet/less'
|
|
|
}
|
|
|
- success = success || function () {}
|
|
|
+ success = success || function () { }
|
|
|
fileObj.onload = fileObj.onreadystatechange = function () {
|
|
|
if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {
|
|
|
success()
|
|
@@ -885,7 +889,7 @@ Manage.prototype.number = function (variable) {
|
|
|
|
|
|
Manage.prototype.loadWeixin = function () {
|
|
|
var that = this
|
|
|
- this.LoadJs(that.weixinURL + that.time, function () {})
|
|
|
+ this.LoadJs(that.weixinURL + that.time, function () { })
|
|
|
}
|
|
|
|
|
|
Manage.prototype.weixinShare = function () {
|
|
@@ -1139,18 +1143,18 @@ function matcher(data) {
|
|
|
camera_start:
|
|
|
data.model.images && data.model.images.length != 0
|
|
|
? {
|
|
|
- camera: {
|
|
|
- zoom: '-1',
|
|
|
- quaternion: [
|
|
|
- JSON.parse(data.model.images[0].metadata).camera_quaternion.z,
|
|
|
- JSON.parse(data.model.images[0].metadata).camera_quaternion.w,
|
|
|
- JSON.parse(data.model.images[0].metadata).camera_quaternion.x,
|
|
|
- JSON.parse(data.model.images[0].metadata).camera_quaternion.y
|
|
|
- ]
|
|
|
- },
|
|
|
- pano: { uuid: JSON.parse(data.model.images[0].metadata).scan_id },
|
|
|
- mode: '0'
|
|
|
- }
|
|
|
+ camera: {
|
|
|
+ zoom: '-1',
|
|
|
+ quaternion: [
|
|
|
+ JSON.parse(data.model.images[0].metadata).camera_quaternion.z,
|
|
|
+ JSON.parse(data.model.images[0].metadata).camera_quaternion.w,
|
|
|
+ JSON.parse(data.model.images[0].metadata).camera_quaternion.x,
|
|
|
+ JSON.parse(data.model.images[0].metadata).camera_quaternion.y
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ pano: { uuid: JSON.parse(data.model.images[0].metadata).scan_id },
|
|
|
+ mode: '0'
|
|
|
+ }
|
|
|
: ''
|
|
|
},
|
|
|
sid: window.number,
|
|
@@ -1642,7 +1646,7 @@ function initByTHREE(THREE) {
|
|
|
if (o.position instanceof Array) o.position = new THREE.Vector3().fromArray(o.position)
|
|
|
o.innerHTML = `<div class="room-label" ><a><p><span>${o.title}</span></p></a></div>`
|
|
|
o.domElement = $('.widgets-doll-labels')[0]
|
|
|
- ;(o.shelterByModel = true), (o.autoUpdate = true)
|
|
|
+ ; (o.shelterByModel = true), (o.autoUpdate = true)
|
|
|
|
|
|
o.clickFun = () => {
|
|
|
if (player.roomLebelClickUnabled) return
|
|
@@ -2686,7 +2690,7 @@ Manage.prototype.loadAudio = function () {
|
|
|
level: 1,
|
|
|
src: '',
|
|
|
loop: false,
|
|
|
- canplay: audio => {}
|
|
|
+ canplay: audio => { }
|
|
|
})
|
|
|
|
|
|
$('#volume')
|