Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f2076124
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,发现更多精彩内容 >>
提交
f2076124
编写于
8月 01, 2018
作者:
G
Gavrilov Miroslav
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed FBXTreeInstance to fbxTree
上级
b362a81f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
36 deletion
+36
-36
examples/js/loaders/FBXLoader.js
examples/js/loaders/FBXLoader.js
+36
-36
未找到文件。
examples/js/loaders/FBXLoader.js
浏览文件 @
f2076124
...
...
@@ -21,7 +21,7 @@
THREE
.
FBXLoader
=
(
function
()
{
var
FBXTreeInstanc
e
;
var
fbxTre
e
;
var
connections
;
var
sceneGraph
;
...
...
@@ -77,7 +77,7 @@ THREE.FBXLoader = ( function () {
if
(
isFbxFormatBinary
(
FBXBuffer
)
)
{
FBXTreeInstanc
e
=
new
BinaryParser
().
parse
(
FBXBuffer
);
fbxTre
e
=
new
BinaryParser
().
parse
(
FBXBuffer
);
}
else
{
...
...
@@ -95,7 +95,7 @@ THREE.FBXLoader = ( function () {
}
FBXTreeInstanc
e
=
new
TextParser
().
parse
(
FBXText
);
fbxTre
e
=
new
TextParser
().
parse
(
FBXText
);
}
...
...
@@ -103,7 +103,7 @@ THREE.FBXLoader = ( function () {
var
textureLoader
=
new
THREE
.
TextureLoader
(
this
.
manager
).
setPath
(
resourceDirectory
).
setCrossOrigin
(
this
.
crossOrigin
);
return
new
FBXTreeParser
(
textureLoader
).
parse
(
FBXTreeInstanc
e
);
return
new
FBXTreeParser
(
textureLoader
).
parse
(
fbxTre
e
);
}
...
...
@@ -142,9 +142,9 @@ THREE.FBXLoader = ( function () {
var
connectionMap
=
new
Map
();
if
(
'
Connections
'
in
FBXTreeInstanc
e
)
{
if
(
'
Connections
'
in
fbxTre
e
)
{
var
rawConnections
=
FBXTreeInstanc
e
.
Connections
.
connections
;
var
rawConnections
=
fbxTre
e
.
Connections
.
connections
;
rawConnections
.
forEach
(
function
(
rawConnection
)
{
...
...
@@ -192,9 +192,9 @@ THREE.FBXLoader = ( function () {
var
images
=
{};
var
blobs
=
{};
if
(
'
Video
'
in
FBXTreeInstanc
e
.
Objects
)
{
if
(
'
Video
'
in
fbxTre
e
.
Objects
)
{
var
videoNodes
=
FBXTreeInstanc
e
.
Objects
.
Video
;
var
videoNodes
=
fbxTre
e
.
Objects
.
Video
;
for
(
var
nodeID
in
videoNodes
)
{
...
...
@@ -316,9 +316,9 @@ THREE.FBXLoader = ( function () {
var
textureMap
=
new
Map
();
if
(
'
Texture
'
in
FBXTreeInstanc
e
.
Objects
)
{
if
(
'
Texture
'
in
fbxTre
e
.
Objects
)
{
var
textureNodes
=
FBXTreeInstanc
e
.
Objects
.
Texture
;
var
textureNodes
=
fbxTre
e
.
Objects
.
Texture
;
for
(
var
nodeID
in
textureNodes
)
{
var
texture
=
this
.
parseTexture
(
textureNodes
[
nodeID
],
images
);
...
...
@@ -410,9 +410,9 @@ THREE.FBXLoader = ( function () {
var
materialMap
=
new
Map
();
if
(
'
Material
'
in
FBXTreeInstanc
e
.
Objects
)
{
if
(
'
Material
'
in
fbxTre
e
.
Objects
)
{
var
materialNodes
=
FBXTreeInstanc
e
.
Objects
.
Material
;
var
materialNodes
=
fbxTre
e
.
Objects
.
Material
;
for
(
var
nodeID
in
materialNodes
)
{
...
...
@@ -607,7 +607,7 @@ THREE.FBXLoader = ( function () {
getTexture
:
function
(
textureMap
,
id
)
{
// if the texture is a layered texture, just use the first layer and issue a warning
if
(
'
LayeredTexture
'
in
FBXTreeInstance
.
Objects
&&
id
in
FBXTreeInstanc
e
.
Objects
.
LayeredTexture
)
{
if
(
'
LayeredTexture
'
in
fbxTree
.
Objects
&&
id
in
fbxTre
e
.
Objects
.
LayeredTexture
)
{
console
.
warn
(
'
THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer.
'
);
id
=
connections
.
get
(
id
).
children
[
0
].
ID
;
...
...
@@ -626,9 +626,9 @@ THREE.FBXLoader = ( function () {
var
skeletons
=
{};
var
morphTargets
=
{};
if
(
'
Deformer
'
in
FBXTreeInstanc
e
.
Objects
)
{
if
(
'
Deformer
'
in
fbxTre
e
.
Objects
)
{
var
DeformerNodes
=
FBXTreeInstanc
e
.
Objects
.
Deformer
;
var
DeformerNodes
=
fbxTre
e
.
Objects
.
Deformer
;
for
(
var
nodeID
in
DeformerNodes
)
{
...
...
@@ -771,7 +771,7 @@ THREE.FBXLoader = ( function () {
var
modelMap
=
this
.
parseModels
(
deformers
.
skeletons
,
geometryMap
,
materialMap
);
var
modelNodes
=
FBXTreeInstanc
e
.
Objects
.
Model
;
var
modelNodes
=
fbxTre
e
.
Objects
.
Model
;
var
self
=
this
;
modelMap
.
forEach
(
function
(
model
)
{
...
...
@@ -821,7 +821,7 @@ THREE.FBXLoader = ( function () {
parseModels
:
function
(
skeletons
,
geometryMap
,
materialMap
)
{
var
modelMap
=
new
Map
();
var
modelNodes
=
FBXTreeInstanc
e
.
Objects
.
Model
;
var
modelNodes
=
fbxTre
e
.
Objects
.
Model
;
for
(
var
nodeID
in
modelNodes
)
{
...
...
@@ -921,7 +921,7 @@ THREE.FBXLoader = ( function () {
relationships
.
children
.
forEach
(
function
(
child
)
{
var
attr
=
FBXTreeInstanc
e
.
Objects
.
NodeAttribute
[
child
.
ID
];
var
attr
=
fbxTre
e
.
Objects
.
NodeAttribute
[
child
.
ID
];
if
(
attr
!==
undefined
)
{
...
...
@@ -1012,7 +1012,7 @@ THREE.FBXLoader = ( function () {
relationships
.
children
.
forEach
(
function
(
child
)
{
var
attr
=
FBXTreeInstanc
e
.
Objects
.
NodeAttribute
[
child
.
ID
];
var
attr
=
fbxTre
e
.
Objects
.
NodeAttribute
[
child
.
ID
];
if
(
attr
!==
undefined
)
{
...
...
@@ -1242,7 +1242,7 @@ THREE.FBXLoader = ( function () {
if
(
child
.
relationship
===
'
LookAtProperty
'
)
{
var
lookAtTarget
=
FBXTreeInstanc
e
.
Objects
.
Model
[
child
.
ID
];
var
lookAtTarget
=
fbxTre
e
.
Objects
.
Model
[
child
.
ID
];
if
(
'
Lcl_Translation
'
in
lookAtTarget
)
{
...
...
@@ -1311,9 +1311,9 @@ THREE.FBXLoader = ( function () {
var
bindMatrices
=
{};
if
(
'
Pose
'
in
FBXTreeInstanc
e
.
Objects
)
{
if
(
'
Pose
'
in
fbxTre
e
.
Objects
)
{
var
BindPoseNode
=
FBXTreeInstanc
e
.
Objects
.
Pose
;
var
BindPoseNode
=
fbxTre
e
.
Objects
.
Pose
;
for
(
var
nodeID
in
BindPoseNode
)
{
...
...
@@ -1348,9 +1348,9 @@ THREE.FBXLoader = ( function () {
// Parse ambient color in FBXTree.GlobalSettings - if it's not set to black (default), create an ambient light
createAmbientLight
:
function
()
{
if
(
'
GlobalSettings
'
in
FBXTreeInstance
&&
'
AmbientColor
'
in
FBXTreeInstanc
e
.
GlobalSettings
)
{
if
(
'
GlobalSettings
'
in
fbxTree
&&
'
AmbientColor
'
in
fbxTre
e
.
GlobalSettings
)
{
var
ambientColor
=
FBXTreeInstanc
e
.
GlobalSettings
.
AmbientColor
.
value
;
var
ambientColor
=
fbxTre
e
.
GlobalSettings
.
AmbientColor
.
value
;
var
r
=
ambientColor
[
0
];
var
g
=
ambientColor
[
1
];
var
b
=
ambientColor
[
2
];
...
...
@@ -1416,9 +1416,9 @@ THREE.FBXLoader = ( function () {
var
geometryMap
=
new
Map
();
if
(
'
Geometry
'
in
FBXTreeInstanc
e
.
Objects
)
{
if
(
'
Geometry
'
in
fbxTre
e
.
Objects
)
{
var
geoNodes
=
FBXTreeInstanc
e
.
Objects
.
Geometry
;
var
geoNodes
=
fbxTre
e
.
Objects
.
Geometry
;
for
(
var
nodeID
in
geoNodes
)
{
...
...
@@ -1460,7 +1460,7 @@ THREE.FBXLoader = ( function () {
var
modelNodes
=
relationships
.
parents
.
map
(
function
(
parent
)
{
return
FBXTreeInstanc
e
.
Objects
.
Model
[
parent
.
ID
];
return
fbxTre
e
.
Objects
.
Model
[
parent
.
ID
];
}
);
...
...
@@ -1988,7 +1988,7 @@ THREE.FBXLoader = ( function () {
var
self
=
this
;
morphTarget
.
rawTargets
.
forEach
(
function
(
rawTarget
)
{
var
morphGeoNode
=
FBXTreeInstanc
e
.
Objects
.
Geometry
[
rawTarget
.
geoID
];
var
morphGeoNode
=
fbxTre
e
.
Objects
.
Geometry
[
rawTarget
.
geoID
];
if
(
morphGeoNode
!==
undefined
)
{
...
...
@@ -2269,7 +2269,7 @@ THREE.FBXLoader = ( function () {
// since the actual transformation data is stored in FBXTree.Objects.AnimationCurve,
// if this is undefined we can safely assume there are no animations
if
(
FBXTreeInstanc
e
.
Objects
.
AnimationCurve
===
undefined
)
return
undefined
;
if
(
fbxTre
e
.
Objects
.
AnimationCurve
===
undefined
)
return
undefined
;
var
curveNodesMap
=
this
.
parseAnimationCurveNodes
();
...
...
@@ -2287,7 +2287,7 @@ THREE.FBXLoader = ( function () {
// and is referenced by an AnimationLayer
parseAnimationCurveNodes
:
function
()
{
var
rawCurveNodes
=
FBXTreeInstanc
e
.
Objects
.
AnimationCurveNode
;
var
rawCurveNodes
=
fbxTre
e
.
Objects
.
AnimationCurveNode
;
var
curveNodesMap
=
new
Map
();
...
...
@@ -2320,7 +2320,7 @@ THREE.FBXLoader = ( function () {
// axis ( e.g. times and values of x rotation)
parseAnimationCurves
:
function
(
curveNodesMap
)
{
var
rawCurves
=
FBXTreeInstanc
e
.
Objects
.
AnimationCurve
;
var
rawCurves
=
fbxTre
e
.
Objects
.
AnimationCurve
;
// TODO: Many values are identical up to roundoff error, but won't be optimised
// e.g. position times: [0, 0.4, 0. 8]
...
...
@@ -2375,7 +2375,7 @@ THREE.FBXLoader = ( function () {
// note: theoretically a stack can have multiple layers, however in practice there always seems to be one per stack
parseAnimationLayers
:
function
(
curveNodesMap
)
{
var
rawLayers
=
FBXTreeInstanc
e
.
Objects
.
AnimationLayer
;
var
rawLayers
=
fbxTre
e
.
Objects
.
AnimationLayer
;
var
layersMap
=
new
Map
();
...
...
@@ -2410,7 +2410,7 @@ THREE.FBXLoader = ( function () {
}
);
var
rawModel
=
FBXTreeInstanc
e
.
Objects
.
Model
[
modelID
.
toString
()
];
var
rawModel
=
fbxTre
e
.
Objects
.
Model
[
modelID
.
toString
()
];
var
node
=
{
...
...
@@ -2451,12 +2451,12 @@ THREE.FBXLoader = ( function () {
// assuming geometry is not used in more than one model
var
modelID
=
connections
.
get
(
geoID
).
parents
[
0
].
ID
;
var
rawModel
=
FBXTreeInstanc
e
.
Objects
.
Model
[
modelID
];
var
rawModel
=
fbxTre
e
.
Objects
.
Model
[
modelID
];
var
node
=
{
modelName
:
THREE
.
PropertyBinding
.
sanitizeNodeName
(
rawModel
.
attrName
),
morphName
:
FBXTreeInstanc
e
.
Objects
.
Deformer
[
deformerID
].
attrName
,
morphName
:
fbxTre
e
.
Objects
.
Deformer
[
deformerID
].
attrName
,
};
...
...
@@ -2506,7 +2506,7 @@ THREE.FBXLoader = ( function () {
// hierarchy. Each Stack node will be used to create a THREE.AnimationClip
parseAnimStacks
:
function
(
layersMap
)
{
var
rawStacks
=
FBXTreeInstanc
e
.
Objects
.
AnimationStack
;
var
rawStacks
=
fbxTre
e
.
Objects
.
AnimationStack
;
// connect the stacks (clips) up to the layers
var
rawClips
=
{};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录