Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
bd7bffa9
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd7bffa9
编写于
5月 27, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
bb5278e9
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
211 addition
and
164 deletion
+211
-164
build/three.js
build/three.js
+191
-141
build/three.min.js
build/three.min.js
+20
-23
未找到文件。
build/three.js
浏览文件 @
bd7bffa9
...
...
@@ -3133,6 +3133,7 @@ THREE.Box2.prototype = {
/**
* @author bhouston / http://exocortex.com
* @author WestLangley / http://github.com/WestLangley
*/
THREE.Box3 = function ( min, max ) {
...
...
@@ -3227,6 +3228,47 @@ THREE.Box3.prototype = {
}(),
setFromObject: function() {
// Computes the world-axis-aligned bounding box of an object (including its children),
// accounting for both the object's, and childrens', world transforms
var v1 = new THREE.Vector3();
return function( object ) {
var scope = this;
object.updateMatrixWorld( true );
this.makeEmpty();
object.traverse( function ( node ) {
if ( node.geometry !== undefined && node.geometry.vertices !== undefined ) {
var vertices = node.geometry.vertices;
for ( var i = 0, il = vertices.length; i < il; i++ ) {
v1.copy( vertices[ i ] );
v1.applyMatrix4( node.matrixWorld );
scope.expandByPoint( v1 );
}
}
} );
return this;
};
}(),
copy: function ( box ) {
this.min.copy( box.min );
...
...
@@ -6441,8 +6483,6 @@ THREE.Object3D = function () {
this.frustumCulled = true;
this.boundingBox = null;
this.userData = {};
};
...
...
@@ -6844,53 +6884,6 @@ THREE.Object3D.prototype = {
},
computeBoundingBox: function() {
// computes the world-axis-aligned bounding box of object (including its children),
// accounting for both the object's and childrens' world transforms
var v1 = new THREE.Vector3();
return function() {
if ( this.boundingBox === null ) {
this.boundingBox = new THREE.Box3();
}
this.boundingBox.makeEmpty();
var scope = this.boundingBox;
this.updateMatrixWorld( true );
this.traverse( function ( node ) {
if ( node.geometry !== undefined && node.geometry.vertices !== undefined ) {
var vertices = node.geometry.vertices;
for ( var i = 0, il = vertices.length; i < il; i++ ) {
v1.copy( vertices[ i ] );
v1.applyMatrix4( node.matrixWorld );
scope.expandByPoint( v1 );
}
}
} );
return this.boundingBox;
};
}(),
clone: function ( object, recursive ) {
if ( object === undefined ) object = new THREE.Object3D();
...
...
@@ -6925,12 +6918,6 @@ THREE.Object3D.prototype = {
object.frustumCulled = this.frustumCulled;
if ( this.boundingBox instanceof THREE.Box3 ) {
object.boundingBox = this.boundingBox.clone();
}
object.userData = JSON.parse( JSON.stringify( this.userData ) );
if ( recursive === true ) {
...
...
@@ -9972,9 +9959,9 @@ THREE.Loader.prototype = {
* @author mrdoob / http://mrdoob.com/
*/
THREE.ImageLoader = function () {
THREE.ImageLoader = function (
manager
) {
this.
crossOrigin = null
;
this.
manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager
;
};
...
...
@@ -9982,32 +9969,19 @@ THREE.ImageLoader.prototype = {
constructor: THREE.ImageLoader,
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
removeEventListener: THREE.EventDispatcher.prototype.removeEventListener,
dispatchEvent: THREE.EventDispatcher.prototype.dispatchEvent,
load: function ( url, image ) {
load: function ( url, callback ) {
var scope = this;
if ( image === undefined ) image = new Image();
image.addEventListener( 'load', function () {
scope.dispatchEvent( { type: 'load', content: image } );
}, false );
image.addEventListener( 'error', function () {
this.manager.add( url, 'image', function ( image ) {
scope.dispatchEvent( { type: 'error', message: 'Couldn\'t load URL [' + url + ']' } );
if ( callback !== undefined ) {
}, fals
e );
callback( imag
e );
if ( scope.crossOrigin ) image.crossOrigin = scope.crossOrigin;
}
image.src = url
;
} )
;
}
...
...
@@ -10462,40 +10436,141 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
* @author mrdoob / http://mrdoob.com/
*/
THREE.LoadingM
onito
r = function () {
THREE.LoadingM
anage
r = function () {
var scope = this;
var loaded = 0;
var total = 0;
var list = [], cache = {};
var isLoading = false;
var loaded = 0, total = 0;
var crossOrigin = null;
var load = function () {
var item = list[ 0 ];
if ( cache[ item.url ] === undefined ) {
switch ( item.type ) {
case 'image':
var image = document.createElement( 'img' );
image.addEventListener( 'load', function ( event ) {
if ( item.onLoad !== undefined ) {
item.onLoad( this );
}
cache[ item.url ] = this;
onLoad( item );
}, false );
if ( crossOrigin !== null ) image.crossOrigin = crossOrigin;
image.src = item.url;
break;
default:
var request = new XMLHttpRequest();
request.addEventListener( 'load', function ( event ) {
if ( item.onLoad !== undefined ) {
item.onLoad( event );
}
cache[ item.url ] = event;
onLoad( item );
}, false );
request.open( 'GET', item.url, true );
request.send( null );
break;
}
} else {
if ( item.onLoad !== undefined ) {
var onLoad = function ( event ) {
item.onLoad( cache[ item.url ] );
}
onLoad( item );
}
list.shift();
};
var onLoad = function ( item ) {
loaded ++;
scope.dispatchEvent( { type: '
progress'
, loaded: loaded, total: total } );
scope.dispatchEvent( { type: '
load', item: item
, loaded: loaded, total: total } );
if ( loaded === total ) {
scope.dispatchEvent( { type: 'load' } );
isLoading = false;
scope.dispatchEvent( { type: 'complete' } );
} else {
load();
}
};
this.add = function (
loade
r ) {
this.add = function (
url, type, onLoad, onProgress, onErro
r ) {
total ++;
loader.addEventListener( 'load', onLoad, false );
list.push( {
url: url,
type: type,
onLoad: onLoad,
onProgress: onProgress,
onError: onError
} );
if ( isLoading === false ) {
isLoading = true;
load();
}
};
this.setCrossOrigin = function ( value ) {
crossOrigin = value;
};
};
THREE.LoadingM
onito
r.prototype = {
THREE.LoadingM
anage
r.prototype = {
constructor: THREE.LoadingM
onito
r,
constructor: THREE.LoadingM
anage
r,
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
...
...
@@ -10504,47 +10579,36 @@ THREE.LoadingMonitor.prototype = {
};
THREE.DefaultLoadingManager = new THREE.LoadingManager();
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.GeometryLoader = function () {};
THREE.GeometryLoader.prototype = {
THREE.GeometryLoader = function ( manager ) {
constructor: THREE.GeometryLoader,
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
removeEventListener: THREE.EventDispatcher.prototype.removeEventListener,
dispatchEvent: THREE.EventDispatcher.prototype.dispatchEvent,
load: function ( url ) {
var scope = this;
var request = new XMLHttpRequest();
request.addEventListener( 'load', function ( event ) {
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
var response = scope.parse( JSON.parse( event.target.responseText ) )
;
}
;
scope.dispatchEvent( { type: 'load', content: response } );
THREE.GeometryLoader.prototype = {
}, false );
constructor: THREE.GeometryLoader,
request.addEventListener( 'progress', function ( event
) {
load: function ( url, callback
) {
scope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } )
;
var scope = this
;
}, false );
this.manager.add( url, 'text', function ( event ) {
request.addEventListener( 'error', function (
) {
if ( callback !== undefined
) {
scope.dispatchEvent( { type: 'error', message: 'Couldn\'t load URL [' + url + ']' } );
var geometry = scope.parse( JSON.parse( event.target.responseText ) );
callback( geometry );
}, false );
}
request.open( 'GET', url, true );
request.send( null );
} );
},
...
...
@@ -10560,44 +10624,30 @@ THREE.GeometryLoader.prototype = {
* @author mrdoob / http://mrdoob.com/
*/
THREE.MaterialLoader = function () {};
THREE.MaterialLoader = function ( manager ) {
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
};
THREE.MaterialLoader.prototype = {
constructor: THREE.MaterialLoader,
addEventListener: THREE.EventDispatcher.prototype.addEventListener,
hasEventListener: THREE.EventDispatcher.prototype.hasEventListener,
removeEventListener: THREE.EventDispatcher.prototype.removeEventListener,
dispatchEvent: THREE.EventDispatcher.prototype.dispatchEvent,
load: function ( url ) {
load: function ( url, callback ) {
var scope = this;
var request = new XMLHttpRequest();
request.addEventListener( 'load', function ( event ) {
var response = scope.parse( JSON.parse( event.target.responseText ) );
scope.dispatchEvent( { type: 'load', content: response } );
this.manager.add( url, 'text', function ( event ) {
}, false );
if ( callback !== undefined ) {
request.addEventListener( 'progress', function ( event ) {
var material = scope.parse( JSON.parse( event.target.responseText ) );
callback( material );
scope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );
}, false );
request.addEventListener( 'error', function () {
scope.dispatchEvent( { type: 'error', message: 'Couldn\'t load URL [' + url + ']' } );
}, false );
}
request.open( 'GET', url, true );
request.send( null );
} );
},
...
...
@@ -34358,11 +34408,11 @@ THREE.BoundingBoxHelper.prototype = Object.create( THREE.Mesh.prototype );
THREE.BoundingBoxHelper.prototype.update = function () {
this.
object.computeBoundingBox(
);
this.
box.setFromObject( this.object
);
this.
object.boundingB
ox.size( this.scale );
this.
b
ox.size( this.scale );
this.
object.boundingB
ox.center( this.position );
this.
b
ox.center( this.position );
};
...
...
build/three.min.js
浏览文件 @
bd7bffa9
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录