|
@@ -3404,14 +3404,20 @@ window.Modernizr = function(n, e, t) {
|
|
|
, h = e("../util/browser");
|
|
|
n.prototype = Object.create(a.prototype),
|
|
|
n.prototype.zoomToContain = function(e) {
|
|
|
- var t = Math.max(e.x, e.z)
|
|
|
- , i = Math.min(e.x, e.z)
|
|
|
- , n = Math.max(t, i * this.camera.aspect)
|
|
|
- , r = Math.max(i, t * this.camera.aspect);
|
|
|
- this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
|
|
|
+ this.absoluteScale = this.getDefaultAbsoluteScale(e);
|
|
|
this.currentScale = this.absoluteScale
|
|
|
}
|
|
|
,
|
|
|
+ n.prototype.getDefaultAbsoluteScale = function(modelSize) {
|
|
|
+ var t = Math.max(modelSize.x, modelSize.z)
|
|
|
+ , i = Math.min(modelSize.x, modelSize.z)
|
|
|
+ , n = Math.max(t, i * this.camera.aspect)
|
|
|
+ , r = Math.max(i, t * this.camera.aspect);
|
|
|
+ var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
|
|
|
+ return absoluteScale
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
n.prototype.rotateToView = function(e, t) {
|
|
|
var i = 0
|
|
|
, n = h.aspectRatio() < 1
|
|
@@ -15428,7 +15434,13 @@ window.Modernizr = function(n, e, t) {
|
|
|
}else{
|
|
|
this.createTitleElem(d.infoAttribute.title)
|
|
|
}
|
|
|
-
|
|
|
+ if(d.infoAttribute.hardware){
|
|
|
+ var Code = d.infoAttribute.deviceCode;
|
|
|
+ if(Code!= void 0){
|
|
|
+ window.hardwareHotList[Code] = this
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
this.changeTex()
|
|
@@ -15519,14 +15531,24 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
|
|
|
|
|
|
- hot.prototype.showPannel = function(){
|
|
|
+ hot.prototype.showPannel = function(o={}){
|
|
|
var hardware = this.infoAttribute.hardware
|
|
|
if(hardware && hardware.id!=void 0){
|
|
|
$("#hotPannel>div").css("display","block");
|
|
|
- $("#hotPannel .title").text(hardware.name);
|
|
|
-
|
|
|
+ $("#hotPannel .title").text(hardware.name);
|
|
|
this.updatePannel()
|
|
|
window.hotNeedUpdatePannel = this
|
|
|
+
|
|
|
+ if(o.focus){
|
|
|
+ if(player.mode == 'panorama'){
|
|
|
+ this.examine(player)
|
|
|
+ }else if(player.mode != 'transitioning'){
|
|
|
+ player.focusPoint({/* modelSize: size, */aim: this.mesh.position})
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
$("#hotPannel>div").css("display","");
|
|
|
}
|
|
@@ -22870,6 +22892,46 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
|
|
|
+ window._tranOutsideFocus = 4399
|
|
|
+ n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
|
|
|
+ console.log("focusPoint")
|
|
|
+ if(this.mode == "floorplan"){
|
|
|
+ var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
|
|
|
+ var control = player.cameraControls.controls.floorplan;
|
|
|
+ var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
|
|
|
+ var currentScale = control.absoluteScale;
|
|
|
+ var currentTarget = control.target.clone()
|
|
|
+
|
|
|
+ y.cancelById(window._tranOutsideFocus, true);
|
|
|
+ y.start(function(progress){
|
|
|
+ control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
|
|
|
+ control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
|
|
|
+ control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
|
|
|
+ }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
|
|
|
+
|
|
|
+ }else if(player.mode == "dollhouse"){
|
|
|
+ var control = player.cameraControls.controls.dollhouse;
|
|
|
+ var radius = o.radius || 8;
|
|
|
+ var currentTarget = control.target.clone()
|
|
|
+ var dir = control.offset.clone().normalize()
|
|
|
+ var currentRadius = control.offset.length();
|
|
|
+
|
|
|
+
|
|
|
+ y.cancelById(window._tranOutsideFocus, true);
|
|
|
+ y.start(function(progress){
|
|
|
+ control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
|
|
|
+ let radius_ = radius*progress+currentRadius*(1-progress)
|
|
|
+ control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
|
|
|
+ }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
window._transitionPosId = 9999
|