Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
7d603a80
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,发现更多精彩内容 >>
提交
7d603a80
编写于
8月 31, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Inherit from Loader IV.
上级
ba08ba94
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
193 addition
and
332 deletion
+193
-332
examples/js/loaders/HDRCubeTextureLoader.js
examples/js/loaders/HDRCubeTextureLoader.js
+75
-82
examples/js/loaders/TTFLoader.js
examples/js/loaders/TTFLoader.js
+6
-11
examples/js/loaders/VRMLoader.js
examples/js/loaders/VRMLoader.js
+4
-26
examples/js/loaders/XLoader.js
examples/js/loaders/XLoader.js
+4
-30
examples/jsm/loaders/HDRCubeTextureLoader.d.ts
examples/jsm/loaders/HDRCubeTextureLoader.d.ts
+2
-4
examples/jsm/loaders/HDRCubeTextureLoader.js
examples/jsm/loaders/HDRCubeTextureLoader.js
+76
-83
examples/jsm/loaders/MTLLoader.d.ts
examples/jsm/loaders/MTLLoader.d.ts
+0
-1
examples/jsm/loaders/TTFLoader.d.ts
examples/jsm/loaders/TTFLoader.d.ts
+2
-5
examples/jsm/loaders/TTFLoader.js
examples/jsm/loaders/TTFLoader.js
+8
-13
examples/jsm/loaders/VRMLoader.d.ts
examples/jsm/loaders/VRMLoader.d.ts
+3
-10
examples/jsm/loaders/VRMLoader.js
examples/jsm/loaders/VRMLoader.js
+5
-27
examples/jsm/loaders/XLoader.d.ts
examples/jsm/loaders/XLoader.d.ts
+3
-9
examples/jsm/loaders/XLoader.js
examples/jsm/loaders/XLoader.js
+5
-31
未找到文件。
examples/js/loaders/HDRCubeTextureLoader.js
浏览文件 @
7d603a80
...
...
@@ -5,13 +5,18 @@
THREE
.
HDRCubeTextureLoader
=
function
(
manager
)
{
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
THREE
.
DefaultLoadingManager
;
THREE
.
Loader
.
call
(
this
,
manager
);
this
.
hdrLoader
=
new
THREE
.
RGBELoader
();
this
.
type
=
THREE
.
UnsignedByteType
;
};
THREE
.
HDRCubeTextureLoader
.
prototype
.
load
=
function
(
urls
,
onLoad
,
onProgress
,
onError
)
{
THREE
.
HDRCubeTextureLoader
.
prototype
=
Object
.
assign
(
Object
.
create
(
THREE
.
Loader
.
prototype
),
{
constructor
:
THREE
.
HDRCubeTextureLoader
,
load
:
function
(
urls
,
onLoad
,
onProgress
,
onError
)
{
if
(
!
Array
.
isArray
(
urls
)
)
{
...
...
@@ -112,27 +117,15 @@ THREE.HDRCubeTextureLoader.prototype.load = function ( urls, onLoad, onProgress,
return
texture
;
};
THREE
.
HDRCubeTextureLoader
.
prototype
.
setPath
=
function
(
value
)
{
this
.
path
=
value
;
return
this
;
};
},
THREE
.
HDRCubeTextureLoader
.
prototype
.
setDataType
=
function
(
value
)
{
setDataType
:
function
(
value
)
{
this
.
type
=
value
;
this
.
hdrLoader
.
setDataType
(
value
);
return
this
;
};
THREE
.
HDRCubeTextureLoader
.
prototype
.
setType
=
function
(
value
)
{
console
.
warn
(
'
THREE.HDRCubeTextureLoader: .setType() has been renamed to .setDataType().
'
);
return
this
;
return
this
.
setDataType
(
value
);
}
};
}
)
;
examples/js/loaders/TTFLoader.js
浏览文件 @
7d603a80
...
...
@@ -10,12 +10,14 @@
THREE
.
TTFLoader
=
function
(
manager
)
{
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
THREE
.
DefaultLoadingManager
;
THREE
.
Loader
.
call
(
this
,
manager
);
this
.
reversed
=
false
;
};
THREE
.
TTFLoader
.
prototype
=
{
THREE
.
TTFLoader
.
prototype
=
Object
.
assign
(
Object
.
create
(
THREE
.
Loader
.
prototype
),
{
constructor
:
THREE
.
TTFLoader
,
...
...
@@ -34,13 +36,6 @@ THREE.TTFLoader.prototype = {
},
setPath
:
function
(
value
)
{
this
.
path
=
value
;
return
this
;
},
parse
:
function
(
arraybuffer
)
{
function
convert
(
font
,
reversed
)
{
...
...
@@ -202,4 +197,4 @@ THREE.TTFLoader.prototype = {
}
};
}
)
;
examples/js/loaders/VRMLoader.js
浏览文件 @
7d603a80
...
...
@@ -17,17 +17,16 @@ THREE.VRMLoader = ( function () {
}
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
THREE
.
DefaultLoadingManager
;
THREE
.
Loader
.
call
(
this
,
manager
);
this
.
gltfLoader
=
new
THREE
.
GLTFLoader
(
this
.
manager
);
}
VRMLoader
.
prototype
=
{
VRMLoader
.
prototype
=
Object
.
assign
(
Object
.
create
(
THREE
.
Loader
.
prototype
),
{
constructor
:
VRMLoader
,
crossOrigin
:
'
anonymous
'
,
load
:
function
(
url
,
onLoad
,
onProgress
,
onError
)
{
var
scope
=
this
;
...
...
@@ -40,27 +39,6 @@ THREE.VRMLoader = ( function () {
},
setCrossOrigin
:
function
(
value
)
{
this
.
glTFLoader
.
setCrossOrigin
(
value
);
return
this
;
},
setPath
:
function
(
value
)
{
this
.
glTFLoader
.
setPath
(
value
);
return
this
;
},
setResourcePath
:
function
(
value
)
{
this
.
glTFLoader
.
setResourcePath
(
value
);
return
this
;
},
setDRACOLoader
:
function
(
dracoLoader
)
{
this
.
glTFLoader
.
setDRACOLoader
(
dracoLoader
);
...
...
@@ -80,7 +58,7 @@ THREE.VRMLoader = ( function () {
}
};
}
)
;
return
VRMLoader
;
...
...
examples/js/loaders/XLoader.js
浏览文件 @
7d603a80
...
...
@@ -201,10 +201,11 @@ THREE.XLoader = ( function () {
function
XLoader
(
manager
)
{
THREE
.
Loader
.
call
(
this
,
manager
);
classCallCheck
(
this
,
XLoader
);
this
.
debug
=
false
;
this
.
manager
=
manager
!==
undefined
?
manager
:
THREE
.
DefaultLoadingManager
;
this
.
texloader
=
new
THREE
.
TextureLoader
(
this
.
manager
);
this
.
url
=
""
;
this
.
_putMatLength
=
0
;
...
...
@@ -228,9 +229,6 @@ THREE.XLoader = ( function () {
}
createClass
(
XLoader
,
[
{
key
:
'
crossOrigin
'
,
value
:
'
anonymous
'
},
{
key
:
'
_setArgOption
'
,
value
:
function
_setArgOption
(
_arg
)
{
...
...
@@ -278,30 +276,6 @@ THREE.XLoader = ( function () {
},
onProgress
,
onError
);
}
},
{
key
:
'
setCrossOrigin
'
,
value
:
function
setCrossOrigin
(
value
)
{
this
.
crossOrigin
=
value
;
return
this
;
}
},
{
key
:
'
setPath
'
,
value
:
function
setPath
(
value
)
{
this
.
path
=
value
;
return
this
;
}
},
{
key
:
'
setResourcePath
'
,
value
:
function
setResourcePath
(
value
)
{
this
.
resourcePath
=
value
;
return
this
;
}
},
{
key
:
'
_readLine
'
,
...
...
@@ -482,11 +456,11 @@ THREE.XLoader = ( function () {
var
path
;
if
(
this
.
resourcePath
!==
undefined
)
{
if
(
this
.
resourcePath
!==
''
)
{
path
=
this
.
resourcePath
;
}
else
if
(
this
.
path
!==
undefined
)
{
}
else
if
(
this
.
path
!==
''
)
{
path
=
this
.
path
;
...
...
examples/jsm/loaders/HDRCubeTextureLoader.d.ts
浏览文件 @
7d603a80
import
{
CubeTexture
,
Loader
,
LoadingManager
,
TextureDataType
}
from
'
../../../src/Three
'
;
import
{
RGBELoader
}
from
'
./RGBELoader
'
;
export
class
HDRCubeTextureLoader
{
export
class
HDRCubeTextureLoader
extends
Loader
{
constructor
(
manager
?:
LoadingManager
);
manager
:
LoadingManager
;
hdrLoader
:
RGBELoader
;
path
:
string
;
type
:
TextureDataType
;
load
(
urls
:
string
[],
onLoad
:
(
texture
:
CubeTexture
)
=>
void
,
onProgress
?:
(
event
:
ProgressEvent
)
=>
void
,
onError
?:
(
event
:
ErrorEvent
)
=>
void
):
void
;
setPath
(
value
:
string
):
this
;
setDataType
(
type
:
TextureDataType
):
this
;
}
examples/jsm/loaders/HDRCubeTextureLoader.js
浏览文件 @
7d603a80
...
...
@@ -6,12 +6,12 @@
import
{
CubeTexture
,
DataTexture
,
DefaultLoadingManager
,
FileLoader
,
FloatType
,
HalfFloatType
,
LinearEncoding
,
LinearFilter
,
Loader
,
NearestFilter
,
RGBAFormat
,
RGBEEncoding
,
...
...
@@ -22,13 +22,18 @@ import { RGBELoader } from "../loaders/RGBELoader.js";
var
HDRCubeTextureLoader
=
function
(
manager
)
{
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
DefaultLoadingManager
;
Loader
.
call
(
this
,
manager
);
this
.
hdrLoader
=
new
RGBELoader
();
this
.
type
=
UnsignedByteType
;
};
HDRCubeTextureLoader
.
prototype
.
load
=
function
(
urls
,
onLoad
,
onProgress
,
onError
)
{
HDRCubeTextureLoader
.
prototype
=
Object
.
assign
(
Object
.
create
(
Loader
.
prototype
),
{
constructor
:
HDRCubeTextureLoader
,
load
:
function
(
urls
,
onLoad
,
onProgress
,
onError
)
{
if
(
!
Array
.
isArray
(
urls
)
)
{
...
...
@@ -129,29 +134,17 @@ HDRCubeTextureLoader.prototype.load = function ( urls, onLoad, onProgress, onErr
return
texture
;
};
HDRCubeTextureLoader
.
prototype
.
setPath
=
function
(
value
)
{
this
.
path
=
value
;
return
this
;
};
},
HDRCubeTextureLoader
.
prototype
.
setDataType
=
function
(
value
)
{
setDataType
:
function
(
value
)
{
this
.
type
=
value
;
this
.
hdrLoader
.
setDataType
(
value
);
return
this
;
};
HDRCubeTextureLoader
.
prototype
.
setType
=
function
(
value
)
{
console
.
warn
(
'
THREE.HDRCubeTextureLoader: .setType() has been renamed to .setDataType().
'
);
return
this
;
return
this
.
setDataType
(
value
);
}
};
}
)
;
export
{
HDRCubeTextureLoader
};
examples/jsm/loaders/MTLLoader.d.ts
浏览文件 @
7d603a80
...
...
@@ -45,7 +45,6 @@ export class MTLLoader extends Loader {
load
(
url
:
string
,
onLoad
:
(
materialCreator
:
MaterialCreator
)
=>
void
,
onProgress
?:
(
event
:
ProgressEvent
)
=>
void
,
onError
?:
(
event
:
ErrorEvent
)
=>
void
):
void
;
parse
(
text
:
string
)
:
MaterialCreator
;
setBaseUrl
(
path
:
string
)
:
void
;
setMaterialOptions
(
value
:
MaterialCreatorOptions
)
:
void
;
}
...
...
examples/jsm/loaders/TTFLoader.d.ts
浏览文件 @
7d603a80
import
{
BufferGeometry
,
Loader
,
LoadingManager
}
from
'
../../../src/Three
'
;
export
class
TTFLoader
{
export
class
TTFLoader
extends
Loader
{
constructor
(
manager
?:
LoadingManager
);
manager
:
LoadingManager
;
path
:
string
;
reversed
:
boolean
;
load
(
url
:
string
,
onLoad
:
(
json
:
object
)
=>
void
,
onProgress
?:
(
event
:
ProgressEvent
)
=>
void
,
onError
?:
(
event
:
ErrorEvent
)
=>
void
):
void
;
setPath
(
path
:
string
):
this
;
parse
(
arraybuffer
:
ArrayBuffer
):
object
;
}
examples/jsm/loaders/TTFLoader.js
浏览文件 @
7d603a80
...
...
@@ -9,18 +9,20 @@
*/
import
{
DefaultLoadingManag
er
,
File
Loader
FileLoad
er
,
Loader
}
from
"
../../../build/three.module.js
"
;
var
TTFLoader
=
function
(
manager
)
{
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
DefaultLoadingManager
;
Loader
.
call
(
this
,
manager
);
this
.
reversed
=
false
;
};
TTFLoader
.
prototype
=
{
TTFLoader
.
prototype
=
Object
.
assign
(
Object
.
create
(
Loader
.
prototype
),
{
constructor
:
TTFLoader
,
...
...
@@ -39,13 +41,6 @@ TTFLoader.prototype = {
},
setPath
:
function
(
value
)
{
this
.
path
=
value
;
return
this
;
},
parse
:
function
(
arraybuffer
)
{
function
convert
(
font
,
reversed
)
{
...
...
@@ -207,6 +202,6 @@ TTFLoader.prototype = {
}
};
}
)
;
export
{
TTFLoader
};
examples/jsm/loaders/VRMLoader.d.ts
浏览文件 @
7d603a80
import
{
Loader
,
LoadingManager
}
from
'
../../../src/Three
'
;
import
{
GLTFLoader
,
GLTF
}
from
'
./GLTFLoader
'
;
import
{
DRACOLoader
}
from
'
./DRACOLoader
'
;
export
class
VRMLoader
{
export
class
VRMLoader
extends
Loader
{
constructor
(
manager
?:
LoadingManager
);
gltfLoader
:
GLTFLoader
;
manager
:
LoadingManager
;
path
:
string
;
resourcePath
:
string
;
crossOrigin
:
string
;
load
(
url
:
string
,
onLoad
:
(
scene
:
GLTF
)
=>
void
,
onProgress
?:
(
event
:
ProgressEvent
)
=>
void
,
onError
?:
(
event
:
ErrorEvent
)
=>
void
)
:
void
;
setDRACOLoader
(
dracoLoader
:
DRACOLoader
):
this
;
setPath
(
path
:
string
):
this
;
setResourcePath
(
path
:
string
):
this
;
setCrossOrigin
(
path
:
string
):
this
;
parse
(
gltf
:
GLTF
,
onLoad
:
(
scene
:
GLTF
)
=>
void
):
void
;
setDRACOLoader
(
dracoLoader
:
DRACOLoader
):
this
;
}
examples/jsm/loaders/VRMLoader.js
浏览文件 @
7d603a80
...
...
@@ -3,7 +3,7 @@
*/
import
{
DefaultLoadingManag
er
Load
er
}
from
"
../../../build/three.module.js
"
;
import
{
GLTFLoader
}
from
"
../loaders/GLTFLoader.js
"
;
...
...
@@ -22,17 +22,16 @@ var VRMLoader = ( function () {
}
this
.
manager
=
(
manager
!==
undefined
)
?
manager
:
DefaultLoadingManager
;
Loader
.
call
(
this
,
manager
);
this
.
gltfLoader
=
new
GLTFLoader
(
this
.
manager
);
}
VRMLoader
.
prototype
=
{
VRMLoader
.
prototype
=
Object
.
assign
(
Object
.
create
(
Loader
.
prototype
),
{
constructor
:
VRMLoader
,
crossOrigin
:
'
anonymous
'
,
load
:
function
(
url
,
onLoad
,
onProgress
,
onError
)
{
var
scope
=
this
;
...
...
@@ -45,27 +44,6 @@ var VRMLoader = ( function () {
},
setCrossOrigin
:
function
(
value
)
{
this
.
glTFLoader
.
setCrossOrigin
(
value
);
return
this
;
},
setPath
:
function
(
value
)
{
this
.
glTFLoader
.
setPath
(
value
);
return
this
;
},
setResourcePath
:
function
(
value
)
{
this
.
glTFLoader
.
setResourcePath
(
value
);
return
this
;
},
setDRACOLoader
:
function
(
dracoLoader
)
{
this
.
glTFLoader
.
setDRACOLoader
(
dracoLoader
);
...
...
@@ -85,7 +63,7 @@ var VRMLoader = ( function () {
}
};
}
)
;
return
VRMLoader
;
...
...
examples/jsm/loaders/XLoader.d.ts
浏览文件 @
7d603a80
import
{
Mesh
,
Loader
,
LoadingManager
}
from
'
../../../src/Three
'
;
...
...
@@ -8,16 +9,9 @@ export interface XResult {
models
:
Mesh
[];
}
export
class
VRML
Loader
{
export
class
XLoader
extends
Loader
{
constructor
(
manager
?:
LoadingManager
);
crossOrigin
:
string
;
manager
:
LoadingManager
;
path
:
string
;
resourcePath
:
string
;
load
(
url
:
string
,
onLoad
:
(
object
:
object
)
=>
void
,
onProgress
?:
(
event
:
ProgressEvent
)
=>
void
,
onError
?:
(
event
:
ErrorEvent
)
=>
void
):
void
;
setCrossOrigin
(
path
:
string
):
this
;
load
(
url
:
string
,
onLoad
:
(
object
:
XResult
)
=>
void
,
onProgress
?:
(
event
:
ProgressEvent
)
=>
void
,
onError
?:
(
event
:
ErrorEvent
)
=>
void
):
void
;
parse
(
data
:
ArrayBuffer
|
string
,
onLoad
:
(
object
:
object
)
=>
void
):
object
;
setPath
(
path
:
string
):
this
;
setResourcePath
(
path
:
string
):
this
;
}
examples/jsm/loaders/XLoader.js
浏览文件 @
7d603a80
...
...
@@ -7,10 +7,10 @@ import {
AnimationMixer
,
Bone
,
BufferGeometry
,
DefaultLoadingManager
,
FileLoader
,
Float32BufferAttribute
,
FrontSide
,
Loader
,
LoaderUtils
,
Matrix4
,
Mesh
,
...
...
@@ -223,10 +223,11 @@ var XLoader = ( function () {
function
XLoader
(
manager
)
{
Loader
.
call
(
this
,
manager
);
classCallCheck
(
this
,
XLoader
);
this
.
debug
=
false
;
this
.
manager
=
manager
!==
undefined
?
manager
:
DefaultLoadingManager
;
this
.
texloader
=
new
TextureLoader
(
this
.
manager
);
this
.
url
=
""
;
this
.
_putMatLength
=
0
;
...
...
@@ -250,9 +251,6 @@ var XLoader = ( function () {
}
createClass
(
XLoader
,
[
{
key
:
'
crossOrigin
'
,
value
:
'
anonymous
'
},
{
key
:
'
_setArgOption
'
,
value
:
function
_setArgOption
(
_arg
)
{
...
...
@@ -300,30 +298,6 @@ var XLoader = ( function () {
},
onProgress
,
onError
);
}
},
{
key
:
'
setCrossOrigin
'
,
value
:
function
setCrossOrigin
(
value
)
{
this
.
crossOrigin
=
value
;
return
this
;
}
},
{
key
:
'
setPath
'
,
value
:
function
setPath
(
value
)
{
this
.
path
=
value
;
return
this
;
}
},
{
key
:
'
setResourcePath
'
,
value
:
function
setResourcePath
(
value
)
{
this
.
resourcePath
=
value
;
return
this
;
}
},
{
key
:
'
_readLine
'
,
...
...
@@ -504,11 +478,11 @@ var XLoader = ( function () {
var
path
;
if
(
this
.
resourcePath
!==
undefined
)
{
if
(
this
.
resourcePath
!==
''
)
{
path
=
this
.
resourcePath
;
}
else
if
(
this
.
path
!==
undefined
)
{
}
else
if
(
this
.
path
!==
''
)
{
path
=
this
.
path
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录