Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
fcff7a4c
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,发现更多精彩内容 >>
未验证
提交
fcff7a4c
编写于
2月 07, 2019
作者:
M
Mr.doob
提交者:
GitHub
2月 07, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15740 from linbingquan/clean-up
GLTFEXporter: Clean up
上级
26991948
3f4ddd9c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
20 deletion
+24
-20
examples/js/exporters/GLTFExporter.js
examples/js/exporters/GLTFExporter.js
+1
-1
examples/js/loaders/deprecated/LegacyGLTFLoader.js
examples/js/loaders/deprecated/LegacyGLTFLoader.js
+23
-19
未找到文件。
examples/js/exporters/GLTFExporter.js
浏览文件 @
fcff7a4c
examples/js/loaders/deprecated/LegacyGLTFLoader.js
浏览文件 @
fcff7a4c
...
@@ -566,8 +566,10 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -566,8 +566,10 @@ THREE.LegacyGLTFLoader = ( function () {
function
_each
(
object
,
callback
,
thisObj
)
{
function
_each
(
object
,
callback
,
thisObj
)
{
if
(
!
object
)
{
if
(
!
object
)
{
return
Promise
.
resolve
();
return
Promise
.
resolve
();
}
}
var
results
;
var
results
;
...
@@ -589,11 +591,11 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -589,11 +591,11 @@ THREE.LegacyGLTFLoader = ( function () {
if
(
value
instanceof
Promise
)
{
if
(
value
instanceof
Promise
)
{
value
.
then
(
function
(
key
,
value
)
{
value
.
then
(
function
(
key
,
value
)
{
results
[
key
]
=
value
;
results
[
key
]
=
value
;
}.
bind
(
this
,
idx
));
}.
bind
(
this
,
idx
)
);
}
else
{
}
else
{
...
@@ -621,11 +623,11 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -621,11 +623,11 @@ THREE.LegacyGLTFLoader = ( function () {
if
(
value
instanceof
Promise
)
{
if
(
value
instanceof
Promise
)
{
value
.
then
(
function
(
key
,
value
)
{
value
.
then
(
function
(
key
,
value
)
{
results
[
key
]
=
value
;
results
[
key
]
=
value
;
}.
bind
(
this
,
key
));
}.
bind
(
this
,
key
)
);
}
else
{
}
else
{
...
@@ -641,11 +643,11 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -641,11 +643,11 @@ THREE.LegacyGLTFLoader = ( function () {
}
}
return
Promise
.
all
(
fns
).
then
(
function
()
{
return
Promise
.
all
(
fns
).
then
(
function
()
{
return
results
;
return
results
;
});
}
);
}
}
...
@@ -1210,7 +1212,7 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -1210,7 +1212,7 @@ THREE.LegacyGLTFLoader = ( function () {
}
}
keys
.
forEach
(
function
(
v
)
{
keys
.
forEach
(
function
(
v
)
{
if
(
khr_material
.
values
[
v
]
!==
undefined
)
materialValues
[
v
]
=
khr_material
.
values
[
v
];
if
(
khr_material
.
values
[
v
]
!==
undefined
)
materialValues
[
v
]
=
khr_material
.
values
[
v
];
...
@@ -1515,7 +1517,7 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -1515,7 +1517,7 @@ THREE.LegacyGLTFLoader = ( function () {
materialParams
.
color
=
new
THREE
.
Color
().
fromArray
(
materialValues
.
diffuse
);
materialParams
.
color
=
new
THREE
.
Color
().
fromArray
(
materialValues
.
diffuse
);
}
else
if
(
typeof
(
materialValues
.
diffuse
)
===
'
string
'
)
{
}
else
if
(
typeof
(
materialValues
.
diffuse
)
===
'
string
'
)
{
materialParams
.
map
=
dependencies
.
textures
[
materialValues
.
diffuse
];
materialParams
.
map
=
dependencies
.
textures
[
materialValues
.
diffuse
];
...
@@ -1523,13 +1525,13 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -1523,13 +1525,13 @@ THREE.LegacyGLTFLoader = ( function () {
delete
materialParams
.
diffuse
;
delete
materialParams
.
diffuse
;
if
(
typeof
(
materialValues
.
reflective
)
===
'
string
'
)
{
if
(
typeof
(
materialValues
.
reflective
)
===
'
string
'
)
{
materialParams
.
envMap
=
dependencies
.
textures
[
materialValues
.
reflective
];
materialParams
.
envMap
=
dependencies
.
textures
[
materialValues
.
reflective
];
}
}
if
(
typeof
(
materialValues
.
bump
)
===
'
string
'
)
{
if
(
typeof
(
materialValues
.
bump
)
===
'
string
'
)
{
materialParams
.
bumpMap
=
dependencies
.
textures
[
materialValues
.
bump
];
materialParams
.
bumpMap
=
dependencies
.
textures
[
materialValues
.
bump
];
...
@@ -1547,7 +1549,7 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -1547,7 +1549,7 @@ THREE.LegacyGLTFLoader = ( function () {
}
}
}
else
if
(
typeof
(
materialValues
.
emission
)
===
'
string
'
)
{
}
else
if
(
typeof
(
materialValues
.
emission
)
===
'
string
'
)
{
if
(
materialType
===
THREE
.
MeshBasicMaterial
)
{
if
(
materialType
===
THREE
.
MeshBasicMaterial
)
{
...
@@ -1565,7 +1567,7 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -1565,7 +1567,7 @@ THREE.LegacyGLTFLoader = ( function () {
materialParams
.
specular
=
new
THREE
.
Color
().
fromArray
(
materialValues
.
specular
);
materialParams
.
specular
=
new
THREE
.
Color
().
fromArray
(
materialValues
.
specular
);
}
else
if
(
typeof
(
materialValues
.
specular
)
===
'
string
'
)
{
}
else
if
(
typeof
(
materialValues
.
specular
)
===
'
string
'
)
{
materialParams
.
specularMap
=
dependencies
.
textures
[
materialValues
.
specular
];
materialParams
.
specularMap
=
dependencies
.
textures
[
materialValues
.
specular
];
...
@@ -1670,9 +1672,9 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -1670,9 +1672,9 @@ THREE.LegacyGLTFLoader = ( function () {
var
parameters
=
json
.
techniques
[
material
.
technique
].
parameters
||
{};
var
parameters
=
json
.
techniques
[
material
.
technique
].
parameters
||
{};
for
(
var
attributeName
in
parameters
)
{
for
(
var
attributeName
in
parameters
)
{
if
(
parameters
[
attributeName
][
'
semantic
'
]
===
attributeId
)
{
if
(
parameters
[
attributeName
][
'
semantic
'
]
===
attributeId
)
{
geometry
.
addAttribute
(
attributeName
,
bufferAttribute
);
geometry
.
addAttribute
(
attributeName
,
bufferAttribute
);
...
@@ -2217,8 +2219,10 @@ THREE.LegacyGLTFLoader = ( function () {
...
@@ -2217,8 +2219,10 @@ THREE.LegacyGLTFLoader = ( function () {
if
(
child
.
material
&&
child
.
material
.
isRawShaderMaterial
)
{
if
(
child
.
material
&&
child
.
material
.
isRawShaderMaterial
)
{
child
.
gltfShader
=
new
GLTFShader
(
child
,
dependencies
.
nodes
);
child
.
gltfShader
=
new
GLTFShader
(
child
,
dependencies
.
nodes
);
child
.
onBeforeRender
=
function
(
renderer
,
scene
,
camera
){
child
.
onBeforeRender
=
function
(
renderer
,
scene
,
camera
)
{
this
.
gltfShader
.
update
(
scene
,
camera
);
this
.
gltfShader
.
update
(
scene
,
camera
);
};
};
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录