|
@@ -85446,7 +85446,7 @@ void main()
|
|
|
},
|
|
|
update: function(e) {
|
|
|
this.funcs.forEach(function(t) {
|
|
|
- if(t.updateCount++ == 0 && t.ignoreFirstFrame) return //add start可能发生在一帧中任意时刻,而每次update的是在一帧中的固定时刻,所以从start到第一次update的时间并不是所传入的delta,该delta 是上一帧的update到这一帧的update的耗时。 故去掉了第一次的update,相当于延迟一帧再update. 其实可以直接setTimeout 1 ……
|
|
|
+ if(t.updateCount++ == 0 && t.ignoreFirstFrame) return //add start可能发生在一帧中任意时刻,而每次update的是在一帧中的固定时刻,所以从start到第一次update的时间并不是所传入的delta,该delta 是上一帧的update到这一帧的update的耗时。 故去掉了第一次的update,相当于延迟一帧再update.
|
|
|
if (!(t.paused || (t.current += 1e3 * e, t.current < 0))){
|
|
|
if (t.current >= t.duration && !t.cycling) {
|
|
|
var u = t.easing(1, 0, 1, 1);
|
|
@@ -92812,7 +92812,8 @@ void main()
|
|
|
|
|
|
|
|
|
vec4 colorFromPano0 = vec4(0.0,0.0,0.0,0.0);
|
|
|
- #if defined(usePanoMap0)//即progress < 1.0 通常是1
|
|
|
+ #if defined(usePanoMap0)
|
|
|
+ //即progress < 1.0 通常是1
|
|
|
colorFromPano0=textureCube(pano0Map,vWorldPosition0N.xyz);
|
|
|
#endif
|
|
|
vec4 colorFromPano1=textureCube(pano1Map,vWorldPosition1N.xyz);
|
|
@@ -154893,29 +154894,46 @@ ENDSEC
|
|
|
let tileset = object.runtime.getTileset();
|
|
|
|
|
|
//TileHeader: tileset.root
|
|
|
- //参见另一个工程 TileRenderer.js preprocessNode
|
|
|
- //let boundingVolume = tileset.root.boundingVolume //这个坐标位置几万…… let data = boundingVolume.halfAxes //但这个似乎是premultiply( transform );过后的,可能需还原下
|
|
|
+ //参见另一个工程 TileRenderer.js preprocessNode //这个坐标位置几万…… let data = boundingVolume.halfAxes //但这个似乎是premultiply( transform );过后的,可能需还原下
|
|
|
|
|
|
- let json = tileset.tileset;
|
|
|
+ let json = tileset.tileset;
|
|
|
let box = json.root.boundingVolume.box;
|
|
|
|
|
|
- let center = new Vector3(box[0],box[1],box[2]);
|
|
|
- let boundSize = new Vector3( );
|
|
|
-
|
|
|
- // get the extents of the bounds in each axis
|
|
|
- let vecX = new Vector3( box[ 3 ], box[ 4 ], box[ 5 ] );
|
|
|
- let vecY = new Vector3( box[ 6 ], box[ 7 ], box[ 8 ] );
|
|
|
- let vecZ = new Vector3( box[ 9 ], box[ 10 ], box[ 11 ] );
|
|
|
-
|
|
|
- const scaleX = vecX.length();
|
|
|
- const scaleY = vecY.length();
|
|
|
- const scaleZ = vecZ.length();
|
|
|
- /* boundingBox.expandByPoint(center);
|
|
|
- boundingBox.expandByVector(new THREE.Vector3(scaleX,scaleY,scaleZ)) */
|
|
|
-
|
|
|
-
|
|
|
- boundingBox.min.set( - scaleX, - scaleY, - scaleZ );
|
|
|
- boundingBox.max.set( scaleX, scaleY, scaleZ );
|
|
|
+ if(box){
|
|
|
+ let center = new Vector3(box[0],box[1],box[2]);
|
|
|
+ let boundSize = new Vector3( );
|
|
|
+
|
|
|
+ // get the extents of the bounds in each axis
|
|
|
+ let vecX = new Vector3( box[ 3 ], box[ 4 ], box[ 5 ] );
|
|
|
+ let vecY = new Vector3( box[ 6 ], box[ 7 ], box[ 8 ] );
|
|
|
+ let vecZ = new Vector3( box[ 9 ], box[ 10 ], box[ 11 ] );
|
|
|
+
|
|
|
+ const scaleX = vecX.length();
|
|
|
+ const scaleY = vecY.length();
|
|
|
+ const scaleZ = vecZ.length();
|
|
|
+ /* boundingBox.expandByPoint(center);
|
|
|
+ boundingBox.expandByVector(new THREE.Vector3(scaleX,scaleY,scaleZ)) */
|
|
|
+
|
|
|
+
|
|
|
+ boundingBox.min.set( - scaleX, - scaleY, - scaleZ );
|
|
|
+ boundingBox.max.set( scaleX, scaleY, scaleZ );
|
|
|
+
|
|
|
+ }else if(json.root.boundingVolume.sphere){
|
|
|
+ let sphereData = json.root.boundingVolume.sphere;
|
|
|
+ let center = new Vector3(...sphereData);
|
|
|
+ let radius = sphereData[3];
|
|
|
+ /* let sphere = new THREE.Sphere(center, radius)
|
|
|
+ let box = sphere.getBoundingBox()
|
|
|
+ boundingBox.copy(box) */
|
|
|
+
|
|
|
+ boundingBox.min.set( - radius, - radius, - radius );
|
|
|
+ boundingBox.max.set( radius, radius, radius );
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }else {
|
|
|
+ return console.error('json boundingVolume 缺少信息')
|
|
|
+ }
|
|
|
|
|
|
//中心点居然没用。可能是漏用了什么信息,也许这和LVBADUI_qp是散的有关。
|
|
|
console.log('3d tiles json',json);
|