Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
10052662
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,发现更多精彩内容 >>
提交
10052662
编写于
11月 19, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into renderer_plugins
上级
3ded4a40
91233570
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
15 deletion
+15
-15
build/Three.js
build/Three.js
+2
-2
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+2
-2
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+2
-2
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+2
-2
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+5
-5
src/core/Matrix4.js
src/core/Matrix4.js
+2
-2
未找到文件。
build/Three.js
浏览文件 @
10052662
...
...
@@ -35,13 +35,13 @@ y+l*u+p*B+s*K;this.n44=q*I+l*F+p*N+s*j;return this},multiplySelf:function(a){ret
a
;
this
.
n24
*=
a
;
this
.
n31
*=
a
;
this
.
n32
*=
a
;
this
.
n33
*=
a
;
this
.
n34
*=
a
;
this
.
n41
*=
a
;
this
.
n42
*=
a
;
this
.
n43
*=
a
;
this
.
n44
*=
a
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
e
;
a
.
y
=
(
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
)
*
e
;
a
.
z
=
(
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
)
*
e
;
return
a
},
multiplyVector4
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
a
.
w
;
a
.
x
=
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
*
e
;
a
.
y
=
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
*
e
;
a
.
z
=
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
*
e
;
a
.
w
=
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
*
e
;
return
a
},
rotateAxis
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
.
x
=
b
*
this
.
n11
+
c
*
this
.
n12
+
d
*
this
.
n13
;
a
.
y
=
b
*
this
.
n21
+
c
*
this
.
n22
+
d
*
this
.
n23
;
a
.
z
=
b
*
this
.
n31
+
c
*
this
.
n32
+
d
*
this
.
n33
;
a
.
normalize
();
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
e
=
this
.
n21
,
g
=
this
.
n22
,
f
=
this
.
n23
,
h
=
this
.
n24
,
i
=
this
.
n31
,
m
=
this
.
n32
,
k
=
this
.
n33
,
o
=
this
.
n34
,
r
=
this
.
n41
,
n
=
this
.
n42
,
q
=
this
.
n43
,
l
=
this
.
n44
;
return
d
*
f
*
m
*
r
-
c
*
h
*
m
*
r
-
d
*
g
*
k
*
r
+
b
*
h
*
k
*
r
+
c
*
g
*
o
*
r
-
b
*
f
*
o
*
r
-
d
*
f
*
i
*
n
+
c
*
h
*
i
*
n
+
d
*
e
*
k
*
n
-
a
*
h
*
k
*
n
-
c
*
e
*
o
*
n
+
a
*
f
*
o
*
n
+
d
*
g
*
i
*
q
-
b
*
h
*
i
*
q
-
d
*
e
*
m
*
q
+
a
*
h
*
m
*
q
+
b
*
e
*
o
*
q
-
a
*
g
*
o
*
q
-
c
*
g
*
i
*
l
+
b
*
f
*
i
*
l
+
c
*
e
*
m
*
l
-
a
*
f
*
m
*
l
-
b
*
e
*
k
*
l
+
a
*
g
*
k
*
l
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
.
n43
=
this
.
n43
;
a
.
n44
=
this
.
n44
;
return
a
},
flatten
:
function
(){
this
.
flat
[
0
]
=
this
.
n11
;
this
.
flat
[
1
]
=
this
.
n21
;
this
.
flat
[
2
]
=
this
.
n31
;
this
.
flat
[
3
]
=
this
.
n41
;
this
.
flat
[
4
]
=
this
.
n12
;
this
.
flat
[
5
]
=
this
.
n22
;
this
.
flat
[
6
]
=
this
.
n32
;
this
.
flat
[
7
]
=
this
.
n42
;
this
.
flat
[
8
]
=
this
.
n13
;
this
.
flat
[
9
]
=
this
.
n23
;
this
.
flat
[
10
]
=
this
.
n33
;
this
.
flat
[
11
]
=
this
.
n43
;
this
.
flat
[
12
]
=
this
.
n14
;
this
.
flat
[
13
]
=
this
.
n24
;
this
.
flat
[
14
]
=
this
.
n34
;
this
.
flat
[
15
]
=
this
.
n44
;
return
this
.
flat
},
flattenToArray
:
function
(
a
){
a
[
0
]
=
this
.
n11
;
a
[
1
]
=
this
.
n21
;
a
[
2
]
=
this
.
n31
;
a
[
3
]
=
this
.
n41
;
a
[
4
]
=
this
.
n12
;
a
[
5
]
=
this
.
n22
;
a
[
6
]
=
this
.
n32
;
a
[
7
]
=
this
.
n42
;
a
[
8
]
=
this
.
n13
;
a
[
9
]
=
this
.
n23
;
a
[
10
]
=
this
.
n33
;
a
[
11
]
=
this
.
n43
;
a
[
12
]
=
this
.
n14
;
a
[
13
]
=
this
.
n24
;
a
[
14
]
=
this
.
n34
;
a
[
15
]
=
this
.
n44
;
return
a
},
flattenToArrayOffset
:
function
(
a
,
b
){
a
[
b
]
=
this
.
n11
;
a
[
b
+
1
]
=
this
.
n21
;
a
[
b
+
2
]
=
this
.
n31
;
a
[
b
+
3
]
=
this
.
n41
;
a
[
b
+
4
]
=
this
.
n12
;
a
[
b
+
5
]
=
this
.
n22
;
a
[
b
+
6
]
=
this
.
n32
;
a
[
b
+
7
]
=
this
.
n42
;
a
[
b
+
8
]
=
this
.
n13
;
a
[
b
+
9
]
=
this
.
n23
;
a
[
b
+
10
]
=
this
.
n33
;
a
[
b
+
11
]
=
this
.
n43
;
a
[
b
+
12
]
=
this
.
n14
;
a
[
b
+
13
]
=
this
.
n24
;
a
[
b
+
14
]
=
this
.
n34
;
a
[
b
+
15
]
=
this
.
n44
;
return
a
},
setTranslation
:
function
(
a
,
b
,
c
){
this
.
set
(
1
,
0
,
0
,
a
,
0
,
1
,
0
,
b
,
0
,
0
,
1
,
c
,
0
,
0
,
0
,
1
);
return
this
},
setScale
:
function
(
a
,
b
,
c
){
this
.
set
(
a
,
0
,
0
,
0
,
0
,
b
,
0
,
0
,
0
,
0
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationX
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
1
,
0
,
0
,
0
,
0
,
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationY
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
0
,
a
,
0
,
0
,
1
,
0
,
0
,
-
a
,
0
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationZ
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
e
=
1
-
c
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
i
=
e
*
g
,
m
=
e
*
f
;
this
.
set
(
i
*
g
+
c
,
i
*
f
-
d
*
h
,
i
*
h
+
d
*
f
,
0
,
i
*
f
+
d
*
h
,
m
*
f
+
c
,
m
*
h
-
d
*
g
,
0
,
i
*
h
-
d
*
f
,
m
*
h
+
d
*
g
,
e
*
h
*
h
+
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setPosition
:
function
(
a
){
this
.
n14
=
a
.
x
;
this
.
n24
=
a
.
y
;
this
.
n34
=
a
.
z
;
return
this
},
getPosition
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n14
,
this
.
n24
,
this
.
n34
)},
getColumnX
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n11
,
this
.
n21
,
this
.
n31
)},
getColumnY
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n12
,
this
.
n22
,
this
.
n32
)},
getColumnZ
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n13
,
this
.
n23
,
this
.
n33
)},
getInverse
:
function
(
a
){
var
b
=
a
.
n11
,
c
=
a
.
n12
,
d
=
a
.
n13
,
e
=
a
.
n14
,
g
=
a
.
n21
,
f
=
a
.
n22
,
h
=
a
.
n23
,
i
=
a
.
n24
,
m
=
a
.
n31
,
k
=
a
.
n32
,
o
=
a
.
n33
,
r
=
a
.
n34
,
n
=
a
.
n41
,
q
=
a
.
n42
,
l
=
a
.
n43
,
p
=
a
.
n44
;
this
.
n11
=
h
*
r
*
q
-
i
*
o
*
q
+
i
*
k
*
l
-
f
*
r
*
l
-
h
*
k
*
p
+
f
*
o
*
p
;
this
.
n12
=
e
*
o
*
q
-
d
*
r
*
q
-
e
*
k
*
l
+
c
*
r
*
l
+
d
*
k
*
p
-
c
*
o
*
p
;
this
.
n13
=
d
*
i
*
q
-
e
*
h
*
q
+
e
*
f
*
l
-
c
*
i
*
l
-
d
*
f
*
p
+
c
*
h
*
p
;
this
.
n14
=
e
*
h
*
k
-
d
*
i
*
k
-
e
*
f
*
o
+
c
*
i
*
o
+
d
*
f
*
r
-
c
*
h
*
r
;
this
.
n21
=
i
*
o
*
n
-
h
*
r
*
n
-
i
*
m
*
l
+
g
*
r
*
l
+
h
*
m
*
p
-
g
*
o
*
p
;
this
.
n22
=
d
*
r
*
n
-
e
*
o
*
n
+
e
*
m
*
l
-
b
*
r
*
l
-
d
*
m
*
p
+
b
*
o
*
p
;
this
.
n23
=
e
*
h
*
n
-
d
*
i
*
n
-
e
*
g
*
l
+
b
*
i
*
l
+
d
*
g
*
p
-
b
*
h
*
p
;
this
.
n24
=
d
*
i
*
m
-
e
*
h
*
m
+
e
*
g
*
o
-
b
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*
r
*
n
-
e
*
m
*
q
+
b
*
r
*
q
+
c
*
m
*
p
-
b
*
k
*
p
;
this
.
n33
=
c
*
i
*
n
-
e
*
f
*
n
+
e
*
g
*
q
-
b
*
i
*
q
-
c
*
g
*
p
+
b
*
f
*
p
;
this
.
n34
=
e
*
f
*
m
-
c
*
i
*
m
-
e
*
g
*
k
+
b
*
i
*
k
+
c
*
g
*
r
-
b
*
f
*
r
;
this
.
n41
=
h
*
k
*
n
-
f
*
o
*
n
-
h
*
m
*
q
+
g
*
o
*
q
+
f
*
m
*
l
-
g
*
k
*
l
;
this
.
n42
=
c
*
o
*
n
-
d
*
k
*
n
+
d
*
m
*
q
-
b
*
o
*
q
-
c
*
m
*
l
+
b
*
k
*
l
;
this
.
n43
=
d
*
f
*
n
-
c
*
h
*
n
-
d
*
g
*
q
+
b
*
h
*
q
+
c
*
g
*
l
-
b
*
f
*
l
;
this
.
n44
=
c
*
h
*
m
-
d
*
f
*
m
+
d
*
g
*
k
-
b
*
h
*
k
-
c
*
g
*
o
+
b
*
f
*
o
;
this
.
multiplyScalar
(
1
/
a
.
determinant
());
return
this
},
setRotationFromEuler
:
function
(
a
,
b
){
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
g
=
Math
.
cos
(
c
),
c
=
Math
.
sin
(
c
),
f
=
Math
.
cos
(
d
),
d
=
Math
.
sin
(
d
),
h
=
Math
.
cos
(
e
),
e
=
Math
.
sin
(
e
);
switch
(
b
){
case
"
YXZ
"
:
var
i
=
f
*
h
,
m
=
f
*
e
,
k
=
d
*
h
,
o
=
d
*
e
;
this
.
n11
=
i
+
o
*
c
;
this
.
n12
=
k
*
c
-
m
;
this
.
n13
=
g
*
d
;
this
.
n21
=
g
*
e
;
this
.
n22
=
g
*
h
;
this
.
n23
=-
c
;
this
.
n31
=
m
*
c
-
k
;
this
.
n32
=
o
+
i
*
c
;
this
.
n33
=
g
*
f
;
break
;
case
"
ZXY
"
:
i
=
f
*
h
;
m
=
f
*
e
;
k
=
d
*
h
;
o
=
d
*
e
;
this
.
n11
=
i
-
o
*
c
;
this
.
n12
=-
g
*
e
;
this
.
n13
=
k
+
m
*
c
;
this
.
n21
=
m
+
k
*
c
;
this
.
n22
=
g
*
h
;
this
.
n23
=
o
-
i
*
c
;
this
.
n31
=-
g
*
d
;
this
.
n32
=
c
;
this
.
n33
=
g
*
f
;
break
;
case
"
ZYX
"
:
i
=
g
*
h
;
m
=
g
*
e
;
k
=
c
*
h
;
o
=
c
*
e
;
this
.
n11
=
f
*
h
;
this
.
n12
=
k
*
d
-
m
;
this
.
n13
=
i
*
d
+
o
;
this
.
n21
=
f
*
e
;
this
.
n22
=
o
*
d
+
i
;
this
.
n23
=
m
*
d
-
k
;
this
.
n31
=-
d
;
this
.
n32
=
c
*
f
;
this
.
n33
=
g
*
f
;
break
;
case
"
YZX
"
:
i
=
g
*
f
;
m
=
g
*
d
;
k
=
c
*
f
;
o
=
c
*
d
;
this
.
n11
=
f
*
h
;
this
.
n12
=
o
-
i
*
e
;
this
.
n13
=
k
*
e
+
m
;
this
.
n21
=
e
;
this
.
n22
=
g
*
h
;
this
.
n23
=-
c
*
h
;
this
.
n31
=-
d
*
h
;
this
.
n32
=
m
*
e
+
k
;
this
.
n33
=
i
-
o
*
e
;
break
;
case
"
XZY
"
:
i
=
g
*
f
;
m
=
g
*
d
;
k
=
c
*
f
;
o
=
c
*
d
;
this
.
n11
=
f
*
h
;
this
.
n12
=-
e
;
this
.
n13
=
d
*
h
;
this
.
n21
=
i
*
e
+
o
;
this
.
n22
=
g
*
h
;
this
.
n23
=
m
*
e
-
k
;
this
.
n31
=
k
*
e
-
m
;
this
.
n32
=
c
*
h
;
this
.
n33
=
o
*
e
+
i
;
break
;
default
:
i
=
g
*
h
,
m
=
g
*
e
,
k
=
c
*
h
,
o
=
c
*
e
,
this
.
n11
=
f
*
h
,
this
.
n12
=-
f
*
e
,
this
.
n13
=
d
,
this
.
n21
=
m
+
k
*
d
,
this
.
n22
=
i
-
o
*
d
,
this
.
n23
=-
c
*
f
,
this
.
n31
=
o
-
i
*
d
,
this
.
n32
=
k
+
m
*
d
,
this
.
n33
=
g
*
f
}
return
this
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
a
.
w
,
g
=
b
+
b
,
f
=
c
+
c
,
h
=
d
+
d
,
a
=
b
*
g
,
i
=
b
*
f
;
b
*=
h
;
var
m
=
c
*
f
;
c
*=
h
;
d
*=
h
;
g
*=
e
;
f
*=
e
;
e
*=
h
;
this
.
n11
=
1
-
(
m
+
d
);
this
.
n12
=
i
-
e
;
this
.
n13
=
b
+
f
;
this
.
n21
=
i
+
e
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
g
;
this
.
n31
=
b
-
f
;
this
.
n32
=
c
+
g
;
this
.
n33
=
1
-
(
a
+
m
);
return
this
},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
...
...
build/custom/ThreeCanvas.js
浏览文件 @
10052662
...
...
@@ -32,13 +32,13 @@ O+k*D+r*N+K*I;this.n44=q*v+k*t+r*aa+K*G;return this},multiplySelf:function(a){re
this
.
n23
*=
a
;
this
.
n24
*=
a
;
this
.
n31
*=
a
;
this
.
n32
*=
a
;
this
.
n33
*=
a
;
this
.
n34
*=
a
;
this
.
n41
*=
a
;
this
.
n42
*=
a
;
this
.
n43
*=
a
;
this
.
n44
*=
a
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
f
;
a
.
y
=
(
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
)
*
f
;
a
.
z
=
(
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
)
*
f
;
return
a
},
multiplyVector4
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
a
.
w
;
a
.
x
=
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
*
f
;
a
.
y
=
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
*
f
;
a
.
z
=
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
*
f
;
a
.
w
=
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
*
f
;
return
a
},
rotateAxis
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
.
x
=
b
*
this
.
n11
+
c
*
this
.
n12
+
d
*
this
.
n13
;
a
.
y
=
b
*
this
.
n21
+
c
*
this
.
n22
+
d
*
this
.
n23
;
a
.
z
=
b
*
this
.
n31
+
c
*
this
.
n32
+
d
*
this
.
n33
;
a
.
normalize
();
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
f
=
this
.
n21
,
e
=
this
.
n22
,
g
=
this
.
n23
,
h
=
this
.
n24
,
m
=
this
.
n31
,
l
=
this
.
n32
,
j
=
this
.
n33
,
i
=
this
.
n34
,
n
=
this
.
n41
,
o
=
this
.
n42
,
q
=
this
.
n43
,
k
=
this
.
n44
;
return
d
*
g
*
l
*
n
-
c
*
h
*
l
*
n
-
d
*
e
*
j
*
n
+
b
*
h
*
j
*
n
+
c
*
e
*
i
*
n
-
b
*
g
*
i
*
n
-
d
*
g
*
m
*
o
+
c
*
h
*
m
*
o
+
d
*
f
*
j
*
o
-
a
*
h
*
j
*
o
-
c
*
f
*
i
*
o
+
a
*
g
*
i
*
o
+
d
*
e
*
m
*
q
-
b
*
h
*
m
*
q
-
d
*
f
*
l
*
q
+
a
*
h
*
l
*
q
+
b
*
f
*
i
*
q
-
a
*
e
*
i
*
q
-
c
*
e
*
m
*
k
+
b
*
g
*
m
*
k
+
c
*
f
*
l
*
k
-
a
*
g
*
l
*
k
-
b
*
f
*
j
*
k
+
a
*
e
*
j
*
k
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
k
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
.
n43
=
this
.
n43
;
a
.
n44
=
this
.
n44
;
return
a
},
flatten
:
function
(){
this
.
flat
[
0
]
=
this
.
n11
;
this
.
flat
[
1
]
=
this
.
n21
;
this
.
flat
[
2
]
=
this
.
n31
;
this
.
flat
[
3
]
=
this
.
n41
;
this
.
flat
[
4
]
=
this
.
n12
;
this
.
flat
[
5
]
=
this
.
n22
;
this
.
flat
[
6
]
=
this
.
n32
;
this
.
flat
[
7
]
=
this
.
n42
;
this
.
flat
[
8
]
=
this
.
n13
;
this
.
flat
[
9
]
=
this
.
n23
;
this
.
flat
[
10
]
=
this
.
n33
;
this
.
flat
[
11
]
=
this
.
n43
;
this
.
flat
[
12
]
=
this
.
n14
;
this
.
flat
[
13
]
=
this
.
n24
;
this
.
flat
[
14
]
=
this
.
n34
;
this
.
flat
[
15
]
=
this
.
n44
;
return
this
.
flat
},
flattenToArray
:
function
(
a
){
a
[
0
]
=
this
.
n11
;
a
[
1
]
=
this
.
n21
;
a
[
2
]
=
this
.
n31
;
a
[
3
]
=
this
.
n41
;
a
[
4
]
=
this
.
n12
;
a
[
5
]
=
this
.
n22
;
a
[
6
]
=
this
.
n32
;
a
[
7
]
=
this
.
n42
;
a
[
8
]
=
this
.
n13
;
a
[
9
]
=
this
.
n23
;
a
[
10
]
=
this
.
n33
;
a
[
11
]
=
this
.
n43
;
a
[
12
]
=
this
.
n14
;
a
[
13
]
=
this
.
n24
;
a
[
14
]
=
this
.
n34
;
a
[
15
]
=
this
.
n44
;
return
a
},
flattenToArrayOffset
:
function
(
a
,
b
){
a
[
b
]
=
this
.
n11
;
a
[
b
+
1
]
=
this
.
n21
;
a
[
b
+
2
]
=
this
.
n31
;
a
[
b
+
3
]
=
this
.
n41
;
a
[
b
+
4
]
=
this
.
n12
;
a
[
b
+
5
]
=
this
.
n22
;
a
[
b
+
6
]
=
this
.
n32
;
a
[
b
+
7
]
=
this
.
n42
;
a
[
b
+
8
]
=
this
.
n13
;
a
[
b
+
9
]
=
this
.
n23
;
a
[
b
+
10
]
=
this
.
n33
;
a
[
b
+
11
]
=
this
.
n43
;
a
[
b
+
12
]
=
this
.
n14
;
a
[
b
+
13
]
=
this
.
n24
;
a
[
b
+
14
]
=
this
.
n34
;
a
[
b
+
15
]
=
this
.
n44
;
return
a
},
setTranslation
:
function
(
a
,
b
,
c
){
this
.
set
(
1
,
0
,
0
,
a
,
0
,
1
,
0
,
b
,
0
,
0
,
1
,
c
,
0
,
0
,
0
,
1
);
return
this
},
setScale
:
function
(
a
,
b
,
c
){
this
.
set
(
a
,
0
,
0
,
0
,
0
,
b
,
0
,
0
,
0
,
0
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationX
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
1
,
0
,
0
,
0
,
0
,
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationY
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
0
,
a
,
0
,
0
,
1
,
0
,
0
,
-
a
,
0
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationZ
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
f
=
1
-
c
,
e
=
a
.
x
,
g
=
a
.
y
,
h
=
a
.
z
,
m
=
f
*
e
,
l
=
f
*
g
;
this
.
set
(
m
*
e
+
c
,
m
*
g
-
d
*
h
,
m
*
h
+
d
*
g
,
0
,
m
*
g
+
d
*
h
,
l
*
g
+
c
,
l
*
h
-
d
*
e
,
0
,
m
*
h
-
d
*
g
,
l
*
h
+
d
*
e
,
f
*
h
*
h
+
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setPosition
:
function
(
a
){
this
.
n14
=
a
.
x
;
this
.
n24
=
a
.
y
;
this
.
n34
=
a
.
z
;
return
this
},
getPosition
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n14
,
this
.
n24
,
this
.
n34
)},
getColumnX
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n11
,
this
.
n21
,
this
.
n31
)},
getColumnY
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n12
,
this
.
n22
,
this
.
n32
)},
getColumnZ
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n13
,
this
.
n23
,
this
.
n33
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+
b
*
m
*
j
+
c
*
e
*
n
-
b
*
g
*
n
;
this
.
n41
=
h
*
j
*
o
-
g
*
i
*
o
-
h
*
l
*
q
+
e
*
i
*
q
+
g
*
l
*
k
-
e
*
j
*
k
;
this
.
n42
=
c
*
i
*
o
-
d
*
j
*
o
+
d
*
l
*
q
-
b
*
i
*
q
-
c
*
l
*
k
+
b
*
j
*
k
;
this
.
n43
=
d
*
g
*
o
-
c
*
h
*
o
-
d
*
e
*
q
+
b
*
h
*
q
+
c
*
e
*
k
-
b
*
g
*
k
;
this
.
n44
=
c
*
h
*
l
-
d
*
g
*
l
+
d
*
e
*
j
-
b
*
h
*
j
-
c
*
e
*
i
+
b
*
g
*
i
;
this
.
multiplyScalar
(
1
/
a
.
determinant
());
return
this
},
setRotationFromEuler
:
function
(
a
,
b
){
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
,
e
=
Math
.
cos
(
c
),
c
=
Math
.
sin
(
c
),
g
=
Math
.
cos
(
d
),
d
=
Math
.
sin
(
d
),
h
=
Math
.
cos
(
f
),
f
=
Math
.
sin
(
f
);
switch
(
b
){
case
"
YXZ
"
:
var
m
=
g
*
h
,
l
=
g
*
f
,
j
=
d
*
h
,
i
=
d
*
f
;
this
.
n11
=
m
+
i
*
c
;
this
.
n12
=
j
*
c
-
l
;
this
.
n13
=
e
*
d
;
this
.
n21
=
e
*
f
;
this
.
n22
=
e
*
h
;
this
.
n23
=-
c
;
this
.
n31
=
l
*
c
-
j
;
this
.
n32
=
i
+
m
*
c
;
this
.
n33
=
e
*
g
;
break
;
case
"
ZXY
"
:
m
=
g
*
h
;
l
=
g
*
f
;
j
=
d
*
h
;
i
=
d
*
f
;
this
.
n11
=
m
-
i
*
c
;
this
.
n12
=-
e
*
f
;
this
.
n13
=
j
+
l
*
c
;
this
.
n21
=
l
+
j
*
c
;
this
.
n22
=
e
*
h
;
this
.
n23
=
i
-
m
*
c
;
this
.
n31
=-
e
*
d
;
this
.
n32
=
c
;
this
.
n33
=
e
*
g
;
break
;
case
"
ZYX
"
:
m
=
e
*
h
;
l
=
e
*
f
;
j
=
c
*
h
;
i
=
c
*
f
;
this
.
n11
=
g
*
h
;
this
.
n12
=
j
*
d
-
l
;
this
.
n13
=
m
*
d
+
i
;
this
.
n21
=
g
*
f
;
this
.
n22
=
i
*
d
+
m
;
this
.
n23
=
l
*
d
-
j
;
this
.
n31
=-
d
;
this
.
n32
=
c
*
g
;
this
.
n33
=
e
*
g
;
break
;
case
"
YZX
"
:
m
=
e
*
g
;
l
=
e
*
d
;
j
=
c
*
g
;
i
=
c
*
d
;
this
.
n11
=
g
*
h
;
this
.
n12
=
i
-
m
*
f
;
this
.
n13
=
j
*
f
+
l
;
this
.
n21
=
f
;
this
.
n22
=
e
*
h
;
this
.
n23
=-
c
*
h
;
this
.
n31
=-
d
*
h
;
this
.
n32
=
l
*
f
+
j
;
this
.
n33
=
m
-
i
*
f
;
break
;
case
"
XZY
"
:
m
=
e
*
g
;
l
=
e
*
d
;
j
=
c
*
g
;
i
=
c
*
d
;
this
.
n11
=
g
*
h
;
this
.
n12
=-
f
;
this
.
n13
=
d
*
h
;
this
.
n21
=
m
*
f
+
i
;
this
.
n22
=
e
*
h
;
this
.
n23
=
l
*
f
-
j
;
this
.
n31
=
j
*
f
-
l
;
this
.
n32
=
c
*
h
;
this
.
n33
=
i
*
f
+
m
;
break
;
default
:
m
=
e
*
h
,
l
=
e
*
f
,
j
=
c
*
h
,
i
=
c
*
f
,
this
.
n11
=
g
*
h
,
this
.
n12
=-
g
*
f
,
this
.
n13
=
d
,
this
.
n21
=
l
+
j
*
d
,
this
.
n22
=
m
-
i
*
d
,
this
.
n23
=-
c
*
g
,
this
.
n31
=
i
-
m
*
d
,
this
.
n32
=
j
+
l
*
d
,
this
.
n33
=
e
*
g
}
return
this
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
a
.
w
,
e
=
b
+
b
,
g
=
c
+
c
,
h
=
d
+
d
,
a
=
b
*
e
,
m
=
b
*
g
;
b
*=
h
;
var
l
=
c
*
g
;
c
*=
h
;
d
*=
h
;
e
*=
f
;
g
*=
f
;
f
*=
h
;
this
.
n11
=
1
-
(
l
+
d
);
this
.
n12
=
m
-
f
;
this
.
n13
=
b
+
g
;
this
.
n21
=
m
+
f
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
e
;
this
.
n31
=
b
-
g
;
this
.
n32
=
c
+
e
;
this
.
n33
=
1
-
(
a
+
l
);
return
this
},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
...
...
build/custom/ThreeDOM.js
浏览文件 @
10052662
...
...
@@ -32,13 +32,13 @@ w+q*G+H*K;this.n44=p*s+o*M+q*N+H*S;return this},multiplySelf:function(a){return
a
;
this
.
n24
*=
a
;
this
.
n31
*=
a
;
this
.
n32
*=
a
;
this
.
n33
*=
a
;
this
.
n34
*=
a
;
this
.
n41
*=
a
;
this
.
n42
*=
a
;
this
.
n43
*=
a
;
this
.
n44
*=
a
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
e
;
a
.
y
=
(
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
)
*
e
;
a
.
z
=
(
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
)
*
e
;
return
a
},
multiplyVector4
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
a
.
w
;
a
.
x
=
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
*
e
;
a
.
y
=
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
*
e
;
a
.
z
=
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
*
e
;
a
.
w
=
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
*
e
;
return
a
},
rotateAxis
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
.
x
=
b
*
this
.
n11
+
c
*
this
.
n12
+
d
*
this
.
n13
;
a
.
y
=
b
*
this
.
n21
+
c
*
this
.
n22
+
d
*
this
.
n23
;
a
.
z
=
b
*
this
.
n31
+
c
*
this
.
n32
+
d
*
this
.
n33
;
a
.
normalize
();
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
e
=
this
.
n21
,
f
=
this
.
n22
,
g
=
this
.
n23
,
h
=
this
.
n24
,
k
=
this
.
n31
,
m
=
this
.
n32
,
j
=
this
.
n33
,
i
=
this
.
n34
,
l
=
this
.
n41
,
n
=
this
.
n42
,
p
=
this
.
n43
,
o
=
this
.
n44
;
return
d
*
g
*
m
*
l
-
c
*
h
*
m
*
l
-
d
*
f
*
j
*
l
+
b
*
h
*
j
*
l
+
c
*
f
*
i
*
l
-
b
*
g
*
i
*
l
-
d
*
g
*
k
*
n
+
c
*
h
*
k
*
n
+
d
*
e
*
j
*
n
-
a
*
h
*
j
*
n
-
c
*
e
*
i
*
n
+
a
*
g
*
i
*
n
+
d
*
f
*
k
*
p
-
b
*
h
*
k
*
p
-
d
*
e
*
m
*
p
+
a
*
h
*
m
*
p
+
b
*
e
*
i
*
p
-
a
*
f
*
i
*
p
-
c
*
f
*
k
*
o
+
b
*
g
*
k
*
o
+
c
*
e
*
m
*
o
-
a
*
g
*
m
*
o
-
b
*
e
*
j
*
o
+
a
*
f
*
j
*
o
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
.
n43
=
this
.
n43
;
a
.
n44
=
this
.
n44
;
return
a
},
flatten
:
function
(){
this
.
flat
[
0
]
=
this
.
n11
;
this
.
flat
[
1
]
=
this
.
n21
;
this
.
flat
[
2
]
=
this
.
n31
;
this
.
flat
[
3
]
=
this
.
n41
;
this
.
flat
[
4
]
=
this
.
n12
;
this
.
flat
[
5
]
=
this
.
n22
;
this
.
flat
[
6
]
=
this
.
n32
;
this
.
flat
[
7
]
=
this
.
n42
;
this
.
flat
[
8
]
=
this
.
n13
;
this
.
flat
[
9
]
=
this
.
n23
;
this
.
flat
[
10
]
=
this
.
n33
;
this
.
flat
[
11
]
=
this
.
n43
;
this
.
flat
[
12
]
=
this
.
n14
;
this
.
flat
[
13
]
=
this
.
n24
;
this
.
flat
[
14
]
=
this
.
n34
;
this
.
flat
[
15
]
=
this
.
n44
;
return
this
.
flat
},
flattenToArray
:
function
(
a
){
a
[
0
]
=
this
.
n11
;
a
[
1
]
=
this
.
n21
;
a
[
2
]
=
this
.
n31
;
a
[
3
]
=
this
.
n41
;
a
[
4
]
=
this
.
n12
;
a
[
5
]
=
this
.
n22
;
a
[
6
]
=
this
.
n32
;
a
[
7
]
=
this
.
n42
;
a
[
8
]
=
this
.
n13
;
a
[
9
]
=
this
.
n23
;
a
[
10
]
=
this
.
n33
;
a
[
11
]
=
this
.
n43
;
a
[
12
]
=
this
.
n14
;
a
[
13
]
=
this
.
n24
;
a
[
14
]
=
this
.
n34
;
a
[
15
]
=
this
.
n44
;
return
a
},
flattenToArrayOffset
:
function
(
a
,
b
){
a
[
b
]
=
this
.
n11
;
a
[
b
+
1
]
=
this
.
n21
;
a
[
b
+
2
]
=
this
.
n31
;
a
[
b
+
3
]
=
this
.
n41
;
a
[
b
+
4
]
=
this
.
n12
;
a
[
b
+
5
]
=
this
.
n22
;
a
[
b
+
6
]
=
this
.
n32
;
a
[
b
+
7
]
=
this
.
n42
;
a
[
b
+
8
]
=
this
.
n13
;
a
[
b
+
9
]
=
this
.
n23
;
a
[
b
+
10
]
=
this
.
n33
;
a
[
b
+
11
]
=
this
.
n43
;
a
[
b
+
12
]
=
this
.
n14
;
a
[
b
+
13
]
=
this
.
n24
;
a
[
b
+
14
]
=
this
.
n34
;
a
[
b
+
15
]
=
this
.
n44
;
return
a
},
setTranslation
:
function
(
a
,
b
,
c
){
this
.
set
(
1
,
0
,
0
,
a
,
0
,
1
,
0
,
b
,
0
,
0
,
1
,
c
,
0
,
0
,
0
,
1
);
return
this
},
setScale
:
function
(
a
,
b
,
c
){
this
.
set
(
a
,
0
,
0
,
0
,
0
,
b
,
0
,
0
,
0
,
0
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationX
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
1
,
0
,
0
,
0
,
0
,
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationY
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
0
,
a
,
0
,
0
,
1
,
0
,
0
,
-
a
,
0
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationZ
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
e
=
1
-
c
,
f
=
a
.
x
,
g
=
a
.
y
,
h
=
a
.
z
,
k
=
e
*
f
,
m
=
e
*
g
;
this
.
set
(
k
*
f
+
c
,
k
*
g
-
d
*
h
,
k
*
h
+
d
*
g
,
0
,
k
*
g
+
d
*
h
,
m
*
g
+
c
,
m
*
h
-
d
*
f
,
0
,
k
*
h
-
d
*
g
,
m
*
h
+
d
*
f
,
e
*
h
*
h
+
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setPosition
:
function
(
a
){
this
.
n14
=
a
.
x
;
this
.
n24
=
a
.
y
;
this
.
n34
=
a
.
z
;
return
this
},
getPosition
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n14
,
this
.
n24
,
this
.
n34
)},
getColumnX
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n11
,
this
.
n21
,
this
.
n31
)},
getColumnY
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n12
,
this
.
n22
,
this
.
n32
)},
getColumnZ
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n13
,
this
.
n23
,
this
.
n33
)},
getInverse
:
function
(
a
){
var
b
=
a
.
n11
,
c
=
a
.
n12
,
d
=
a
.
n13
,
e
=
a
.
n14
,
f
=
a
.
n21
,
g
=
a
.
n22
,
h
=
a
.
n23
,
k
=
a
.
n24
,
m
=
a
.
n31
,
j
=
a
.
n32
,
i
=
a
.
n33
,
l
=
a
.
n34
,
n
=
a
.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
o
+
b
*
j
*
o
;
this
.
n43
=
d
*
g
*
n
-
c
*
h
*
n
-
d
*
f
*
p
+
b
*
h
*
p
+
c
*
f
*
o
-
b
*
g
*
o
;
this
.
n44
=
c
*
h
*
m
-
d
*
g
*
m
+
d
*
f
*
j
-
b
*
h
*
j
-
c
*
f
*
i
+
b
*
g
*
i
;
this
.
multiplyScalar
(
1
/
a
.
determinant
());
return
this
},
setRotationFromEuler
:
function
(
a
,
b
){
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
f
=
Math
.
cos
(
c
),
c
=
Math
.
sin
(
c
),
g
=
Math
.
cos
(
d
),
d
=
Math
.
sin
(
d
),
h
=
Math
.
cos
(
e
),
e
=
Math
.
sin
(
e
);
switch
(
b
){
case
"
YXZ
"
:
var
k
=
g
*
h
,
m
=
g
*
e
,
j
=
d
*
h
,
i
=
d
*
e
;
this
.
n11
=
k
+
i
*
c
;
this
.
n12
=
j
*
c
-
m
;
this
.
n13
=
f
*
d
;
this
.
n21
=
f
*
e
;
this
.
n22
=
f
*
h
;
this
.
n23
=-
c
;
this
.
n31
=
m
*
c
-
j
;
this
.
n32
=
i
+
k
*
c
;
this
.
n33
=
f
*
g
;
break
;
case
"
ZXY
"
:
k
=
g
*
h
;
m
=
g
*
e
;
j
=
d
*
h
;
i
=
d
*
e
;
this
.
n11
=
k
-
i
*
c
;
this
.
n12
=-
f
*
e
;
this
.
n13
=
j
+
m
*
c
;
this
.
n21
=
m
+
j
*
c
;
this
.
n22
=
f
*
h
;
this
.
n23
=
i
-
k
*
c
;
this
.
n31
=-
f
*
d
;
this
.
n32
=
c
;
this
.
n33
=
f
*
g
;
break
;
case
"
ZYX
"
:
k
=
f
*
h
;
m
=
f
*
e
;
j
=
c
*
h
;
i
=
c
*
e
;
this
.
n11
=
g
*
h
;
this
.
n12
=
j
*
d
-
m
;
this
.
n13
=
k
*
d
+
i
;
this
.
n21
=
g
*
e
;
this
.
n22
=
i
*
d
+
k
;
this
.
n23
=
m
*
d
-
j
;
this
.
n31
=-
d
;
this
.
n32
=
c
*
g
;
this
.
n33
=
f
*
g
;
break
;
case
"
YZX
"
:
k
=
f
*
g
;
m
=
f
*
d
;
j
=
c
*
g
;
i
=
c
*
d
;
this
.
n11
=
g
*
h
;
this
.
n12
=
i
-
k
*
e
;
this
.
n13
=
j
*
e
+
m
;
this
.
n21
=
e
;
this
.
n22
=
f
*
h
;
this
.
n23
=-
c
*
h
;
this
.
n31
=-
d
*
h
;
this
.
n32
=
m
*
e
+
j
;
this
.
n33
=
k
-
i
*
e
;
break
;
case
"
XZY
"
:
k
=
f
*
g
;
m
=
f
*
d
;
j
=
c
*
g
;
i
=
c
*
d
;
this
.
n11
=
g
*
h
;
this
.
n12
=-
e
;
this
.
n13
=
d
*
h
;
this
.
n21
=
k
*
e
+
i
;
this
.
n22
=
f
*
h
;
this
.
n23
=
m
*
e
-
j
;
this
.
n31
=
j
*
e
-
m
;
this
.
n32
=
c
*
h
;
this
.
n33
=
i
*
e
+
k
;
break
;
default
:
k
=
f
*
h
,
m
=
f
*
e
,
j
=
c
*
h
,
i
=
c
*
e
,
this
.
n11
=
g
*
h
,
this
.
n12
=-
g
*
e
,
this
.
n13
=
d
,
this
.
n21
=
m
+
j
*
d
,
this
.
n22
=
k
-
i
*
d
,
this
.
n23
=-
c
*
g
,
this
.
n31
=
i
-
k
*
d
,
this
.
n32
=
j
+
m
*
d
,
this
.
n33
=
f
*
g
}
return
this
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
a
.
w
,
f
=
b
+
b
,
g
=
c
+
c
,
h
=
d
+
d
,
a
=
b
*
f
,
k
=
b
*
g
;
b
*=
h
;
var
m
=
c
*
g
;
c
*=
h
;
d
*=
h
;
f
*=
e
;
g
*=
e
;
e
*=
h
;
this
.
n11
=
1
-
(
m
+
d
);
this
.
n12
=
k
-
e
;
this
.
n13
=
b
+
g
;
this
.
n21
=
k
+
e
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
f
;
this
.
n31
=
b
-
g
;
this
.
n32
=
c
+
f
;
this
.
n33
=
1
-
(
a
+
m
);
return
this
},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
...
...
build/custom/ThreeSVG.js
浏览文件 @
10052662
...
...
@@ -32,13 +32,13 @@ y+u*z+I*N;this.n44=o*t+p*G+u*L+I*S;return this},multiplySelf:function(a){return
a
;
this
.
n24
*=
a
;
this
.
n31
*=
a
;
this
.
n32
*=
a
;
this
.
n33
*=
a
;
this
.
n34
*=
a
;
this
.
n41
*=
a
;
this
.
n42
*=
a
;
this
.
n43
*=
a
;
this
.
n44
*=
a
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
f
;
a
.
y
=
(
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
)
*
f
;
a
.
z
=
(
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
)
*
f
;
return
a
},
multiplyVector4
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
a
.
w
;
a
.
x
=
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
*
f
;
a
.
y
=
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
*
f
;
a
.
z
=
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
*
f
;
a
.
w
=
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
*
f
;
return
a
},
rotateAxis
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
.
x
=
b
*
this
.
n11
+
c
*
this
.
n12
+
d
*
this
.
n13
;
a
.
y
=
b
*
this
.
n21
+
c
*
this
.
n22
+
d
*
this
.
n23
;
a
.
z
=
b
*
this
.
n31
+
c
*
this
.
n32
+
d
*
this
.
n33
;
a
.
normalize
();
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
f
=
this
.
n21
,
e
=
this
.
n22
,
g
=
this
.
n23
,
h
=
this
.
n24
,
l
=
this
.
n31
,
m
=
this
.
n32
,
i
=
this
.
n33
,
j
=
this
.
n34
,
n
=
this
.
n41
,
k
=
this
.
n42
,
o
=
this
.
n43
,
p
=
this
.
n44
;
return
d
*
g
*
m
*
n
-
c
*
h
*
m
*
n
-
d
*
e
*
i
*
n
+
b
*
h
*
i
*
n
+
c
*
e
*
j
*
n
-
b
*
g
*
j
*
n
-
d
*
g
*
l
*
k
+
c
*
h
*
l
*
k
+
d
*
f
*
i
*
k
-
a
*
h
*
i
*
k
-
c
*
f
*
j
*
k
+
a
*
g
*
j
*
k
+
d
*
e
*
l
*
o
-
b
*
h
*
l
*
o
-
d
*
f
*
m
*
o
+
a
*
h
*
m
*
o
+
b
*
f
*
j
*
o
-
a
*
e
*
j
*
o
-
c
*
e
*
l
*
p
+
b
*
g
*
l
*
p
+
c
*
f
*
m
*
p
-
a
*
g
*
m
*
p
-
b
*
f
*
i
*
p
+
a
*
e
*
i
*
p
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
.
n43
=
this
.
n43
;
a
.
n44
=
this
.
n44
;
return
a
},
flatten
:
function
(){
this
.
flat
[
0
]
=
this
.
n11
;
this
.
flat
[
1
]
=
this
.
n21
;
this
.
flat
[
2
]
=
this
.
n31
;
this
.
flat
[
3
]
=
this
.
n41
;
this
.
flat
[
4
]
=
this
.
n12
;
this
.
flat
[
5
]
=
this
.
n22
;
this
.
flat
[
6
]
=
this
.
n32
;
this
.
flat
[
7
]
=
this
.
n42
;
this
.
flat
[
8
]
=
this
.
n13
;
this
.
flat
[
9
]
=
this
.
n23
;
this
.
flat
[
10
]
=
this
.
n33
;
this
.
flat
[
11
]
=
this
.
n43
;
this
.
flat
[
12
]
=
this
.
n14
;
this
.
flat
[
13
]
=
this
.
n24
;
this
.
flat
[
14
]
=
this
.
n34
;
this
.
flat
[
15
]
=
this
.
n44
;
return
this
.
flat
},
flattenToArray
:
function
(
a
){
a
[
0
]
=
this
.
n11
;
a
[
1
]
=
this
.
n21
;
a
[
2
]
=
this
.
n31
;
a
[
3
]
=
this
.
n41
;
a
[
4
]
=
this
.
n12
;
a
[
5
]
=
this
.
n22
;
a
[
6
]
=
this
.
n32
;
a
[
7
]
=
this
.
n42
;
a
[
8
]
=
this
.
n13
;
a
[
9
]
=
this
.
n23
;
a
[
10
]
=
this
.
n33
;
a
[
11
]
=
this
.
n43
;
a
[
12
]
=
this
.
n14
;
a
[
13
]
=
this
.
n24
;
a
[
14
]
=
this
.
n34
;
a
[
15
]
=
this
.
n44
;
return
a
},
flattenToArrayOffset
:
function
(
a
,
b
){
a
[
b
]
=
this
.
n11
;
a
[
b
+
1
]
=
this
.
n21
;
a
[
b
+
2
]
=
this
.
n31
;
a
[
b
+
3
]
=
this
.
n41
;
a
[
b
+
4
]
=
this
.
n12
;
a
[
b
+
5
]
=
this
.
n22
;
a
[
b
+
6
]
=
this
.
n32
;
a
[
b
+
7
]
=
this
.
n42
;
a
[
b
+
8
]
=
this
.
n13
;
a
[
b
+
9
]
=
this
.
n23
;
a
[
b
+
10
]
=
this
.
n33
;
a
[
b
+
11
]
=
this
.
n43
;
a
[
b
+
12
]
=
this
.
n14
;
a
[
b
+
13
]
=
this
.
n24
;
a
[
b
+
14
]
=
this
.
n34
;
a
[
b
+
15
]
=
this
.
n44
;
return
a
},
setTranslation
:
function
(
a
,
b
,
c
){
this
.
set
(
1
,
0
,
0
,
a
,
0
,
1
,
0
,
b
,
0
,
0
,
1
,
c
,
0
,
0
,
0
,
1
);
return
this
},
setScale
:
function
(
a
,
b
,
c
){
this
.
set
(
a
,
0
,
0
,
0
,
0
,
b
,
0
,
0
,
0
,
0
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationX
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
1
,
0
,
0
,
0
,
0
,
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationY
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
0
,
a
,
0
,
0
,
1
,
0
,
0
,
-
a
,
0
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationZ
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
f
=
1
-
c
,
e
=
a
.
x
,
g
=
a
.
y
,
h
=
a
.
z
,
l
=
f
*
e
,
m
=
f
*
g
;
this
.
set
(
l
*
e
+
c
,
l
*
g
-
d
*
h
,
l
*
h
+
d
*
g
,
0
,
l
*
g
+
d
*
h
,
m
*
g
+
c
,
m
*
h
-
d
*
e
,
0
,
l
*
h
-
d
*
g
,
m
*
h
+
d
*
e
,
f
*
h
*
h
+
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setPosition
:
function
(
a
){
this
.
n14
=
a
.
x
;
this
.
n24
=
a
.
y
;
this
.
n34
=
a
.
z
;
return
this
},
getPosition
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n14
,
this
.
n24
,
this
.
n34
)},
getColumnX
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n11
,
this
.
n21
,
this
.
n31
)},
getColumnY
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n12
,
this
.
n22
,
this
.
n32
)},
getColumnZ
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n13
,
this
.
n23
,
this
.
n33
)},
getInverse
:
function
(
a
){
var
b
=
a
.
n11
,
c
=
a
.
n12
,
d
=
a
.
n13
,
f
=
a
.
n14
,
e
=
a
.
n21
,
g
=
a
.
n22
,
h
=
a
.
n23
,
l
=
a
.
n24
,
m
=
a
.
n31
,
i
=
a
.
n32
,
j
=
a
.
n33
,
n
=
a
.
n34
,
k
=
a
.
n41
,
o
=
a
.
n42
,
p
=
a
.
n43
,
u
=
a
.
n44
;
this
.
n11
=
h
*
n
*
o
-
l
*
j
*
o
+
l
*
i
*
p
-
g
*
n
*
p
-
h
*
i
*
u
+
g
*
j
*
u
;
this
.
n12
=
f
*
j
*
o
-
d
*
n
*
o
-
f
*
i
*
p
+
c
*
n
*
p
+
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multiplyScalar
(
1
/
a
.
determinant
());
return
this
},
setRotationFromEuler
:
function
(
a
,
b
){
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
,
e
=
Math
.
cos
(
c
),
c
=
Math
.
sin
(
c
),
g
=
Math
.
cos
(
d
),
d
=
Math
.
sin
(
d
),
h
=
Math
.
cos
(
f
),
f
=
Math
.
sin
(
f
);
switch
(
b
){
case
"
YXZ
"
:
var
l
=
g
*
h
,
m
=
g
*
f
,
i
=
d
*
h
,
j
=
d
*
f
;
this
.
n11
=
l
+
j
*
c
;
this
.
n12
=
i
*
c
-
m
;
this
.
n13
=
e
*
d
;
this
.
n21
=
e
*
f
;
this
.
n22
=
e
*
h
;
this
.
n23
=-
c
;
this
.
n31
=
m
*
c
-
i
;
this
.
n32
=
j
+
l
*
c
;
this
.
n33
=
e
*
g
;
break
;
case
"
ZXY
"
:
l
=
g
*
h
;
m
=
g
*
f
;
i
=
d
*
h
;
j
=
d
*
f
;
this
.
n11
=
l
-
j
*
c
;
this
.
n12
=-
e
*
f
;
this
.
n13
=
i
+
m
*
c
;
this
.
n21
=
m
+
i
*
c
;
this
.
n22
=
e
*
h
;
this
.
n23
=
j
-
l
*
c
;
this
.
n31
=-
e
*
d
;
this
.
n32
=
c
;
this
.
n33
=
e
*
g
;
break
;
case
"
ZYX
"
:
l
=
e
*
h
;
m
=
e
*
f
;
i
=
c
*
h
;
j
=
c
*
f
;
this
.
n11
=
g
*
h
;
this
.
n12
=
i
*
d
-
m
;
this
.
n13
=
l
*
d
+
j
;
this
.
n21
=
g
*
f
;
this
.
n22
=
j
*
d
+
l
;
this
.
n23
=
m
*
d
-
i
;
this
.
n31
=-
d
;
this
.
n32
=
c
*
g
;
this
.
n33
=
e
*
g
;
break
;
case
"
YZX
"
:
l
=
e
*
g
;
m
=
e
*
d
;
i
=
c
*
g
;
j
=
c
*
d
;
this
.
n11
=
g
*
h
;
this
.
n12
=
j
-
l
*
f
;
this
.
n13
=
i
*
f
+
m
;
this
.
n21
=
f
;
this
.
n22
=
e
*
h
;
this
.
n23
=-
c
*
h
;
this
.
n31
=-
d
*
h
;
this
.
n32
=
m
*
f
+
i
;
this
.
n33
=
l
-
j
*
f
;
break
;
case
"
XZY
"
:
l
=
e
*
g
;
m
=
e
*
d
;
i
=
c
*
g
;
j
=
c
*
d
;
this
.
n11
=
g
*
h
;
this
.
n12
=-
f
;
this
.
n13
=
d
*
h
;
this
.
n21
=
l
*
f
+
j
;
this
.
n22
=
e
*
h
;
this
.
n23
=
m
*
f
-
i
;
this
.
n31
=
i
*
f
-
m
;
this
.
n32
=
c
*
h
;
this
.
n33
=
j
*
f
+
l
;
break
;
default
:
l
=
e
*
h
,
m
=
e
*
f
,
i
=
c
*
h
,
j
=
c
*
f
,
this
.
n11
=
g
*
h
,
this
.
n12
=-
g
*
f
,
this
.
n13
=
d
,
this
.
n21
=
m
+
i
*
d
,
this
.
n22
=
l
-
j
*
d
,
this
.
n23
=-
c
*
g
,
this
.
n31
=
j
-
l
*
d
,
this
.
n32
=
i
+
m
*
d
,
this
.
n33
=
e
*
g
}
return
this
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
a
.
w
,
e
=
b
+
b
,
g
=
c
+
c
,
h
=
d
+
d
,
a
=
b
*
e
,
l
=
b
*
g
;
b
*=
h
;
var
m
=
c
*
g
;
c
*=
h
;
d
*=
h
;
e
*=
f
;
g
*=
f
;
f
*=
h
;
this
.
n11
=
1
-
(
m
+
d
);
this
.
n12
=
l
-
f
;
this
.
n13
=
b
+
g
;
this
.
n21
=
l
+
f
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
e
;
this
.
n31
=
b
-
g
;
this
.
n32
=
c
+
e
;
this
.
n33
=
1
-
(
a
+
m
);
return
this
},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
...
...
build/custom/ThreeWebGL.js
浏览文件 @
10052662
...
...
@@ -32,13 +32,13 @@ G*ia+u*H+K*wa+ta*ya;this.n43=G*ea+u*M+K*sa+ta*E;this.n44=G*D+u*oa+K*R+ta*e;retur
a
;
this
.
n21
*=
a
;
this
.
n22
*=
a
;
this
.
n23
*=
a
;
this
.
n24
*=
a
;
this
.
n31
*=
a
;
this
.
n32
*=
a
;
this
.
n33
*=
a
;
this
.
n34
*=
a
;
this
.
n41
*=
a
;
this
.
n42
*=
a
;
this
.
n43
*=
a
;
this
.
n44
*=
a
;
return
this
},
multiplyVector3
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
g
=
1
/
(
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
);
a
.
x
=
(
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
)
*
g
;
a
.
y
=
(
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
)
*
g
;
a
.
z
=
(
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
)
*
g
;
return
a
},
multiplyVector4
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
g
=
a
.
w
;
a
.
x
=
this
.
n11
*
b
+
this
.
n12
*
c
+
this
.
n13
*
d
+
this
.
n14
*
g
;
a
.
y
=
this
.
n21
*
b
+
this
.
n22
*
c
+
this
.
n23
*
d
+
this
.
n24
*
g
;
a
.
z
=
this
.
n31
*
b
+
this
.
n32
*
c
+
this
.
n33
*
d
+
this
.
n34
*
g
;
a
.
w
=
this
.
n41
*
b
+
this
.
n42
*
c
+
this
.
n43
*
d
+
this
.
n44
*
g
;
return
a
},
rotateAxis
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
.
x
=
b
*
this
.
n11
+
c
*
this
.
n12
+
d
*
this
.
n13
;
a
.
y
=
b
*
this
.
n21
+
c
*
this
.
n22
+
d
*
this
.
n23
;
a
.
z
=
b
*
this
.
n31
+
c
*
this
.
n32
+
d
*
this
.
n33
;
a
.
normalize
();
return
a
},
crossVector
:
function
(
a
){
var
b
=
new
THREE
.
Vector4
;
b
.
x
=
this
.
n11
*
a
.
x
+
this
.
n12
*
a
.
y
+
this
.
n13
*
a
.
z
+
this
.
n14
*
a
.
w
;
b
.
y
=
this
.
n21
*
a
.
x
+
this
.
n22
*
a
.
y
+
this
.
n23
*
a
.
z
+
this
.
n24
*
a
.
w
;
b
.
z
=
this
.
n31
*
a
.
x
+
this
.
n32
*
a
.
y
+
this
.
n33
*
a
.
z
+
this
.
n34
*
a
.
w
;
b
.
w
=
a
.
w
?
this
.
n41
*
a
.
x
+
this
.
n42
*
a
.
y
+
this
.
n43
*
a
.
z
+
this
.
n44
*
a
.
w
:
1
;
return
b
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
g
=
this
.
n21
,
f
=
this
.
n22
,
h
=
this
.
n23
,
i
=
this
.
n24
,
p
=
this
.
n31
,
q
=
this
.
n32
,
k
=
this
.
n33
,
n
=
this
.
n34
,
w
=
this
.
n41
,
x
=
this
.
n42
,
G
=
this
.
n43
,
u
=
this
.
n44
;
return
d
*
h
*
q
*
w
-
c
*
i
*
q
*
w
-
d
*
f
*
k
*
w
+
b
*
i
*
k
*
w
+
c
*
f
*
n
*
w
-
b
*
h
*
n
*
w
-
d
*
h
*
p
*
x
+
c
*
i
*
p
*
x
+
d
*
g
*
k
*
x
-
a
*
i
*
k
*
x
-
c
*
g
*
n
*
x
+
a
*
h
*
n
*
x
+
d
*
f
*
p
*
G
-
b
*
i
*
p
*
G
-
d
*
g
*
q
*
G
+
a
*
i
*
q
*
G
+
b
*
g
*
n
*
G
-
a
*
f
*
n
*
G
-
c
*
f
*
p
*
u
+
b
*
h
*
p
*
u
+
c
*
g
*
q
*
u
-
a
*
h
*
q
*
u
-
b
*
g
*
k
*
u
+
a
*
f
*
k
*
u
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
c
*
g
*
q
*
u
-
a
*
h
*
q
*
u
-
b
*
g
*
k
*
u
+
a
*
f
*
k
*
u
},
transpose
:
function
(){
var
a
;
a
=
this
.
n21
;
this
.
n21
=
this
.
n12
;
this
.
n12
=
a
;
a
=
this
.
n31
;
this
.
n31
=
this
.
n13
;
this
.
n13
=
a
;
a
=
this
.
n32
;
this
.
n32
=
this
.
n23
;
this
.
n23
=
a
;
a
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
a
;
a
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
a
;
a
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
a
;
return
this
},
clone
:
function
(){
var
a
=
new
THREE
.
Matrix4
;
a
.
n11
=
this
.
n11
;
a
.
n12
=
this
.
n12
;
a
.
n13
=
this
.
n13
;
a
.
n14
=
this
.
n14
;
a
.
n21
=
this
.
n21
;
a
.
n22
=
this
.
n22
;
a
.
n23
=
this
.
n23
;
a
.
n24
=
this
.
n24
;
a
.
n31
=
this
.
n31
;
a
.
n32
=
this
.
n32
;
a
.
n33
=
this
.
n33
;
a
.
n34
=
this
.
n34
;
a
.
n41
=
this
.
n41
;
a
.
n42
=
this
.
n42
;
a
.
n43
=
this
.
n43
;
a
.
n44
=
this
.
n44
;
return
a
},
flatten
:
function
(){
this
.
flat
[
0
]
=
this
.
n11
;
this
.
flat
[
1
]
=
this
.
n21
;
this
.
flat
[
2
]
=
this
.
n31
;
this
.
flat
[
3
]
=
this
.
n41
;
this
.
flat
[
4
]
=
this
.
n12
;
this
.
flat
[
5
]
=
this
.
n22
;
this
.
flat
[
6
]
=
this
.
n32
;
this
.
flat
[
7
]
=
this
.
n42
;
this
.
flat
[
8
]
=
this
.
n13
;
this
.
flat
[
9
]
=
this
.
n23
;
this
.
flat
[
10
]
=
this
.
n33
;
this
.
flat
[
11
]
=
this
.
n43
;
this
.
flat
[
12
]
=
this
.
n14
;
this
.
flat
[
13
]
=
this
.
n24
;
this
.
flat
[
14
]
=
this
.
n34
;
this
.
flat
[
15
]
=
this
.
n44
;
return
this
.
flat
},
flattenToArray
:
function
(
a
){
a
[
0
]
=
this
.
n11
;
a
[
1
]
=
this
.
n21
;
a
[
2
]
=
this
.
n31
;
a
[
3
]
=
this
.
n41
;
a
[
4
]
=
this
.
n12
;
a
[
5
]
=
this
.
n22
;
a
[
6
]
=
this
.
n32
;
a
[
7
]
=
this
.
n42
;
a
[
8
]
=
this
.
n13
;
a
[
9
]
=
this
.
n23
;
a
[
10
]
=
this
.
n33
;
a
[
11
]
=
this
.
n43
;
a
[
12
]
=
this
.
n14
;
a
[
13
]
=
this
.
n24
;
a
[
14
]
=
this
.
n34
;
a
[
15
]
=
this
.
n44
;
return
a
},
flattenToArrayOffset
:
function
(
a
,
b
){
a
[
b
]
=
this
.
n11
;
a
[
b
+
1
]
=
this
.
n21
;
a
[
b
+
2
]
=
this
.
n31
;
a
[
b
+
3
]
=
this
.
n41
;
a
[
b
+
4
]
=
this
.
n12
;
a
[
b
+
5
]
=
this
.
n22
;
a
[
b
+
6
]
=
this
.
n32
;
a
[
b
+
7
]
=
this
.
n42
;
a
[
b
+
8
]
=
this
.
n13
;
a
[
b
+
9
]
=
this
.
n23
;
a
[
b
+
10
]
=
this
.
n33
;
a
[
b
+
11
]
=
this
.
n43
;
a
[
b
+
12
]
=
this
.
n14
;
a
[
b
+
13
]
=
this
.
n24
;
a
[
b
+
14
]
=
this
.
n34
;
a
[
b
+
15
]
=
this
.
n44
;
return
a
},
setTranslation
:
function
(
a
,
b
,
c
){
this
.
set
(
1
,
0
,
0
,
a
,
0
,
1
,
0
,
b
,
0
,
0
,
1
,
c
,
0
,
0
,
0
,
1
);
return
this
},
setScale
:
function
(
a
,
b
,
c
){
this
.
set
(
a
,
0
,
0
,
0
,
0
,
b
,
0
,
0
,
0
,
0
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationX
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
1
,
0
,
0
,
0
,
0
,
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationY
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
0
,
a
,
0
,
0
,
1
,
0
,
0
,
-
a
,
0
,
b
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationZ
:
function
(
a
){
var
b
=
Math
.
cos
(
a
),
a
=
Math
.
sin
(
a
);
this
.
set
(
b
,
-
a
,
0
,
0
,
a
,
b
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotationAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
g
=
1
-
c
,
f
=
a
.
x
,
h
=
a
.
y
,
i
=
a
.
z
,
p
=
g
*
f
,
q
=
g
*
h
;
this
.
set
(
p
*
f
+
c
,
p
*
h
-
d
*
i
,
p
*
i
+
d
*
h
,
0
,
p
*
h
+
d
*
i
,
q
*
h
+
c
,
q
*
i
-
d
*
f
,
0
,
p
*
i
-
d
*
h
,
q
*
i
+
d
*
f
,
g
*
i
*
i
+
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setPosition
:
function
(
a
){
this
.
n14
=
a
.
x
;
this
.
n24
=
a
.
y
;
this
.
n34
=
a
.
z
;
return
this
},
getPosition
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n14
,
this
.
n24
,
this
.
n34
)},
getColumnX
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n11
,
this
.
n21
,
this
.
n31
)},
getColumnY
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n12
,
this
.
n22
,
this
.
n32
)},
getColumnZ
:
function
(){
return
THREE
.
Matrix4
.
__v1
.
set
(
this
.
n13
,
this
.
n23
,
this
.
n33
)},
getInverse
:
function
(
a
){
var
b
=
a
.
n11
,
c
=
a
.
n12
,
d
=
a
.
n13
,
g
=
a
.
n14
,
f
=
a
.
n21
,
h
=
a
.
n22
,
i
=
a
.
n23
,
p
=
a
.
n24
,
q
=
a
.
n31
,
k
=
a
.
n32
,
n
=
a
.
n33
,
w
=
a
.
n34
,
x
=
a
.
n41
,
G
=
a
.
n42
,
u
=
a
.
n43
,
K
=
a
.
n44
;
this
.
n11
=
i
*
w
*
G
-
p
*
n
*
G
+
p
*
k
*
u
-
h
*
w
*
u
-
i
*
k
*
K
+
h
*
n
*
K
;
this
.
n12
=
g
*
n
*
G
-
d
*
w
*
G
-
g
*
k
*
u
+
c
*
w
*
u
+
d
*
k
*
K
-
c
*
n
*
K
;
this
.
n13
=
d
*
p
*
G
-
g
*
i
*
G
+
g
*
h
*
u
-
c
*
p
*
u
-
d
*
h
*
K
+
c
*
i
*
K
;
this
.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-
c
*
f
*
n
+
b
*
h
*
n
;
this
.
multiplyScalar
(
1
/
a
.
determinant
());
g
*
q
*
u
-
b
*
w
*
u
-
d
*
q
*
K
+
b
*
n
*
K
;
this
.
n23
=
g
*
i
*
x
-
d
*
p
*
x
-
g
*
f
*
u
+
b
*
p
*
u
+
d
*
f
*
K
-
b
*
i
*
K
;
this
.
n24
=
d
*
p
*
q
-
g
*
i
*
q
+
g
*
f
*
n
-
b
*
p
*
n
-
d
*
f
*
w
+
b
*
i
*
w
;
this
.
n31
=
h
*
w
*
x
-
p
*
k
*
x
+
p
*
q
*
G
-
f
*
w
*
G
-
h
*
q
*
K
+
f
*
k
*
K
;
this
.
n32
=
g
*
k
*
x
-
c
*
w
*
x
-
g
*
q
*
G
+
b
*
w
*
G
+
c
*
q
*
K
-
b
*
k
*
K
;
this
.
n33
=
c
*
p
*
x
-
g
*
h
*
x
+
g
*
f
*
G
-
b
*
p
*
G
-
c
*
f
*
K
+
b
*
h
*
K
;
this
.
n34
=
g
*
h
*
q
-
c
*
p
*
q
-
g
*
f
*
k
+
b
*
p
*
k
+
c
*
f
*
w
-
b
*
h
*
w
;
this
.
n41
=
i
*
k
*
x
-
h
*
n
*
x
-
i
*
q
*
G
+
f
*
n
*
G
+
h
*
q
*
u
-
f
*
k
*
u
;
this
.
n42
=
c
*
n
*
x
-
d
*
k
*
x
+
d
*
q
*
G
-
b
*
n
*
G
-
c
*
q
*
u
+
b
*
k
*
u
;
this
.
n43
=
d
*
h
*
x
-
c
*
i
*
x
-
d
*
f
*
G
+
b
*
i
*
G
+
c
*
f
*
u
-
b
*
h
*
u
;
this
.
n44
=
c
*
i
*
q
-
d
*
h
*
q
+
d
*
f
*
k
-
b
*
i
*
k
-
c
*
f
*
n
+
b
*
h
*
n
;
this
.
multiplyScalar
(
1
/
a
.
determinant
());
return
this
},
setRotationFromEuler
:
function
(
a
,
b
){
var
c
=
a
.
x
,
d
=
a
.
y
,
g
=
a
.
z
,
f
=
Math
.
cos
(
c
),
c
=
Math
.
sin
(
c
),
h
=
Math
.
cos
(
d
),
d
=
Math
.
sin
(
d
),
i
=
Math
.
cos
(
g
),
g
=
Math
.
sin
(
g
);
switch
(
b
){
case
"
YXZ
"
:
var
p
=
h
*
i
,
q
=
h
*
g
,
k
=
d
*
i
,
n
=
d
*
g
;
this
.
n11
=
p
+
n
*
c
;
this
.
n12
=
k
*
c
-
q
;
this
.
n13
=
f
*
d
;
this
.
n21
=
f
*
g
;
this
.
n22
=
f
*
i
;
this
.
n23
=-
c
;
this
.
n31
=
q
*
c
-
k
;
this
.
n32
=
n
+
p
*
c
;
this
.
n33
=
f
*
h
;
break
;
case
"
ZXY
"
:
p
=
h
*
i
;
q
=
h
*
g
;
k
=
d
*
i
;
n
=
d
*
g
;
this
.
n11
=
p
-
n
*
c
;
this
.
n12
=-
f
*
g
;
this
.
n13
=
k
+
q
*
c
;
this
.
n21
=
q
+
k
*
c
;
this
.
n22
=
f
*
i
;
this
.
n23
=
n
-
p
*
c
;
this
.
n31
=-
f
*
d
;
this
.
n32
=
c
;
this
.
n33
=
f
*
h
;
break
;
case
"
ZYX
"
:
p
=
f
*
i
;
q
=
f
*
g
;
k
=
c
*
i
;
n
=
c
*
g
;
this
.
n11
=
h
*
i
;
this
.
n12
=
k
*
d
-
q
;
this
.
n13
=
p
*
d
+
n
;
this
.
n21
=
h
*
g
;
this
.
n22
=
n
*
d
+
p
;
this
.
n23
=
q
*
d
-
k
;
this
.
n31
=-
d
;
this
.
n32
=
c
*
h
;
this
.
n33
=
f
*
h
;
break
;
case
"
YZX
"
:
p
=
f
*
h
;
q
=
f
*
d
;
k
=
c
*
h
;
n
=
c
*
d
;
this
.
n11
=
h
*
i
;
this
.
n12
=
n
-
p
*
g
;
this
.
n13
=
k
*
g
+
q
;
this
.
n21
=
g
;
this
.
n22
=
f
*
i
;
this
.
n23
=-
c
*
i
;
this
.
n31
=-
d
*
i
;
this
.
n32
=
q
*
g
+
k
;
this
.
n33
=
p
-
n
*
g
;
break
;
case
"
XZY
"
:
p
=
f
*
h
;
q
=
f
*
d
;
k
=
c
*
h
;
n
=
c
*
d
;
this
.
n11
=
h
*
i
;
this
.
n12
=-
g
;
this
.
n13
=
d
*
i
;
this
.
n21
=
p
*
g
+
n
;
this
.
n22
=
f
*
i
;
this
.
n23
=
q
*
g
-
k
;
this
.
n31
=
k
*
g
-
q
;
this
.
n32
=
c
*
i
;
this
.
n33
=
n
*
g
+
p
;
break
;
default
:
p
=
f
*
i
,
q
=
f
*
g
,
k
=
c
*
i
,
n
=
c
*
g
,
this
.
n11
=
h
*
i
,
this
.
n12
=-
h
*
g
,
this
.
n13
=
d
,
this
.
n21
=
q
+
k
*
d
,
this
.
n22
=
p
-
n
*
d
,
this
.
n23
=-
c
*
h
,
this
.
n31
=
n
-
p
*
d
,
this
.
n32
=
k
+
q
*
d
,
this
.
n33
=
f
*
h
}
return
this
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
g
=
a
.
w
,
f
=
b
+
b
,
h
=
c
+
c
,
i
=
d
+
d
,
a
=
b
*
f
,
p
=
b
*
h
;
b
*=
i
;
var
q
=
c
*
h
;
c
*=
i
;
d
*=
i
;
f
*=
g
;
h
*=
g
;
g
*=
i
;
this
.
n11
=
1
-
(
q
+
d
);
this
.
n12
=
p
-
g
;
this
.
n13
=
b
+
h
;
this
.
n21
=
p
+
g
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
f
;
this
.
n31
=
b
-
h
;
this
.
n32
=
c
+
f
;
this
.
n33
=
1
-
(
a
+
q
);
return
this
},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
...
...
@@ -179,9 +179,9 @@ return!1}function h(a,b,c){var d,g,f,h,l=a.vertices;h=l.length;var I=a.colors,i=
1
]
=
g
.
g
,
n
[
f
+
2
]
=
g
.
b
;
if
(
p
){
I
=
0
;
for
(
i
=
p
.
length
;
I
<
i
;
I
++
)
if
(
l
=
p
[
I
],
l
.
boundTo
===
void
0
||
l
.
boundTo
===
"
vertices
"
)
if
(
f
=
0
,
g
=
l
.
value
.
length
,
l
.
size
===
1
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
j
[
d
][
1
],
l
.
array
[
d
]
=
l
.
value
[
h
];
else
if
(
l
.
size
===
2
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
j
[
d
][
1
],
h
=
l
.
value
[
h
],
l
.
array
[
f
]
=
h
.
x
,
l
.
array
[
f
+
1
]
=
h
.
y
,
f
+=
2
;
else
if
(
l
.
size
===
3
)
if
(
l
.
type
===
"
c
"
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
j
[
d
][
1
],
h
=
l
.
value
[
h
],
l
.
array
[
f
]
=
h
.
r
,
l
.
array
[
f
+
1
]
=
h
.
g
,
l
.
array
[
f
+
2
]
=
h
.
b
,
f
+=
3
;
else
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
j
[
d
][
1
],
h
=
l
.
value
[
h
],
l
.
array
[
f
]
=
h
.
x
,
l
.
array
[
f
+
1
]
=
h
.
y
,
l
.
array
[
f
+
2
]
=
h
.
z
,
f
+=
3
;
else
if
(
l
.
size
===
4
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
j
[
d
][
1
],
h
=
l
.
value
[
h
],
l
.
array
[
f
]
=
h
.
x
,
l
.
array
[
f
+
1
]
=
h
.
y
,
l
.
array
[
f
+
2
]
=
h
.
z
,
l
.
array
[
f
+
3
]
=
h
.
w
,
f
+=
4
}}
else
{
if
(
o
)
for
(
d
=
0
;
d
<
h
;
d
++
)
g
=
l
[
d
].
position
,
f
=
d
*
3
,
r
[
f
]
=
g
.
x
,
r
[
f
+
1
]
=
g
.
y
,
r
[
f
+
2
]
=
g
.
z
;
if
(
k
)
for
(
d
=
0
;
d
<
i
;
d
++
)
g
=
I
[
d
],
f
=
d
*
3
,
n
[
f
]
=
g
.
r
,
n
[
f
+
1
]
=
g
.
g
,
n
[
f
+
2
]
=
g
.
b
;
if
(
p
){
I
=
0
;
for
(
i
=
p
.
length
;
I
<
i
;
I
++
)
if
(
l
=
p
[
I
],
l
.
needsUpdate
&&
(
l
.
boundTo
===
void
0
||
l
.
boundTo
===
"
vertices
"
))
if
(
g
=
l
.
value
.
length
,
f
=
0
,
l
.
size
===
1
)
for
(
d
=
0
;
d
<
g
;
d
++
)
l
.
array
[
d
]
=
l
.
value
[
d
];
else
if
(
l
.
size
===
2
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
l
.
value
[
d
],
l
.
array
[
f
]
=
h
.
x
,
l
.
array
[
f
+
1
]
=
h
.
y
,
f
+=
2
;
else
if
(
l
.
size
===
3
)
if
(
l
.
type
===
"
c
"
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
l
.
value
[
d
],
l
.
array
[
f
]
=
h
.
r
,
l
.
array
[
f
+
1
]
=
h
.
g
,
l
.
array
[
f
+
2
]
=
h
.
b
,
f
+=
3
;
else
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
l
.
value
[
d
],
l
.
array
[
f
]
=
h
.
x
,
l
.
array
[
f
+
1
]
=
h
.
y
,
l
.
array
[
f
+
2
]
=
h
.
z
,
f
+=
3
;
else
if
(
l
.
size
===
4
)
for
(
d
=
0
;
d
<
g
;
d
++
)
h
=
l
.
value
[
d
],
l
.
array
[
f
]
=
h
.
x
,
l
.
array
[
f
+
1
]
=
h
.
y
,
l
.
array
[
f
+
2
]
=
h
.
z
,
l
.
array
[
f
+
3
]
=
h
.
w
,
f
+=
4
}}
if
(
o
||
c
.
sortParticles
)
e
.
bindBuffer
(
e
.
ARRAY_BUFFER
,
a
.
__webglVertexBuffer
),
e
.
bufferData
(
e
.
ARRAY_BUFFER
,
r
,
b
);
if
(
k
||
c
.
sortParticles
)
e
.
bindBuffer
(
e
.
ARRAY_BUFFER
,
a
.
__webglColorBuffer
),
e
.
bufferData
(
e
.
ARRAY_BUFFER
,
n
,
b
);
if
(
p
){
I
=
0
;
for
(
i
=
p
.
length
;
I
<
i
;
I
++
)
if
(
l
=
p
[
I
],
l
.
needsUpdate
||
c
.
sortParticles
)
e
.
bindBuffer
(
e
.
ARRAY_BUFFER
,
l
.
buffer
),
e
.
bufferData
(
e
.
ARRAY_BUFFER
,
l
.
array
,
b
)}}
function
i
(
a
,
b
){
return
b
.
z
-
a
.
z
}
function
p
(
a
,
b
,
e
,
c
,
d
,
f
,
g
,
h
){
var
i
,
n
,
r
,
k
;
b
?(
n
=
a
.
length
-
1
,
k
=
b
=-
1
):(
n
=
0
,
b
=
a
.
length
,
k
=
1
);
for
(
var
j
=
n
;
j
!==
b
;
j
+=
k
)
if
(
i
=
a
[
j
],
i
.
render
){
n
=
i
.
object
;
r
=
i
.
buffer
;
if
(
h
)
i
=
h
;
else
{
i
=
i
[
e
];
if
(
!
i
)
continue
;
g
&&
E
.
setBlending
(
i
.
blending
);
E
.
setDepthTest
(
i
.
depthTest
);
ta
(
i
.
depthWrite
);
O
(
i
.
polygonOffset
,
i
.
polygonOffsetFactor
,
i
.
polygonOffsetUnits
)}
E
.
setObjectFaces
(
n
);
E
.
renderBuffer
(
c
,
d
,
f
,
i
,
r
,
n
)}}
function
q
(
a
,
b
,
e
,
c
,
d
,
f
,
g
){
for
(
var
h
,
i
,
n
=
0
,
r
=
a
.
length
;
n
<
r
;
n
++
)
if
(
h
=
a
[
n
],
i
=
h
.
object
,
i
.
visible
){
if
(
g
)
h
=
g
;
else
{
h
=
h
[
b
];
if
(
!
h
)
continue
;
f
&&
E
.
setBlending
(
h
.
blending
);
E
.
setDepthTest
(
h
.
depthTest
);
ta
(
h
.
depthWrite
);
O
(
h
.
polygonOffset
,
h
.
polygonOffsetFactor
,
h
.
polygonOffsetUnits
)}
E
.
renderImmediateObject
(
e
,
c
,
d
,
h
,
i
)}}
function
k
(
a
,
b
,
e
){
a
.
push
({
buffer
:
b
,
object
:
e
,
opaque
:
null
,
transparent
:
null
})}
function
n
(
a
){
for
(
var
b
in
a
.
attributes
)
if
(
a
.
attributes
[
b
].
needsUpdate
)
return
!
0
;
return
!
1
}
function
w
(
a
){
for
(
var
b
in
a
.
attributes
)
a
.
attributes
[
b
].
needsUpdate
=!
1
}
function
x
(
a
,
b
){
for
(
var
e
=
a
.
length
-
1
;
e
>=
0
;
e
--
)
a
[
e
].
object
===
b
&&
a
.
splice
(
e
,
1
)}
function
G
(
a
,
b
){
for
(
var
e
=
a
.
length
-
1
;
e
>=
0
;
e
--
)
a
[
e
]
===
b
&&
a
.
splice
(
e
,
1
)}
function
u
(
a
,
b
,
c
,
d
,
f
){
d
.
program
||
E
.
initMaterial
(
d
,
b
,
c
,
f
);
if
(
d
.
morphTargets
&&!
f
.
__webglMorphTargetInfluences
){
f
.
__webglMorphTargetInfluences
=
new
Float32Array
(
E
.
maxMorphTargets
);
for
(
var
g
=
0
,
h
=
E
.
maxMorphTargets
;
g
<
h
;
g
++
)
f
.
__webglMorphTargetInfluences
[
g
]
=
0
}
var
l
=!
1
,
g
=
d
.
program
,
h
=
a
.
__webglColorBuffer
),
e
.
bufferData
(
e
.
ARRAY_BUFFER
,
n
,
b
);
if
(
p
){
I
=
0
;
for
(
i
=
p
.
length
;
I
<
i
;
I
++
)
if
(
l
=
p
[
I
],
l
.
needsUpdate
||
c
.
sortParticles
)
e
.
bindBuffer
(
e
.
ARRAY_BUFFER
,
l
.
buffer
),
e
.
bufferData
(
e
.
ARRAY_BUFFER
,
l
.
array
,
b
)}}
function
i
(
a
,
b
){
return
b
.
z
-
a
.
z
}
function
p
(
a
,
b
,
c
,
e
,
d
,
f
,
g
,
h
){
var
i
,
n
,
r
,
k
;
b
?(
n
=
a
.
length
-
1
,
k
=
b
=-
1
):(
n
=
0
,
b
=
a
.
length
,
k
=
1
);
for
(
var
j
=
n
;
j
!==
b
;
j
+=
k
)
if
(
i
=
a
[
j
],
i
.
render
){
n
=
i
.
object
;
r
=
i
.
buffer
;
if
(
h
)
i
=
h
;
else
{
i
=
i
[
c
];
if
(
!
i
)
continue
;
g
&&
E
.
setBlending
(
i
.
blending
);
E
.
setDepthTest
(
i
.
depthTest
);
ta
(
i
.
depthWrite
);
O
(
i
.
polygonOffset
,
i
.
polygonOffsetFactor
,
i
.
polygonOffsetUnits
)}
E
.
setObjectFaces
(
n
);
E
.
renderBuffer
(
e
,
d
,
f
,
i
,
r
,
n
)}}
function
q
(
a
,
b
,
c
,
e
,
d
,
f
,
g
){
for
(
var
h
,
i
,
n
=
0
,
r
=
a
.
length
;
n
<
r
;
n
++
)
if
(
h
=
a
[
n
],
i
=
h
.
object
,
i
.
visible
){
if
(
g
)
h
=
g
;
else
{
h
=
h
[
b
];
if
(
!
h
)
continue
;
f
&&
E
.
setBlending
(
h
.
blending
);
E
.
setDepthTest
(
h
.
depthTest
);
ta
(
h
.
depthWrite
);
O
(
h
.
polygonOffset
,
h
.
polygonOffsetFactor
,
h
.
polygonOffsetUnits
)}
E
.
renderImmediateObject
(
c
,
e
,
d
,
h
,
i
)}}
function
k
(
a
,
b
,
c
){
a
.
push
({
buffer
:
b
,
object
:
c
,
opaque
:
null
,
transparent
:
null
})}
function
n
(
a
){
for
(
var
b
in
a
.
attributes
)
if
(
a
.
attributes
[
b
].
needsUpdate
)
return
!
0
;
return
!
1
}
function
w
(
a
){
for
(
var
b
in
a
.
attributes
)
a
.
attributes
[
b
].
needsUpdate
=!
1
}
function
x
(
a
,
b
){
for
(
var
c
=
a
.
length
-
1
;
c
>=
0
;
c
--
)
a
[
c
].
object
===
b
&&
a
.
splice
(
c
,
1
)}
function
G
(
a
,
b
){
for
(
var
c
=
a
.
length
-
1
;
c
>=
0
;
c
--
)
a
[
c
]
===
b
&&
a
.
splice
(
c
,
1
)}
function
u
(
a
,
b
,
c
,
d
,
f
){
d
.
program
||
E
.
initMaterial
(
d
,
b
,
c
,
f
);
if
(
d
.
morphTargets
&&!
f
.
__webglMorphTargetInfluences
){
f
.
__webglMorphTargetInfluences
=
new
Float32Array
(
E
.
maxMorphTargets
);
for
(
var
g
=
0
,
h
=
E
.
maxMorphTargets
;
g
<
h
;
g
++
)
f
.
__webglMorphTargetInfluences
[
g
]
=
0
}
var
l
=!
1
,
g
=
d
.
program
,
h
=
g
.
uniforms
,
i
=
d
.
uniforms
;
g
!==
va
&&
(
e
.
useProgram
(
g
),
va
=
g
,
l
=!
0
);
if
(
d
.
id
!==
ua
)
ua
=
d
.
id
,
l
=!
0
;
if
(
l
){
e
.
uniformMatrix4fv
(
h
.
projectionMatrix
,
!
1
,
a
.
_projectionMatrixArray
);
if
(
c
&&
d
.
fog
)
if
(
i
.
fogColor
.
value
=
c
.
color
,
c
instanceof
THREE
.
Fog
)
i
.
fogNear
.
value
=
c
.
near
,
i
.
fogFar
.
value
=
c
.
far
;
else
if
(
c
instanceof
THREE
.
FogExp2
)
i
.
fogDensity
.
value
=
c
.
density
;
if
(
d
instanceof
THREE
.
MeshPhongMaterial
||
d
instanceof
THREE
.
MeshLambertMaterial
||
d
.
lights
){
for
(
var
n
,
r
,
k
=
0
,
j
=
0
,
o
=
0
,
p
,
q
,
w
,
x
=
La
,
u
=
x
.
directional
.
colors
,
G
=
x
.
directional
.
positions
,
t
=
x
.
point
.
colors
,
H
=
x
.
point
.
positions
,
K
=
x
.
point
.
distances
,
v
=
0
,
T
=
0
,
c
=
n
=
w
=
0
,
l
=
b
.
length
;
c
<
l
;
c
++
)
if
(
n
=
b
[
c
],
r
=
n
.
color
,
p
=
n
.
position
,
q
=
n
.
intensity
,
w
=
n
.
distance
,
n
instanceof
THREE
.
AmbientLight
)
E
.
gammaInput
?(
k
+=
r
.
r
*
r
.
r
,
j
+=
r
.
g
*
r
.
g
,
o
+=
r
.
b
*
r
.
b
):(
k
+=
r
.
r
,
j
+=
r
.
g
,
o
+=
r
.
b
);
else
if
(
n
instanceof
THREE
.
DirectionalLight
)
w
=
v
*
3
,
E
.
gammaInput
?(
u
[
w
]
=
r
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
=
T
;
x
.
directional
.
length
=
v
;
x
.
ambient
[
0
]
=
k
;
x
.
ambient
[
1
]
=
j
;
x
.
ambient
[
2
]
=
...
...
src/core/Matrix4.js
浏览文件 @
10052662
...
...
@@ -275,7 +275,7 @@ THREE.Matrix4.prototype = {
tmp
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
tmp
;
tmp
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
tmp
;
tmp
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
tmp
;
tmp
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
tmp
;
return
this
;
...
...
@@ -499,7 +499,7 @@ THREE.Matrix4.prototype = {
this
.
n24
=
n13
*
n24
*
n31
-
n14
*
n23
*
n31
+
n14
*
n21
*
n33
-
n11
*
n24
*
n33
-
n13
*
n21
*
n34
+
n11
*
n23
*
n34
;
this
.
n31
=
n22
*
n34
*
n41
-
n24
*
n32
*
n41
+
n24
*
n31
*
n42
-
n21
*
n34
*
n42
-
n22
*
n31
*
n44
+
n21
*
n32
*
n44
;
this
.
n32
=
n14
*
n32
*
n41
-
n12
*
n34
*
n41
-
n14
*
n31
*
n42
+
n11
*
n34
*
n42
+
n12
*
n31
*
n44
-
n11
*
n32
*
n44
;
this
.
n33
=
n1
3
*
n24
*
n41
-
n14
*
n22
*
n41
+
n14
*
n21
*
n42
-
n11
*
n24
*
n42
-
n12
*
n21
*
n44
+
n11
*
n22
*
n44
;
this
.
n33
=
n1
2
*
n24
*
n41
-
n14
*
n22
*
n41
+
n14
*
n21
*
n42
-
n11
*
n24
*
n42
-
n12
*
n21
*
n44
+
n11
*
n22
*
n44
;
this
.
n34
=
n14
*
n22
*
n31
-
n12
*
n24
*
n31
-
n14
*
n21
*
n32
+
n11
*
n24
*
n32
+
n12
*
n21
*
n34
-
n11
*
n22
*
n34
;
this
.
n41
=
n23
*
n32
*
n41
-
n22
*
n33
*
n41
-
n23
*
n31
*
n42
+
n21
*
n33
*
n42
+
n22
*
n31
*
n43
-
n21
*
n32
*
n43
;
this
.
n42
=
n12
*
n33
*
n41
-
n13
*
n32
*
n41
+
n13
*
n31
*
n42
-
n11
*
n33
*
n42
-
n12
*
n31
*
n43
+
n11
*
n32
*
n43
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录