|
@@ -6544,8 +6544,8 @@ window.Modernizr = function(n, e, t) {
|
|
$(".model-title").text(e.name);
|
|
$(".model-title").text(e.name);
|
|
var i = Q.pageTitle;
|
|
var i = Q.pageTitle;
|
|
// 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
|
|
// 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
|
|
- 2 !== K.valueFromHash("mls", 0) && (i = e.name),
|
|
|
|
- document.title = i,
|
|
|
|
|
|
+ 2 !== K.valueFromHash("mls", 0) && i.name && (i = e.name),
|
|
|
|
+ document.title = i ,
|
|
K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
|
|
K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
|
|
delay: {
|
|
delay: {
|
|
show: 50,
|
|
show: 50,
|
|
@@ -15365,7 +15365,7 @@ window.Modernizr = function(n, e, t) {
|
|
"use strict";
|
|
"use strict";
|
|
function hot(sid,d,model){
|
|
function hot(sid,d,model){
|
|
this.sid = sid;
|
|
this.sid = sid;
|
|
- this.position = this.conversionArray(d.position);
|
|
|
|
|
|
+ this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
|
|
if(d.quaternion){
|
|
if(d.quaternion){
|
|
this.quaternion = d.quaternion;
|
|
this.quaternion = d.quaternion;
|
|
}else{
|
|
}else{
|
|
@@ -15380,6 +15380,7 @@ window.Modernizr = function(n, e, t) {
|
|
this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
|
|
this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
|
|
|
|
|
|
this.build();
|
|
this.build();
|
|
|
|
+ d.infoAttribute && d.infoAttribute.title && this.createTitleElem(d.infoAttribute.title)
|
|
this.changeTex()
|
|
this.changeTex()
|
|
}
|
|
}
|
|
var r = e("three")
|
|
var r = e("three")
|
|
@@ -15387,6 +15388,7 @@ window.Modernizr = function(n, e, t) {
|
|
, a = e("../settings")
|
|
, a = e("../settings")
|
|
, s = e("../enum/Viewmode")
|
|
, s = e("../enum/Viewmode")
|
|
, p = e("../objects/Panorama")
|
|
, p = e("../objects/Panorama")
|
|
|
|
+ , math = e("../util/math")
|
|
, te = e("../util/texture");
|
|
, te = e("../util/texture");
|
|
var raycaster = new r.Raycaster;
|
|
var raycaster = new r.Raycaster;
|
|
//热点大小
|
|
//热点大小
|
|
@@ -15431,7 +15433,7 @@ window.Modernizr = function(n, e, t) {
|
|
var sprite = new r.Mesh( geometry, shaderMaterial );
|
|
var sprite = new r.Mesh( geometry, shaderMaterial );
|
|
var hotIconScale = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
|
|
var hotIconScale = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
|
|
sprite.dynamic = true;
|
|
sprite.dynamic = true;
|
|
- sprite.position.copy(new r.Vector3().fromArray(this.position));
|
|
|
|
|
|
+ sprite.position.copy(this.position);
|
|
if(this.quaternion){
|
|
if(this.quaternion){
|
|
sprite.quaternion.copy(this.quaternion)
|
|
sprite.quaternion.copy(this.quaternion)
|
|
}else{
|
|
}else{
|
|
@@ -15447,7 +15449,24 @@ window.Modernizr = function(n, e, t) {
|
|
this.model.add(sprite);
|
|
this.model.add(sprite);
|
|
g_HotMeshes.push(sprite);
|
|
g_HotMeshes.push(sprite);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ hot.prototype.createTitleElem = function(title){
|
|
|
|
+ var root = $("#hot");
|
|
|
|
+ var elem = $(`<div> ${title}</div>`)
|
|
|
|
+ root.append(elem);
|
|
|
|
+ this.titleElem = elem;
|
|
|
|
+ }
|
|
|
|
+ hot.prototype.showTitle = function(){
|
|
|
|
+ if(!this.titleElem)return;
|
|
|
|
+ var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
|
|
|
|
+ this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
|
|
|
|
+ this.titleElem.css("display","block");
|
|
|
|
+ }
|
|
|
|
+ hot.prototype.hideTitle = function(){
|
|
|
|
+ if(!this.titleElem)return;
|
|
|
|
+ this.titleElem.css("display","none");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
hot.prototype.closestPanoTowardTag = function(e, t) {
|
|
hot.prototype.closestPanoTowardTag = function(e, t) {
|
|
var i = []
|
|
var i = []
|
|
, o = []
|
|
, o = []
|
|
@@ -15614,7 +15633,8 @@ window.Modernizr = function(n, e, t) {
|
|
"../enum/Viewmode":51,
|
|
"../enum/Viewmode":51,
|
|
"../objects/Panorama":148,
|
|
"../objects/Panorama":148,
|
|
"../util/texture":194,
|
|
"../util/texture":194,
|
|
- "../settings":166
|
|
|
|
|
|
+ "../settings":166,
|
|
|
|
+ "../util/math": 190,
|
|
}],
|
|
}],
|
|
/************************************创建热点模型************************************ */
|
|
/************************************创建热点模型************************************ */
|
|
123: [function(e, t, i) {//tag
|
|
123: [function(e, t, i) {//tag
|
|
@@ -21745,8 +21765,11 @@ window.Modernizr = function(n, e, t) {
|
|
this.updateFromControls(i),
|
|
this.updateFromControls(i),
|
|
this.getCurrentNodePanos(t),
|
|
this.getCurrentNodePanos(t),
|
|
this.hasChanged(e) && (this.lastChangeTime = Date.now(),
|
|
this.hasChanged(e) && (this.lastChangeTime = Date.now(),
|
|
- !this.mouseDown && this.containsMouse && this.updateIntersect(),
|
|
|
|
- this.emit(w.ViewChanged)),
|
|
|
|
|
|
+ !this.mouseDown && this.containsMouse && this.updateIntersect(),
|
|
|
|
+ this.emit(w.ViewChanged),
|
|
|
|
+ this.intersectHot && this.intersectHot.showTitle()
|
|
|
|
+
|
|
|
|
+ ),
|
|
this.model.supportsTiles && (this.updateTileDownloader(t),
|
|
this.model.supportsTiles && (this.updateTileDownloader(t),
|
|
this.updatePanoRenderer(t)),
|
|
this.updatePanoRenderer(t)),
|
|
this.updatePreRendering(t),
|
|
this.updatePreRendering(t),
|
|
@@ -22007,7 +22030,7 @@ window.Modernizr = function(n, e, t) {
|
|
console.log(points[0]);
|
|
console.log(points[0]);
|
|
points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
|
|
points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ this.intersectHot && this.intersectHot.hideTitle()
|
|
if (0 === n.length){
|
|
if (0 === n.length){
|
|
this.intersectHot = null; //add
|
|
this.intersectHot = null; //add
|
|
if(g_HotStatus!="add") $("#player").css("cursor","");
|
|
if(g_HotStatus!="add") $("#player").css("cursor","");
|
|
@@ -22017,9 +22040,11 @@ window.Modernizr = function(n, e, t) {
|
|
var o = n[0];
|
|
var o = n[0];
|
|
if(o.object.type == "hotSprite"){ //add
|
|
if(o.object.type == "hotSprite"){ //add
|
|
this.intersectHot = o.object.belongHot;
|
|
this.intersectHot = o.object.belongHot;
|
|
|
|
+ this.intersectHot.showTitle()
|
|
$("#player").css("cursor","pointer");
|
|
$("#player").css("cursor","pointer");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
this.intersectHot = null;
|
|
this.intersectHot = null;
|
|
|
|
|
|
var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
|
|
var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
|
|
@@ -30089,7 +30114,30 @@ window.Modernizr = function(n, e, t) {
|
|
i.set(t.x, t.y, -1)
|
|
i.set(t.x, t.y, -1)
|
|
}
|
|
}
|
|
n && i.normalize()
|
|
n && i.normalize()
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //add:
|
|
|
|
+ getPos2d : function(point, camera, dom){
|
|
|
|
+ var camera = camera ;
|
|
|
|
+ var dom = dom;
|
|
|
|
+ var pos = point.clone().project(camera) //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
|
|
|
|
+
|
|
|
|
+ var x,y;
|
|
|
|
+ x = (pos.x + 1) / 2 * dom.clientWidth;
|
|
|
|
+ y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
|
|
|
|
+
|
|
|
|
+ var inSight = x <= dom.clientWidth && x >= 0
|
|
|
|
+ && y <= dom.clientHeight && y >= 0
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ pos: new THREE.Vector2(x,y),
|
|
|
|
+ vector: pos,
|
|
|
|
+ trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
|
|
|
|
+ inSight : inSight //在屏幕范围内可见
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
, {
|
|
, {
|