Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
c2cec2e7
T
three.js
项目概览
Ablesons
/
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,发现更多精彩内容 >>
提交
c2cec2e7
编写于
10月 28, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed XHRLoader to FileLoader.
上级
a6cb0b65
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
33 addition
and
25 deletion
+33
-25
src/Three.Legacy.js
src/Three.Legacy.js
+8
-0
src/Three.js
src/Three.js
+1
-1
src/loaders/AnimationLoader.js
src/loaders/AnimationLoader.js
+2
-2
src/loaders/AudioLoader.js
src/loaders/AudioLoader.js
+2
-2
src/loaders/BinaryTextureLoader.js
src/loaders/BinaryTextureLoader.js
+2
-2
src/loaders/BufferGeometryLoader.js
src/loaders/BufferGeometryLoader.js
+2
-2
src/loaders/CompressedTextureLoader.js
src/loaders/CompressedTextureLoader.js
+2
-2
src/loaders/FileLoader.js
src/loaders/FileLoader.js
+4
-4
src/loaders/FontLoader.js
src/loaders/FontLoader.js
+2
-2
src/loaders/ImageLoader.js
src/loaders/ImageLoader.js
+2
-2
src/loaders/JSONLoader.js
src/loaders/JSONLoader.js
+2
-2
src/loaders/MaterialLoader.js
src/loaders/MaterialLoader.js
+2
-2
src/loaders/ObjectLoader.js
src/loaders/ObjectLoader.js
+2
-2
未找到文件。
src/Three.Legacy.js
浏览文件 @
c2cec2e7
...
@@ -18,6 +18,7 @@ import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
...
@@ -18,6 +18,7 @@ import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
import
{
ShapeGeometry
}
from
'
./geometries/ShapeGeometry.js
'
;
import
{
ShapeGeometry
}
from
'
./geometries/ShapeGeometry.js
'
;
import
{
WireframeGeometry
}
from
'
./geometries/WireframeGeometry.js
'
;
import
{
WireframeGeometry
}
from
'
./geometries/WireframeGeometry.js
'
;
import
{
Light
}
from
'
./lights/Light.js
'
;
import
{
Light
}
from
'
./lights/Light.js
'
;
import
{
FileLoader
}
from
'
./loaders/FileLoader.js
'
;
import
{
AudioLoader
}
from
'
./loaders/AudioLoader.js
'
;
import
{
AudioLoader
}
from
'
./loaders/AudioLoader.js
'
;
import
{
CubeTextureLoader
}
from
'
./loaders/CubeTextureLoader.js
'
;
import
{
CubeTextureLoader
}
from
'
./loaders/CubeTextureLoader.js
'
;
import
{
TextureLoader
}
from
'
./loaders/TextureLoader.js
'
;
import
{
TextureLoader
}
from
'
./loaders/TextureLoader.js
'
;
...
@@ -105,6 +106,13 @@ export function WireframeHelper( object, hex ) {
...
@@ -105,6 +106,13 @@ export function WireframeHelper( object, hex ) {
//
//
export
function
XHRLoader
(
manager
)
{
console
.
warn
(
'
THREE.XHRLoader has been renamed to THREE.FileLoader.
'
);
return
new
FileLoader
(
manager
);
}
//
Object
.
assign
(
Box2
.
prototype
,
{
Object
.
assign
(
Box2
.
prototype
,
{
center
:
function
(
optionalTarget
)
{
center
:
function
(
optionalTarget
)
{
console
.
warn
(
'
THREE.Box2: .center() has been renamed to .getCenter().
'
);
console
.
warn
(
'
THREE.Box2: .center() has been renamed to .getCenter().
'
);
...
...
src/Three.js
浏览文件 @
c2cec2e7
...
@@ -42,7 +42,7 @@ export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.
...
@@ -42,7 +42,7 @@ export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.
export
{
JSONLoader
}
from
'
./loaders/JSONLoader.js
'
;
export
{
JSONLoader
}
from
'
./loaders/JSONLoader.js
'
;
export
{
ImageLoader
}
from
'
./loaders/ImageLoader.js
'
;
export
{
ImageLoader
}
from
'
./loaders/ImageLoader.js
'
;
export
{
FontLoader
}
from
'
./loaders/FontLoader.js
'
;
export
{
FontLoader
}
from
'
./loaders/FontLoader.js
'
;
export
{
XHRLoader
}
from
'
./loaders/XHR
Loader.js
'
;
export
{
FileLoader
}
from
'
./loaders/File
Loader.js
'
;
export
{
Loader
}
from
'
./loaders/Loader.js
'
;
export
{
Loader
}
from
'
./loaders/Loader.js
'
;
export
{
Cache
}
from
'
./loaders/Cache.js
'
;
export
{
Cache
}
from
'
./loaders/Cache.js
'
;
export
{
AudioLoader
}
from
'
./loaders/AudioLoader.js
'
;
export
{
AudioLoader
}
from
'
./loaders/AudioLoader.js
'
;
...
...
src/loaders/AnimationLoader.js
浏览文件 @
c2cec2e7
import
{
AnimationClip
}
from
'
../animation/AnimationClip
'
;
import
{
AnimationClip
}
from
'
../animation/AnimationClip
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
/**
/**
...
@@ -18,7 +18,7 @@ Object.assign( AnimationLoader.prototype, {
...
@@ -18,7 +18,7 @@ Object.assign( AnimationLoader.prototype, {
var
scope
=
this
;
var
scope
=
this
;
var
loader
=
new
XHR
Loader
(
scope
.
manager
);
var
loader
=
new
File
Loader
(
scope
.
manager
);
loader
.
load
(
url
,
function
(
text
)
{
loader
.
load
(
url
,
function
(
text
)
{
onLoad
(
scope
.
parse
(
JSON
.
parse
(
text
)
)
);
onLoad
(
scope
.
parse
(
JSON
.
parse
(
text
)
)
);
...
...
src/loaders/AudioLoader.js
浏览文件 @
c2cec2e7
import
{
getAudioContext
}
from
'
../audio/AudioContext
'
;
import
{
getAudioContext
}
from
'
../audio/AudioContext
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
/**
/**
...
@@ -16,7 +16,7 @@ Object.assign( AudioLoader.prototype, {
...
@@ -16,7 +16,7 @@ Object.assign( AudioLoader.prototype, {
load
:
function
(
url
,
onLoad
,
onProgress
,
onError
)
{
load
:
function
(
url
,
onLoad
,
onProgress
,
onError
)
{
var
loader
=
new
XHR
Loader
(
this
.
manager
);
var
loader
=
new
File
Loader
(
this
.
manager
);
loader
.
setResponseType
(
'
arraybuffer
'
);
loader
.
setResponseType
(
'
arraybuffer
'
);
loader
.
load
(
url
,
function
(
buffer
)
{
loader
.
load
(
url
,
function
(
buffer
)
{
...
...
src/loaders/BinaryTextureLoader.js
浏览文件 @
c2cec2e7
import
{
LinearFilter
,
LinearMipMapLinearFilter
,
ClampToEdgeWrapping
}
from
'
../constants
'
;
import
{
LinearFilter
,
LinearMipMapLinearFilter
,
ClampToEdgeWrapping
}
from
'
../constants
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DataTexture
}
from
'
../textures/DataTexture
'
;
import
{
DataTexture
}
from
'
../textures/DataTexture
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
...
@@ -27,7 +27,7 @@ Object.assign( BinaryTextureLoader.prototype, {
...
@@ -27,7 +27,7 @@ Object.assign( BinaryTextureLoader.prototype, {
var
texture
=
new
DataTexture
();
var
texture
=
new
DataTexture
();
var
loader
=
new
XHR
Loader
(
this
.
manager
);
var
loader
=
new
File
Loader
(
this
.
manager
);
loader
.
setResponseType
(
'
arraybuffer
'
);
loader
.
setResponseType
(
'
arraybuffer
'
);
loader
.
load
(
url
,
function
(
buffer
)
{
loader
.
load
(
url
,
function
(
buffer
)
{
...
...
src/loaders/BufferGeometryLoader.js
浏览文件 @
c2cec2e7
...
@@ -2,7 +2,7 @@ import { Sphere } from '../math/Sphere';
...
@@ -2,7 +2,7 @@ import { Sphere } from '../math/Sphere';
import
{
Vector3
}
from
'
../math/Vector3
'
;
import
{
Vector3
}
from
'
../math/Vector3
'
;
import
{
BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
/**
/**
...
@@ -21,7 +21,7 @@ Object.assign( BufferGeometryLoader.prototype, {
...
@@ -21,7 +21,7 @@ Object.assign( BufferGeometryLoader.prototype, {
var
scope
=
this
;
var
scope
=
this
;
var
loader
=
new
XHR
Loader
(
scope
.
manager
);
var
loader
=
new
File
Loader
(
scope
.
manager
);
loader
.
load
(
url
,
function
(
text
)
{
loader
.
load
(
url
,
function
(
text
)
{
onLoad
(
scope
.
parse
(
JSON
.
parse
(
text
)
)
);
onLoad
(
scope
.
parse
(
JSON
.
parse
(
text
)
)
);
...
...
src/loaders/CompressedTextureLoader.js
浏览文件 @
c2cec2e7
import
{
LinearFilter
}
from
'
../constants
'
;
import
{
LinearFilter
}
from
'
../constants
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
CompressedTexture
}
from
'
../textures/CompressedTexture
'
;
import
{
CompressedTexture
}
from
'
../textures/CompressedTexture
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
...
@@ -29,7 +29,7 @@ Object.assign( CompressedTextureLoader.prototype, {
...
@@ -29,7 +29,7 @@ Object.assign( CompressedTextureLoader.prototype, {
var
texture
=
new
CompressedTexture
();
var
texture
=
new
CompressedTexture
();
texture
.
image
=
images
;
texture
.
image
=
images
;
var
loader
=
new
XHR
Loader
(
this
.
manager
);
var
loader
=
new
File
Loader
(
this
.
manager
);
loader
.
setPath
(
this
.
path
);
loader
.
setPath
(
this
.
path
);
loader
.
setResponseType
(
'
arraybuffer
'
);
loader
.
setResponseType
(
'
arraybuffer
'
);
...
...
src/loaders/
XHR
Loader.js
→
src/loaders/
File
Loader.js
浏览文件 @
c2cec2e7
...
@@ -5,13 +5,13 @@ import { DefaultLoadingManager } from './LoadingManager';
...
@@ -5,13 +5,13 @@ import { DefaultLoadingManager } from './LoadingManager';
* @author mrdoob / http://mrdoob.com/
* @author mrdoob / http://mrdoob.com/
*/
*/
function
XHR
Loader
(
manager
)
{
function
File
Loader
(
manager
)
{
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
DefaultLoadingManager
;
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
DefaultLoadingManager
;
}
}
Object
.
assign
(
XHR
Loader
.
prototype
,
{
Object
.
assign
(
File
Loader
.
prototype
,
{
load
:
function
(
url
,
onLoad
,
onProgress
,
onError
)
{
load
:
function
(
url
,
onLoad
,
onProgress
,
onError
)
{
...
@@ -147,7 +147,7 @@ Object.assign( XHRLoader.prototype, {
...
@@ -147,7 +147,7 @@ Object.assign( XHRLoader.prototype, {
// Some browsers return HTTP Status 0 when using non-http protocol
// Some browsers return HTTP Status 0 when using non-http protocol
// e.g. 'file://' or 'data://'. Handle as success.
// e.g. 'file://' or 'data://'. Handle as success.
console
.
warn
(
'
THREE.
XHR
Loader: HTTP Status 0 received.
'
);
console
.
warn
(
'
THREE.
File
Loader: HTTP Status 0 received.
'
);
if
(
onLoad
)
onLoad
(
response
);
if
(
onLoad
)
onLoad
(
response
);
...
@@ -220,4 +220,4 @@ Object.assign( XHRLoader.prototype, {
...
@@ -220,4 +220,4 @@ Object.assign( XHRLoader.prototype, {
}
);
}
);
export
{
XHR
Loader
};
export
{
File
Loader
};
src/loaders/FontLoader.js
浏览文件 @
c2cec2e7
import
{
Font
}
from
'
../extras/core/Font
'
;
import
{
Font
}
from
'
../extras/core/Font
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
/**
/**
...
@@ -18,7 +18,7 @@ Object.assign( FontLoader.prototype, {
...
@@ -18,7 +18,7 @@ Object.assign( FontLoader.prototype, {
var
scope
=
this
;
var
scope
=
this
;
var
loader
=
new
XHR
Loader
(
this
.
manager
);
var
loader
=
new
File
Loader
(
this
.
manager
);
loader
.
load
(
url
,
function
(
text
)
{
loader
.
load
(
url
,
function
(
text
)
{
var
json
;
var
json
;
...
...
src/loaders/ImageLoader.js
浏览文件 @
c2cec2e7
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
/**
/**
...
@@ -37,7 +37,7 @@ Object.assign( ImageLoader.prototype, {
...
@@ -37,7 +37,7 @@ Object.assign( ImageLoader.prototype, {
}
else
{
}
else
{
var
loader
=
new
XHR
Loader
();
var
loader
=
new
File
Loader
();
loader
.
setPath
(
this
.
path
);
loader
.
setPath
(
this
.
path
);
loader
.
setResponseType
(
'
blob
'
);
loader
.
setResponseType
(
'
blob
'
);
loader
.
setWithCredentials
(
this
.
withCredentials
);
loader
.
setWithCredentials
(
this
.
withCredentials
);
...
...
src/loaders/JSONLoader.js
浏览文件 @
c2cec2e7
...
@@ -6,7 +6,7 @@ import { Color } from '../math/Color';
...
@@ -6,7 +6,7 @@ import { Color } from '../math/Color';
import
{
Vector2
}
from
'
../math/Vector2
'
;
import
{
Vector2
}
from
'
../math/Vector2
'
;
import
{
Face3
}
from
'
../core/Face3
'
;
import
{
Face3
}
from
'
../core/Face3
'
;
import
{
Geometry
}
from
'
../core/Geometry
'
;
import
{
Geometry
}
from
'
../core/Geometry
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
/**
/**
...
@@ -37,7 +37,7 @@ Object.assign( JSONLoader.prototype, {
...
@@ -37,7 +37,7 @@ Object.assign( JSONLoader.prototype, {
var
texturePath
=
this
.
texturePath
&&
(
typeof
this
.
texturePath
===
"
string
"
)
?
this
.
texturePath
:
Loader
.
prototype
.
extractUrlBase
(
url
);
var
texturePath
=
this
.
texturePath
&&
(
typeof
this
.
texturePath
===
"
string
"
)
?
this
.
texturePath
:
Loader
.
prototype
.
extractUrlBase
(
url
);
var
loader
=
new
XHR
Loader
(
this
.
manager
);
var
loader
=
new
File
Loader
(
this
.
manager
);
loader
.
setWithCredentials
(
this
.
withCredentials
);
loader
.
setWithCredentials
(
this
.
withCredentials
);
loader
.
load
(
url
,
function
(
text
)
{
loader
.
load
(
url
,
function
(
text
)
{
...
...
src/loaders/MaterialLoader.js
浏览文件 @
c2cec2e7
import
{
Vector2
}
from
'
../math/Vector2
'
;
import
{
Vector2
}
from
'
../math/Vector2
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
{
DefaultLoadingManager
}
from
'
./LoadingManager
'
;
import
*
as
Materials
from
'
../materials/Materials
'
;
import
*
as
Materials
from
'
../materials/Materials
'
;
...
@@ -20,7 +20,7 @@ Object.assign( MaterialLoader.prototype, {
...
@@ -20,7 +20,7 @@ Object.assign( MaterialLoader.prototype, {
var
scope
=
this
;
var
scope
=
this
;
var
loader
=
new
XHR
Loader
(
scope
.
manager
);
var
loader
=
new
File
Loader
(
scope
.
manager
);
loader
.
load
(
url
,
function
(
text
)
{
loader
.
load
(
url
,
function
(
text
)
{
onLoad
(
scope
.
parse
(
JSON
.
parse
(
text
)
)
);
onLoad
(
scope
.
parse
(
JSON
.
parse
(
text
)
)
);
...
...
src/loaders/ObjectLoader.js
浏览文件 @
c2cec2e7
...
@@ -27,7 +27,7 @@ import { AnimationClip } from '../animation/AnimationClip';
...
@@ -27,7 +27,7 @@ import { AnimationClip } from '../animation/AnimationClip';
import
{
MaterialLoader
}
from
'
./MaterialLoader
'
;
import
{
MaterialLoader
}
from
'
./MaterialLoader
'
;
import
{
BufferGeometryLoader
}
from
'
./BufferGeometryLoader
'
;
import
{
BufferGeometryLoader
}
from
'
./BufferGeometryLoader
'
;
import
{
JSONLoader
}
from
'
./JSONLoader
'
;
import
{
JSONLoader
}
from
'
./JSONLoader
'
;
import
{
XHRLoader
}
from
'
./XHR
Loader
'
;
import
{
FileLoader
}
from
'
./File
Loader
'
;
import
*
as
Geometries
from
'
../geometries/Geometries
'
;
import
*
as
Geometries
from
'
../geometries/Geometries
'
;
/**
/**
...
@@ -53,7 +53,7 @@ Object.assign( ObjectLoader.prototype, {
...
@@ -53,7 +53,7 @@ Object.assign( ObjectLoader.prototype, {
var
scope
=
this
;
var
scope
=
this
;
var
loader
=
new
XHR
Loader
(
scope
.
manager
);
var
loader
=
new
File
Loader
(
scope
.
manager
);
loader
.
load
(
url
,
function
(
text
)
{
loader
.
load
(
url
,
function
(
text
)
{
var
json
=
null
;
var
json
=
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录