|
@@ -63841,7 +63841,7 @@ void main() {
|
|
|
viewer.updateModelBound();
|
|
|
|
|
|
MergeEditor.getBoundCenter(model); //初始化
|
|
|
-
|
|
|
+
|
|
|
done(model);
|
|
|
};
|
|
|
|
|
@@ -86067,7 +86067,7 @@ void main() {
|
|
|
|
|
|
return mouseDelta;
|
|
|
} */
|
|
|
-
|
|
|
+
|
|
|
getMouseDirection(pointer) {//add
|
|
|
pointer = pointer || this.pointer;
|
|
|
let camera = this.hoverViewport.camera;
|
|
@@ -105957,7 +105957,7 @@ ENDSEC
|
|
|
loader.setWithCredentials( this.withCredentials );
|
|
|
|
|
|
loader.load( url, function ( data, total ) {// xzw add total
|
|
|
- console.log('gltf数据加载成功',url);
|
|
|
+ console.log('数据加载成功', url.split('/').pop(), ' ,total: '+total);
|
|
|
try {
|
|
|
|
|
|
scope.parse( data, resourcePath, function ( gltf ) {
|
|
@@ -108254,7 +108254,7 @@ ENDSEC
|
|
|
};
|
|
|
|
|
|
GLTFParser.prototype.loadTextureImage = function ( textureIndex, source, loader ) {
|
|
|
-
|
|
|
+ console.log('loadTextureImage', textureIndex, source);
|
|
|
var parser = this;
|
|
|
var json = this.json;
|
|
|
var options = this.options;
|
|
@@ -108320,7 +108320,7 @@ ENDSEC
|
|
|
} ).then( function ( texture ) {
|
|
|
|
|
|
// Clean up resources and configure Texture.
|
|
|
-
|
|
|
+ console.log('texture',texture.image);
|
|
|
if ( isObjectURL === true ) {
|
|
|
|
|
|
URL.revokeObjectURL( sourceURI );
|
|
@@ -115339,7 +115339,7 @@ ENDSEC
|
|
|
this.object.parent.matrixWorld.decompose( parentPosition, parentQuaternion, parentScale );
|
|
|
this.object.matrixWorld.decompose( worldPosition, worldQuaternion, worldScale );
|
|
|
//add 使坐标轴在boundingBox中心
|
|
|
- boundingBox && this.object.boundingBox.getCenter(worldPosition).applyMatrix4(this.object.matrixWorld);
|
|
|
+ this.object.boundingBox && this.object.boundingBox.getCenter(worldPosition).applyMatrix4(this.object.matrixWorld);
|
|
|
|
|
|
|
|
|
parentQuaternionInv.copy( parentQuaternion ).invert();
|
|
@@ -115433,7 +115433,7 @@ ENDSEC
|
|
|
|
|
|
this.object.matrixWorld.decompose( worldPositionStart, worldQuaternionStart, worldScaleStart );
|
|
|
//add: 使坐标轴在boundingBox中心
|
|
|
- boundingBox && this.object.boundingBox.getCenter(worldPositionStart).applyMatrix4(this.object.matrixWorld);
|
|
|
+ this.object.boundingBox && this.object.boundingBox.getCenter(worldPositionStart).applyMatrix4(this.object.matrixWorld);
|
|
|
|
|
|
pointStart.copy( planeIntersect.point ).sub( worldPositionStart );
|
|
|
|
|
@@ -129387,13 +129387,13 @@ ENDSEC
|
|
|
boundingBox.min.set(-0.5,-0.5,-0.5); boundingBox.max.set(0.5,0.5,0.5);
|
|
|
}
|
|
|
let fileType = fileInfo.objurl ? 'obj' : 'glb';
|
|
|
- let loadDone = (object, total)=>{
|
|
|
+ let loadDone = (object, total, url)=>{
|
|
|
//object.scale.set(1,1,1);//先获取原始的大小时的boundingBox
|
|
|
object.updateMatrixWorld();
|
|
|
let weight = Math.round((total / 1024 / 1024) * 100) / 100;
|
|
|
if(fileInfo.id != void 0)object.dataset_id = fileInfo.id;
|
|
|
|
|
|
- console.log( fileInfo.name , fileInfo.id + '加载完毕, 模型数据量:' + weight + 'M');
|
|
|
+ console.log(url.split('/').pop() ,/* fileInfo.id, */ '加载完毕, 模型数据量:' + weight + 'M');
|
|
|
|
|
|
this.setObjectLayers(object,'model');
|
|
|
|
|
@@ -129487,14 +129487,14 @@ ENDSEC
|
|
|
materials.preload();
|
|
|
|
|
|
loaders.objLoader.setMaterials( materials ).load(fileInfo.objurl, (object, total)=>{
|
|
|
- loadDone(object, total);
|
|
|
+ loadDone(object, total, fileInfo.objurl);
|
|
|
});
|
|
|
} , onProgress, onError );
|
|
|
|
|
|
}else if(fileType == 'glb'){
|
|
|
loaders.glbLoader.load(fileInfo.glburl, ( gltf, total )=>{ //.setPath( Potree.resourcePath + '/models/glb/' );
|
|
|
//console.log('loadGLTF', gltf)
|
|
|
- loadDone(gltf.scene, total);
|
|
|
+ loadDone(gltf.scene, total, fileInfo.glburl);
|
|
|
}, onProgress, onError);
|
|
|
|
|
|
}
|