Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
c8bbc370
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,发现更多精彩内容 >>
提交
c8bbc370
编写于
7月 30, 2018
作者:
L
Lewy Blue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
increase scope of sceneGraph
上级
9a970e01
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
20 deletion
+19
-20
examples/js/loaders/FBXLoader.js
examples/js/loaders/FBXLoader.js
+19
-20
未找到文件。
examples/js/loaders/FBXLoader.js
浏览文件 @
c8bbc370
...
...
@@ -23,6 +23,7 @@ THREE.FBXLoader = ( function () {
var
FBXTree
;
var
connections
;
var
sceneGraph
=
new
THREE
.
Group
();
function
FBXLoader
(
manager
)
{
...
...
@@ -131,7 +132,9 @@ THREE.FBXLoader = ( function () {
var
deformers
=
this
.
parseDeformers
();
var
geometryMap
=
new
GeometryParser
().
parse
(
deformers
);
return
this
.
parseScene
(
deformers
,
geometryMap
,
materials
);
this
.
parseScene
(
deformers
,
geometryMap
,
materials
);
return
sceneGraph
;
},
...
...
@@ -766,8 +769,6 @@ THREE.FBXLoader = ( function () {
// create the main THREE.Group() to be returned by the loader
parseScene
:
function
(
deformers
,
geometryMap
,
materialMap
)
{
var
sceneGraph
=
new
THREE
.
Group
();
var
modelMap
=
this
.
parseModels
(
deformers
.
skeletons
,
geometryMap
,
materialMap
);
var
modelNodes
=
FBXTree
.
Objects
.
Model
;
...
...
@@ -776,7 +777,7 @@ THREE.FBXLoader = ( function () {
modelMap
.
forEach
(
function
(
model
)
{
var
modelNode
=
modelNodes
[
model
.
ID
];
self
.
setLookAtProperties
(
model
,
modelNode
,
sceneGraph
);
self
.
setLookAtProperties
(
model
,
modelNode
);
var
parentConnections
=
connections
.
get
(
model
.
ID
).
parents
;
...
...
@@ -798,24 +799,22 @@ THREE.FBXLoader = ( function () {
this
.
bindSkeleton
(
deformers
.
skeletons
,
geometryMap
,
modelMap
);
this
.
createAmbientLight
(
sceneGraph
);
this
.
createAmbientLight
();
this
.
setupMorphMaterials
(
sceneGraph
);
this
.
setupMorphMaterials
();
var
animations
=
new
AnimationParser
().
parse
(
sceneGraph
);
var
animations
=
new
AnimationParser
().
parse
();
// if all the models where already combined in a single group, just return that
if
(
sceneGraph
.
children
.
length
===
1
&&
sceneGraph
.
children
[
0
].
isGroup
)
{
sceneGraph
.
children
[
0
].
animations
=
animations
;
return
sceneGraph
.
children
[
0
];
sceneGraph
=
sceneGraph
.
children
[
0
];
}
sceneGraph
.
animations
=
animations
;
return
sceneGraph
;
},
// parse nodes in FBXTree.Objects.Model
...
...
@@ -1233,7 +1232,7 @@ THREE.FBXLoader = ( function () {
},
setLookAtProperties
:
function
(
model
,
modelNode
,
sceneGraph
)
{
setLookAtProperties
:
function
(
model
,
modelNode
)
{
if
(
'
LookAtProperty
'
in
modelNode
)
{
...
...
@@ -1347,7 +1346,7 @@ THREE.FBXLoader = ( function () {
},
// Parse ambient color in FBXTree.GlobalSettings - if it's not set to black (default), create an ambient light
createAmbientLight
:
function
(
sceneGraph
)
{
createAmbientLight
:
function
()
{
if
(
'
GlobalSettings
'
in
FBXTree
&&
'
AmbientColor
'
in
FBXTree
.
GlobalSettings
)
{
...
...
@@ -1367,7 +1366,7 @@ THREE.FBXLoader = ( function () {
},
setupMorphMaterials
:
function
(
sceneGraph
)
{
setupMorphMaterials
:
function
()
{
sceneGraph
.
traverse
(
function
(
child
)
{
...
...
@@ -2243,7 +2242,7 @@ THREE.FBXLoader = ( function () {
constructor
:
AnimationParser
,
// take raw animation clips and turn them into three.js animation clips
parse
:
function
(
sceneGraph
)
{
parse
:
function
()
{
var
animationClips
=
[];
...
...
@@ -2256,7 +2255,7 @@ THREE.FBXLoader = ( function () {
var
rawClip
=
rawClips
[
key
];
var
clip
=
this
.
addClip
(
rawClip
,
sceneGraph
);
var
clip
=
this
.
addClip
(
rawClip
);
animationClips
.
push
(
clip
);
...
...
@@ -2539,14 +2538,14 @@ THREE.FBXLoader = ( function () {
},
addClip
:
function
(
rawClip
,
sceneGraph
)
{
addClip
:
function
(
rawClip
)
{
var
tracks
=
[];
var
self
=
this
;
rawClip
.
layer
.
forEach
(
function
(
rawTracks
)
{
tracks
=
tracks
.
concat
(
self
.
generateTracks
(
rawTracks
,
sceneGraph
)
);
tracks
=
tracks
.
concat
(
self
.
generateTracks
(
rawTracks
)
);
}
);
...
...
@@ -2554,7 +2553,7 @@ THREE.FBXLoader = ( function () {
},
generateTracks
:
function
(
rawTracks
,
sceneGraph
)
{
generateTracks
:
function
(
rawTracks
)
{
var
tracks
=
[];
...
...
@@ -2591,7 +2590,7 @@ THREE.FBXLoader = ( function () {
if
(
rawTracks
.
DeformPercent
!==
undefined
)
{
var
morphTrack
=
this
.
generateMorphTrack
(
rawTracks
,
sceneGraph
);
var
morphTrack
=
this
.
generateMorphTrack
(
rawTracks
);
if
(
morphTrack
!==
undefined
)
tracks
.
push
(
morphTrack
);
}
...
...
@@ -2675,7 +2674,7 @@ THREE.FBXLoader = ( function () {
},
generateMorphTrack
:
function
(
rawTracks
,
sceneGraph
)
{
generateMorphTrack
:
function
(
rawTracks
)
{
var
curves
=
rawTracks
.
DeformPercent
.
curves
.
morph
;
var
values
=
curves
.
values
.
map
(
function
(
val
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录