Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
446834ba
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,发现更多精彩内容 >>
提交
446834ba
编写于
2月 26, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor fixes and improvements.
上级
d1aff495
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
50 addition
and
50 deletion
+50
-50
build/Three.js
build/Three.js
+5
-5
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+5
-5
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+5
-5
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+5
-5
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+4
-4
examples/webgl_sandbox.html
examples/webgl_sandbox.html
+1
-3
src/core/Matrix4.js
src/core/Matrix4.js
+1
-1
src/core/Object3D.js
src/core/Object3D.js
+2
-4
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+17
-17
src/renderers/WebGLRenderer2.js
src/renderers/WebGLRenderer2.js
+2
-0
src/scenes/Scene.js
src/scenes/Scene.js
+3
-1
未找到文件。
build/Three.js
浏览文件 @
446834ba
...
...
@@ -29,7 +29,7 @@ w*e+u*V+p*J+x*b;this.n41=A*H+G*da+v*S+a*$;this.n42=A*o+G*O+v*Z+a*ta;this.n43=A*M
w
=
this
.
n33
,
u
=
this
.
n34
,
p
=
this
.
n41
,
x
=
this
.
n42
,
A
=
this
.
n43
,
G
=
this
.
n44
,
v
=
a
.
n11
,
H
=
a
.
n21
,
o
=
a
.
n31
,
M
=
a
.
n12
,
e
=
a
.
n22
,
da
=
a
.
n32
,
O
=
a
.
n13
,
P
=
a
.
n23
,
V
=
a
.
n33
,
S
=
a
.
n14
,
Z
=
a
.
n24
;
a
=
a
.
n34
;
this
.
n11
=
b
*
v
+
c
*
H
+
d
*
o
;
this
.
n12
=
b
*
M
+
c
*
e
+
d
*
da
;
this
.
n13
=
b
*
O
+
c
*
P
+
d
*
V
;
this
.
n14
=
b
*
S
+
c
*
Z
+
d
*
a
+
f
;
this
.
n21
=
g
*
v
+
h
*
H
+
k
*
o
;
this
.
n22
=
g
*
M
+
h
*
e
+
k
*
da
;
this
.
n23
=
g
*
O
+
h
*
P
+
k
*
V
;
this
.
n24
=
g
*
S
+
h
*
Z
+
k
*
a
+
j
;
this
.
n31
=
m
*
v
+
n
*
H
+
w
*
o
;
this
.
n32
=
m
*
M
+
n
*
e
+
w
*
da
;
this
.
n33
=
m
*
O
+
n
*
P
+
w
*
V
;
this
.
n34
=
m
*
S
+
n
*
Z
+
w
*
a
+
u
;
this
.
n41
=
p
*
v
+
x
*
H
+
A
*
o
;
this
.
n42
=
p
*
M
+
x
*
e
+
A
*
da
;
this
.
n43
=
p
*
O
+
x
*
P
+
A
*
V
;
this
.
n44
=
p
*
S
+
x
*
Z
+
A
*
a
+
G
;
return
this
},
multiplyScalar
:
function
(
a
){
this
.
n11
*=
a
;
this
.
n12
*=
a
;
this
.
n13
*=
a
;
this
.
n14
*=
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
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
f
=
this
.
n21
,
g
=
this
.
n22
,
h
=
this
.
n23
,
k
=
this
.
n24
,
j
=
this
.
n31
,
m
=
this
.
n32
,
n
=
this
.
n33
,
w
=
this
.
n34
,
u
=
this
.
n41
,
p
=
this
.
n42
,
x
=
this
.
n43
,
A
=
this
.
n44
;
return
d
*
h
*
m
*
u
-
c
*
k
*
m
*
u
-
d
*
g
*
n
*
u
+
b
*
k
*
n
*
u
+
c
*
g
*
w
*
u
-
b
*
h
*
w
*
u
-
d
*
h
*
j
*
p
+
c
*
k
*
j
*
p
+
d
*
f
*
n
*
p
-
a
*
k
*
n
*
p
-
c
*
f
*
w
*
p
+
a
*
h
*
w
*
p
+
d
*
g
*
j
*
x
-
b
*
k
*
j
*
x
-
d
*
f
*
m
*
x
+
a
*
k
*
m
*
x
+
b
*
f
*
w
*
x
-
a
*
g
*
w
*
x
-
c
*
g
*
j
*
A
+
b
*
h
*
j
*
A
+
c
*
f
*
m
*
A
-
a
*
h
*
m
*
A
-
b
*
f
*
n
*
A
+
a
*
g
*
n
*
A
},
transpose
:
function
(){
function
a
(
b
,
c
,
d
){
var
f
=
b
[
c
];
b
[
c
]
=
b
[
d
];
b
[
d
]
=
f
}
a
(
this
,
"
n21
"
,
"
n12
"
);
a
(
this
,
"
n31
"
,
"
n13
"
);
a
(
this
,
"
n32
"
,
"
n23
"
);
a
(
this
,
"
n41
"
,
"
n14
"
);
a
(
this
,
"
n42
"
,
"
n24
"
);
a
(
this
,
"
n43
"
,
"
n34
"
);
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
.
flattenToArray
(
this
.
flat
);
return
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
,
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
.
flattenToArray
(
this
.
flat
);
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
},
setRotX
:
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
},
setRotY
:
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
},
setRotZ
:
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
},
setRotAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
f
=
1
-
c
,
g
=
a
.
x
,
h
=
a
.
y
,
k
=
a
.
z
,
j
=
f
*
g
,
m
=
f
*
h
;
this
.
set
(
j
*
g
+
c
,
j
*
h
-
d
*
k
,
j
*
k
+
d
*
h
,
0
,
j
*
h
+
d
*
k
,
m
*
h
+
c
,
m
*
k
-
d
*
g
,
0
,
j
*
k
-
d
*
h
,
m
*
k
+
d
*
g
,
f
*
k
*
k
+
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
},
setRotationFromEuler
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
=
Math
.
cos
(
b
);
b
=
Math
.
sin
(
b
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
var
h
=
a
*
c
,
k
=
b
*
c
;
this
.
n11
=
f
*
g
;
this
.
n12
=-
f
*
d
;
this
.
n13
=
c
;
this
.
n21
=
k
*
g
+
a
*
d
;
this
.
n22
=-
k
*
d
+
a
*
g
;
this
.
n23
=-
b
*
f
;
this
.
n31
=-
h
*
g
+
b
*
d
;
this
.
n32
=
h
*
d
+
b
*
g
;
this
.
n33
=
a
*
f
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
a
.
w
,
g
=
b
+
b
,
h
=
c
+
c
,
k
=
d
+
d
;
a
=
b
*
g
;
var
j
=
b
*
h
;
b
*=
k
;
var
m
=
c
*
h
;
c
*=
k
;
d
*=
k
;
g
*=
f
;
h
*=
f
;
f
*=
k
;
this
.
n11
=
1
-
(
m
+
d
);
this
.
n12
=
j
-
f
;
this
.
n13
=
...
...
@@ -43,9 +43,9 @@ THREE.Matrix4.makeFrustum=function(a,b,c,d,f,g){var h;h=new THREE.Matrix4;h.n11=
THREE
.
Matrix4
.
makeOrtho
=
function
(
a
,
b
,
c
,
d
,
f
,
g
){
var
h
,
k
,
j
,
m
;
h
=
new
THREE
.
Matrix4
;
k
=
b
-
a
;
j
=
c
-
d
;
m
=
g
-
f
;
h
.
n11
=
2
/
k
;
h
.
n12
=
0
;
h
.
n13
=
0
;
h
.
n14
=-
((
b
+
a
)
/
k
);
h
.
n21
=
0
;
h
.
n22
=
2
/
j
;
h
.
n23
=
0
;
h
.
n24
=-
((
c
+
d
)
/
j
);
h
.
n31
=
0
;
h
.
n32
=
0
;
h
.
n33
=-
2
/
m
;
h
.
n34
=-
((
g
+
f
)
/
m
);
h
.
n41
=
0
;
h
.
n42
=
0
;
h
.
n43
=
0
;
h
.
n44
=
1
;
return
h
};
THREE
.
Matrix4
.
__tmpVec1
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec2
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec3
=
new
THREE
.
Vector3
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
parent
=
undefined
;
this
.
children
=
[];
this
.
position
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
matrixWorld
=
new
THREE
.
Matrix4
;
this
.
matrixRotation
=
new
THREE
.
Matrix4
;
this
.
matrixRotationWorld
=
new
THREE
.
Matrix4
;
this
.
matrixNeedsUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
0
;
this
.
quaternion
=
new
THREE
.
Quaternion
;
this
.
useQuaternion
=!
1
;
this
.
boundRadius
=
0
;
this
.
boundRadiusScale
=
1
;
this
.
visible
=!
0
};
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
this
.
children
.
splice
(
b
,
1
);
a
.
parent
=
undefined
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
a
.
parent
=
undefined
;
this
.
children
.
splice
(
b
,
1
)
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
this
.
matrix
.
n12
=
this
.
matrixRotation
.
n12
;
this
.
matrix
.
n13
=
this
.
matrixRotation
.
n13
;
this
.
matrix
.
n21
=
this
.
matrixRotation
.
n21
;
this
.
matrix
.
n22
=
this
.
matrixRotation
.
n22
;
this
.
matrix
.
n23
=
this
.
matrixRotation
.
n23
;
this
.
matrix
.
n31
=
this
.
matrixRotation
.
n31
;
this
.
matrix
.
n32
=
this
.
matrixRotation
.
n32
;
this
.
matrix
.
n33
=
this
.
matrixRotation
.
n33
;
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
||
this
.
scale
.
z
!==
1
){
this
.
matrix
.
scale
(
this
.
scale
);
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
Math
.
max
(
this
.
scale
.
y
,
this
.
scale
.
z
))}
return
!
0
},
update
:
function
(
a
,
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
var
d
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Quaternion
=
function
(
a
,
b
,
c
,
d
){
this
.
set
(
a
||
0
,
b
||
0
,
c
||
0
,
d
!==
undefined
?
d
:
1
)};
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
a
=
0
;
for
(
var
d
=
this
.
children
.
length
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Quaternion
=
function
(
a
,
b
,
c
,
d
){
this
.
set
(
a
||
0
,
b
||
0
,
c
||
0
,
d
!==
undefined
?
d
:
1
)};
THREE
.
Quaternion
.
prototype
=
{
set
:
function
(
a
,
b
,
c
,
d
){
this
.
x
=
a
;
this
.
y
=
b
;
this
.
z
=
c
;
this
.
w
=
d
;
return
this
},
setFromEuler
:
function
(
a
){
var
b
=
0.5
*
Math
.
PI
/
360
,
c
=
a
.
x
*
b
,
d
=
a
.
y
*
b
,
f
=
a
.
z
*
b
;
a
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
b
=
Math
.
cos
(
-
f
);
f
=
Math
.
sin
(
-
f
);
var
g
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
h
=
a
*
b
,
k
=
d
*
f
;
this
.
w
=
h
*
g
-
k
*
c
;
this
.
x
=
h
*
c
+
k
*
g
;
this
.
y
=
d
*
b
*
g
+
a
*
f
*
c
;
this
.
z
=
a
*
f
*
g
-
d
*
b
*
c
;
return
this
},
calculateW
:
function
(){
this
.
w
=-
Math
.
sqrt
(
Math
.
abs
(
1
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
));
return
this
},
inverse
:
function
(){
this
.
x
*=-
1
;
this
.
y
*=
-
1
;
this
.
z
*=-
1
;
return
this
},
length
:
function
(){
return
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
)},
normalize
:
function
(){
var
a
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
if
(
a
==
0
)
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
;
else
{
a
=
1
/
a
;
this
.
x
*=
a
;
this
.
y
*=
a
;
this
.
z
*=
a
;
this
.
w
*=
a
}
return
this
},
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
f
=
this
.
w
,
g
=
a
.
x
,
h
=
a
.
y
,
k
=
a
.
z
;
a
=
a
.
w
;
this
.
x
=
b
*
a
+
f
*
g
+
c
*
k
-
d
*
h
;
this
.
y
=
c
*
a
+
f
*
h
+
d
*
g
-
b
*
k
;
this
.
z
=
d
*
a
+
f
*
k
+
b
*
h
-
c
*
g
;
this
.
w
=
f
*
a
-
b
*
g
-
c
*
h
-
d
*
k
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
,
g
=
this
.
x
,
h
=
this
.
y
,
k
=
this
.
z
,
j
=
this
.
w
,
m
=
j
*
c
+
h
*
f
-
k
*
d
,
n
=
j
*
d
+
k
*
c
-
g
*
f
,
w
=
j
*
f
+
g
*
d
-
h
*
c
;
c
=-
g
*
c
-
h
*
d
-
k
*
f
;
b
.
x
=
m
*
j
+
c
*-
g
+
n
*-
k
-
w
*-
h
;
b
.
y
=
n
*
j
+
c
*-
h
+
w
*-
g
-
m
*-
k
;
b
.
z
=
w
*
j
+
c
*-
k
+
m
*-
h
-
n
*-
g
;
return
b
}};
...
...
@@ -143,8 +143,8 @@ THREE.Sound3D=function(a,b,c,d){THREE.Object3D.call(this);this.isLoaded=!1;this.
-
1
)
f
=
"
audio/mpeg
"
;
else
if
(
b
.
indexOf
(
"
.ogg
"
)
!==-
1
)
f
=
"
audio/ogg
"
;
else
b
.
indexOf
(
"
.wav
"
)
!==-
1
&&
(
f
=
"
audio/wav
"
);
if
(
this
.
domElement
.
canPlayType
(
f
)){
f
=
document
.
createElement
(
"
source
"
);
f
.
src
=
this
.
sources
[
a
];
this
.
domElement
.
THREESound3D
=
this
;
this
.
domElement
.
appendChild
(
f
);
this
.
domElement
.
addEventListener
(
"
canplay
"
,
this
.
onLoad
,
!
0
);
this
.
domElement
.
load
();
break
}}};
THREE
.
Sound3D
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Sound3D
.
prototype
.
constructor
=
THREE
.
Sound3D
;
THREE
.
Sound3D
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Sound3D
.
prototype
.
onLoad
=
function
(){
var
a
=
this
.
THREESound3D
;
if
(
!
a
.
isLoaded
){
this
.
removeEventListener
(
"
canplay
"
,
this
.
onLoad
,
!
0
);
a
.
isLoaded
=!
0
;
a
.
duration
=
this
.
duration
;
a
.
isPlaying
&&
a
.
play
()}};
THREE
.
Sound3D
.
prototype
.
addToDOM
=
function
(
a
){
this
.
isAddedToDOM
=!
0
;
a
.
appendChild
(
this
.
domElement
)};
THREE
.
Sound3D
.
prototype
.
play
=
function
(
a
){
this
.
isPlaying
=!
0
;
if
(
this
.
isLoaded
){
this
.
domElement
.
play
();
if
(
a
)
this
.
domElement
.
currentTime
=
a
%
this
.
duration
}};
THREE
.
Sound3D
.
prototype
.
pause
=
function
(){
this
.
isPlaying
=!
1
;
this
.
domElement
.
pause
()};
THREE
.
Sound3D
.
prototype
.
stop
=
function
(){
this
.
isPlaying
=!
1
;
this
.
domElement
.
pause
();
this
.
domElement
.
currentTime
=
0
};
THREE
.
Sound3D
.
prototype
.
calculateVolumeAndPan
=
function
(
a
){
a
=
a
.
length
();
this
.
domElement
.
volume
=
a
<=
this
.
radius
?
this
.
volume
*
(
1
-
a
/
this
.
radius
):
0
};
THREE
.
Sound3D
.
prototype
.
update
=
function
(
a
,
b
,
c
){
if
(
this
.
matrixAutoUpdate
){
this
.
matrix
.
setPosition
(
this
.
position
);
b
=!
0
}
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
var
d
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)};
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Sound3D
.
prototype
.
update
=
function
(
a
,
b
,
c
){
if
(
this
.
matrixAutoUpdate
){
this
.
matrix
.
setPosition
(
this
.
position
);
b
=!
0
}
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
var
d
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)};
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
;
this
.
matrixAutoUpdate
=!
1
}
;
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
addChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
this
.
lights
.
indexOf
(
a
)
===-
1
&&
this
.
lights
.
push
(
a
);
else
if
(
a
instanceof
THREE
.
Sound3D
)
this
.
sounds
.
indexOf
(
a
)
===-
1
&&
this
.
sounds
.
push
(
a
);
else
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
||
this
.
objects
.
indexOf
(
a
)
===-
1
&&
this
.
objects
.
push
(
a
);
for
(
var
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
addChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
removeChild
=
function
(
a
){
this
.
supr
.
removeChild
.
call
(
this
,
a
);
this
.
removeChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
removeChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
lights
.
indexOf
(
a
);
b
!==-
1
&&
this
.
lights
.
splice
(
b
,
1
)}
else
if
(
a
instanceof
THREE
.
Sound3D
){
b
=
this
.
sounds
.
indexOf
(
a
);
b
!==-
1
&&
this
.
sounds
.
splice
(
b
,
1
)}
else
if
(
!
(
a
instanceof
THREE
.
Camera
)){
b
=
this
.
objects
.
indexOf
(
a
);
b
!==-
1
&&
this
.
objects
.
splice
(
b
,
1
)}
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
removeChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
addObject
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeObject
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Scene
.
prototype
.
addLight
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeLight
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Fog
=
function
(
a
,
b
,
c
){
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
near
=
b
||
1
;
this
.
far
=
c
||
1
E3
};
THREE
.
FogExp2
=
function
(
a
,
b
){
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
density
=
b
||
2.5
E
-
4
};
...
...
build/custom/ThreeCanvas.js
浏览文件 @
446834ba
...
...
@@ -29,8 +29,8 @@ t*D+r*N+k*u+a*B;this.n42=t*C+r*A+k*L+a*T;this.n43=t*I+r*w+k*E+a*x;this.n44=t*F+r
s
=
this
.
n42
,
t
=
this
.
n43
,
r
=
this
.
n44
,
k
=
a
.
n11
,
D
=
a
.
n21
,
C
=
a
.
n31
,
I
=
a
.
n12
,
F
=
a
.
n22
,
N
=
a
.
n32
,
A
=
a
.
n13
,
w
=
a
.
n23
,
K
=
a
.
n33
,
u
=
a
.
n14
,
L
=
a
.
n24
;
a
=
a
.
n34
;
this
.
n11
=
b
*
k
+
c
*
D
+
d
*
C
;
this
.
n12
=
b
*
I
+
c
*
F
+
d
*
N
;
this
.
n13
=
b
*
A
+
c
*
w
+
d
*
K
;
this
.
n14
=
b
*
u
+
c
*
L
+
d
*
a
+
f
;
this
.
n21
=
e
*
k
+
h
*
D
+
j
*
C
;
this
.
n22
=
e
*
I
+
h
*
F
+
j
*
N
;
this
.
n23
=
e
*
A
+
h
*
w
+
j
*
K
;
this
.
n24
=
e
*
u
+
h
*
L
+
j
*
a
+
g
;
this
.
n31
=
i
*
k
+
m
*
D
+
n
*
C
;
this
.
n32
=
i
*
I
+
m
*
F
+
n
*
N
;
this
.
n33
=
i
*
A
+
m
*
w
+
n
*
K
;
this
.
n34
=
i
*
u
+
m
*
L
+
n
*
a
+
o
;
this
.
n41
=
q
*
k
+
s
*
D
+
t
*
C
;
this
.
n42
=
q
*
I
+
s
*
F
+
t
*
N
;
this
.
n43
=
q
*
A
+
s
*
w
+
t
*
K
;
this
.
n44
=
q
*
u
+
s
*
L
+
t
*
a
+
r
;
return
this
},
multiplyScalar
:
function
(
a
){
this
.
n11
*=
a
;
this
.
n12
*=
a
;
this
.
n13
*=
a
;
this
.
n14
*=
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
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
f
=
this
.
n21
,
e
=
this
.
n22
,
h
=
this
.
n23
,
j
=
this
.
n24
,
g
=
this
.
n31
,
i
=
this
.
n32
,
m
=
this
.
n33
,
n
=
this
.
n34
,
o
=
this
.
n41
,
q
=
this
.
n42
,
s
=
this
.
n43
,
t
=
this
.
n44
;
return
d
*
h
*
i
*
o
-
c
*
j
*
i
*
o
-
d
*
e
*
m
*
o
+
b
*
j
*
m
*
o
+
c
*
e
*
n
*
o
-
b
*
h
*
n
*
o
-
d
*
h
*
g
*
q
+
c
*
j
*
g
*
q
+
d
*
f
*
m
*
q
-
a
*
j
*
m
*
q
-
c
*
f
*
n
*
q
+
a
*
h
*
n
*
q
+
d
*
e
*
g
*
s
-
b
*
j
*
g
*
s
-
d
*
f
*
i
*
s
+
a
*
j
*
i
*
s
+
b
*
f
*
n
*
s
-
a
*
e
*
n
*
s
-
c
*
e
*
g
*
t
+
b
*
h
*
g
*
t
+
c
*
f
*
i
*
t
-
a
*
h
*
i
*
t
-
b
*
f
*
m
*
t
+
a
*
e
*
m
*
t
},
transpose
:
function
(){
function
a
(
b
,
c
,
d
){
var
f
=
b
[
c
];
b
[
c
]
=
b
[
d
];
b
[
d
]
=
f
}
a
(
this
,
"
n21
"
,
"
n12
"
);
a
(
this
,
"
n31
"
,
"
n13
"
);
a
(
this
,
"
n32
"
,
"
n23
"
);
a
(
this
,
"
n41
"
,
"
n14
"
);
a
(
this
,
"
n42
"
,
"
n24
"
);
a
(
this
,
"
n43
"
,
"
n34
"
);
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
.
flattenToArray
(
this
.
flat
);
return
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
},
setRotX
:
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
},
setRotY
:
function
(
a
){
var
b
=
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
.
flattenToArray
(
this
.
flat
);
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
},
setRotX
:
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
},
setRotY
:
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
},
setRotZ
:
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
},
setRotAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
f
=
1
-
c
,
e
=
a
.
x
,
h
=
a
.
y
,
j
=
a
.
z
,
g
=
f
*
e
,
i
=
f
*
h
;
this
.
set
(
g
*
e
+
c
,
g
*
h
-
d
*
j
,
g
*
j
+
d
*
h
,
0
,
g
*
h
+
d
*
j
,
i
*
h
+
c
,
i
*
j
-
d
*
e
,
0
,
g
*
j
-
d
*
h
,
i
*
j
+
d
*
e
,
f
*
j
*
j
+
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
},
setRotationFromEuler
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
=
Math
.
cos
(
b
);
b
=
Math
.
sin
(
b
);
var
f
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
e
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
var
h
=
a
*
c
,
j
=
b
*
c
;
this
.
n11
=
f
*
e
;
this
.
n12
=-
f
*
d
;
this
.
n13
=
c
;
this
.
n21
=
j
*
e
+
a
*
d
;
this
.
n22
=-
j
*
d
+
a
*
e
;
this
.
n23
=-
b
*
f
;
this
.
n31
=-
h
*
e
+
b
*
d
;
this
.
n32
=
h
*
d
+
b
*
e
;
this
.
n33
=
a
*
f
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
f
=
a
.
w
,
e
=
b
+
b
,
h
=
c
+
c
,
j
=
d
+
d
;
a
=
b
*
e
;
var
g
=
b
*
h
;
b
*=
j
;
var
i
=
c
*
h
;
c
*=
j
;
d
*=
j
;
e
*=
f
;
h
*=
f
;
f
*=
j
;
this
.
n11
=
1
-
(
i
+
d
);
this
.
n12
=
g
-
f
;
this
.
n13
=
b
+
h
;
this
.
n21
=
g
+
f
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
e
;
this
.
n31
=
b
-
h
;
this
.
n32
=
c
+
e
;
this
.
n33
=
1
-
(
a
+
i
)},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
;
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
a
;
this
.
n21
*=
b
;
this
.
n22
*=
c
;
this
.
n23
*=
a
;
this
.
n31
*=
b
;
this
.
n32
*=
c
;
this
.
n33
*=
a
;
this
.
n41
*=
b
;
this
.
n42
*=
c
;
this
.
n43
*=
a
;
return
this
},
toString
:
function
(){
return
"
|
"
+
this
.
n11
+
"
"
+
this
.
n12
+
"
"
+
this
.
n13
+
"
"
+
this
.
n14
+
"
|
\n
|
"
+
this
.
n21
+
"
"
+
this
.
n22
+
"
"
+
this
.
n23
+
"
"
+
this
.
n24
+
"
|
\n
|
"
+
this
.
n31
+
"
"
+
this
.
n32
+
"
"
+
this
.
n33
+
"
"
+
this
.
n34
+
"
|
\n
|
"
+
this
.
n41
+
"
"
+
this
.
n42
+
"
"
+
this
.
n43
+
"
"
+
this
.
n44
+
"
|
"
}};
...
...
@@ -43,9 +43,9 @@ THREE.Matrix4.makeFrustum=function(a,b,c,d,f,e){var h;h=new THREE.Matrix4;h.n11=
THREE
.
Matrix4
.
makeOrtho
=
function
(
a
,
b
,
c
,
d
,
f
,
e
){
var
h
,
j
,
g
,
i
;
h
=
new
THREE
.
Matrix4
;
j
=
b
-
a
;
g
=
c
-
d
;
i
=
e
-
f
;
h
.
n11
=
2
/
j
;
h
.
n12
=
0
;
h
.
n13
=
0
;
h
.
n14
=-
((
b
+
a
)
/
j
);
h
.
n21
=
0
;
h
.
n22
=
2
/
g
;
h
.
n23
=
0
;
h
.
n24
=-
((
c
+
d
)
/
g
);
h
.
n31
=
0
;
h
.
n32
=
0
;
h
.
n33
=-
2
/
i
;
h
.
n34
=-
((
e
+
f
)
/
i
);
h
.
n41
=
0
;
h
.
n42
=
0
;
h
.
n43
=
0
;
h
.
n44
=
1
;
return
h
};
THREE
.
Matrix4
.
__tmpVec1
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec2
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec3
=
new
THREE
.
Vector3
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
parent
=
undefined
;
this
.
children
=
[];
this
.
position
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
matrixWorld
=
new
THREE
.
Matrix4
;
this
.
matrixRotation
=
new
THREE
.
Matrix4
;
this
.
matrixRotationWorld
=
new
THREE
.
Matrix4
;
this
.
matrixNeedsUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
0
;
this
.
quaternion
=
new
THREE
.
Quaternion
;
this
.
useQuaternion
=!
1
;
this
.
boundRadius
=
0
;
this
.
boundRadiusScale
=
1
;
this
.
visible
=!
0
};
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
this
.
children
.
splice
(
b
,
1
);
a
.
parent
=
undefined
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
a
.
parent
=
undefined
;
this
.
children
.
splice
(
b
,
1
)
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
this
.
matrix
.
n12
=
this
.
matrixRotation
.
n12
;
this
.
matrix
.
n13
=
this
.
matrixRotation
.
n13
;
this
.
matrix
.
n21
=
this
.
matrixRotation
.
n21
;
this
.
matrix
.
n22
=
this
.
matrixRotation
.
n22
;
this
.
matrix
.
n23
=
this
.
matrixRotation
.
n23
;
this
.
matrix
.
n31
=
this
.
matrixRotation
.
n31
;
this
.
matrix
.
n32
=
this
.
matrixRotation
.
n32
;
this
.
matrix
.
n33
=
this
.
matrixRotation
.
n33
;
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
||
this
.
scale
.
z
!==
1
){
this
.
matrix
.
scale
(
this
.
scale
);
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
Math
.
max
(
this
.
scale
.
y
,
this
.
scale
.
z
))}
return
!
0
},
update
:
function
(
a
,
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
var
d
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
a
=
0
;
for
(
var
d
=
this
.
children
.
length
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Vertex ( position:
"
+
this
.
position
+
"
, normal:
"
+
this
.
normal
+
"
)
"
}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
Face3
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face3 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
)
"
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
f
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face4
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face4 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
"
+
this
.
d
+
"
)
"
}};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
...
...
@@ -103,7 +103,7 @@ THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,th
THREE
.
NearestFilter
=
3
;
THREE
.
NearestMipMapNearestFilter
=
4
;
THREE
.
NearestMipMapLinearFilter
=
5
;
THREE
.
LinearFilter
=
6
;
THREE
.
LinearMipMapNearestFilter
=
7
;
THREE
.
LinearMipMapLinearFilter
=
8
;
THREE
.
ByteType
=
9
;
THREE
.
UnsignedByteType
=
10
;
THREE
.
ShortType
=
11
;
THREE
.
UnsignedShortType
=
12
;
THREE
.
IntType
=
13
;
THREE
.
UnsignedIntType
=
14
;
THREE
.
FloatType
=
15
;
THREE
.
AlphaFormat
=
16
;
THREE
.
RGBFormat
=
17
;
THREE
.
RGBAFormat
=
18
;
THREE
.
LuminanceFormat
=
19
;
THREE
.
LuminanceAlphaFormat
=
20
;
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
Line
=
function
(
a
,
b
,
c
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
type
=
c
!=
undefined
?
c
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
&&
b
.
length
?
b
:[
b
];
this
.
flipSided
=!
1
;
this
.
doubleSided
=!
1
;
this
.
overdraw
=!
1
;
if
(
this
.
geometry
){
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
();
this
.
boundRadius
=
a
.
boundingSphere
.
radius
}};
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
Mesh
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
;
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
addChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
this
.
lights
.
indexOf
(
a
)
===-
1
&&
this
.
lights
.
push
(
a
);
else
if
(
a
instanceof
THREE
.
Sound3D
)
this
.
sounds
.
indexOf
(
a
)
===-
1
&&
this
.
sounds
.
push
(
a
);
else
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
||
this
.
objects
.
indexOf
(
a
)
===-
1
&&
this
.
objects
.
push
(
a
);
for
(
var
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
addChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
removeChild
=
function
(
a
){
this
.
supr
.
removeChild
.
call
(
this
,
a
);
this
.
removeChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
removeChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
lights
.
indexOf
(
a
);
b
!==-
1
&&
this
.
lights
.
splice
(
b
,
1
)}
else
if
(
a
instanceof
THREE
.
Sound3D
){
b
=
this
.
sounds
.
indexOf
(
a
);
b
!==-
1
&&
this
.
sounds
.
splice
(
b
,
1
)}
else
if
(
!
(
a
instanceof
THREE
.
Camera
)){
b
=
this
.
objects
.
indexOf
(
a
);
b
!==-
1
&&
this
.
objects
.
splice
(
b
,
1
)}
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
removeChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
addObject
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeObject
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Scene
.
prototype
.
addLight
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeLight
=
THREE
.
Scene
.
prototype
.
removeChild
;
...
...
build/custom/ThreeDOM.js
浏览文件 @
446834ba
...
...
@@ -29,8 +29,8 @@ q*B+r*I+k*z+a*u;this.n42=q*x+r*v+k*D+a*L;this.n43=q*F+r*t+k*E+a*s;this.n44=q*G+r
p
=
this
.
n42
,
q
=
this
.
n43
,
r
=
this
.
n44
,
k
=
a
.
n11
,
B
=
a
.
n21
,
x
=
a
.
n31
,
F
=
a
.
n12
,
G
=
a
.
n22
,
I
=
a
.
n32
,
v
=
a
.
n13
,
t
=
a
.
n23
,
C
=
a
.
n33
,
z
=
a
.
n14
,
D
=
a
.
n24
;
a
=
a
.
n34
;
this
.
n11
=
b
*
k
+
c
*
B
+
e
*
x
;
this
.
n12
=
b
*
F
+
c
*
G
+
e
*
I
;
this
.
n13
=
b
*
v
+
c
*
t
+
e
*
C
;
this
.
n14
=
b
*
z
+
c
*
D
+
e
*
a
+
d
;
this
.
n21
=
f
*
k
+
g
*
B
+
i
*
x
;
this
.
n22
=
f
*
F
+
g
*
G
+
i
*
I
;
this
.
n23
=
f
*
v
+
g
*
t
+
i
*
C
;
this
.
n24
=
f
*
z
+
g
*
D
+
i
*
a
+
h
;
this
.
n31
=
j
*
k
+
m
*
B
+
n
*
x
;
this
.
n32
=
j
*
F
+
m
*
G
+
n
*
I
;
this
.
n33
=
j
*
v
+
m
*
t
+
n
*
C
;
this
.
n34
=
j
*
z
+
m
*
D
+
n
*
a
+
l
;
this
.
n41
=
o
*
k
+
p
*
B
+
q
*
x
;
this
.
n42
=
o
*
F
+
p
*
G
+
q
*
I
;
this
.
n43
=
o
*
v
+
p
*
t
+
q
*
C
;
this
.
n44
=
o
*
z
+
p
*
D
+
q
*
a
+
r
;
return
this
},
multiplyScalar
:
function
(
a
){
this
.
n11
*=
a
;
this
.
n12
*=
a
;
this
.
n13
*=
a
;
this
.
n14
*=
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
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
e
=
this
.
n14
,
d
=
this
.
n21
,
f
=
this
.
n22
,
g
=
this
.
n23
,
i
=
this
.
n24
,
h
=
this
.
n31
,
j
=
this
.
n32
,
m
=
this
.
n33
,
n
=
this
.
n34
,
l
=
this
.
n41
,
o
=
this
.
n42
,
p
=
this
.
n43
,
q
=
this
.
n44
;
return
e
*
g
*
j
*
l
-
c
*
i
*
j
*
l
-
e
*
f
*
m
*
l
+
b
*
i
*
m
*
l
+
c
*
f
*
n
*
l
-
b
*
g
*
n
*
l
-
e
*
g
*
h
*
o
+
c
*
i
*
h
*
o
+
e
*
d
*
m
*
o
-
a
*
i
*
m
*
o
-
c
*
d
*
n
*
o
+
a
*
g
*
n
*
o
+
e
*
f
*
h
*
p
-
b
*
i
*
h
*
p
-
e
*
d
*
j
*
p
+
a
*
i
*
j
*
p
+
b
*
d
*
n
*
p
-
a
*
f
*
n
*
p
-
c
*
f
*
h
*
q
+
b
*
g
*
h
*
q
+
c
*
d
*
j
*
q
-
a
*
g
*
j
*
q
-
b
*
d
*
m
*
q
+
a
*
f
*
m
*
q
},
transpose
:
function
(){
function
a
(
b
,
c
,
e
){
var
d
=
b
[
c
];
b
[
c
]
=
b
[
e
];
b
[
e
]
=
d
}
a
(
this
,
"
n21
"
,
"
n12
"
);
a
(
this
,
"
n31
"
,
"
n13
"
);
a
(
this
,
"
n32
"
,
"
n23
"
);
a
(
this
,
"
n41
"
,
"
n14
"
);
a
(
this
,
"
n42
"
,
"
n24
"
);
a
(
this
,
"
n43
"
,
"
n34
"
);
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
.
flattenToArray
(
this
.
flat
);
return
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
},
setRotX
:
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
},
setRotY
:
function
(
a
){
var
b
=
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
.
flattenToArray
(
this
.
flat
);
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
},
setRotX
:
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
},
setRotY
:
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
},
setRotZ
:
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
},
setRotAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
e
=
Math
.
sin
(
b
),
d
=
1
-
c
,
f
=
a
.
x
,
g
=
a
.
y
,
i
=
a
.
z
,
h
=
d
*
f
,
j
=
d
*
g
;
this
.
set
(
h
*
f
+
c
,
h
*
g
-
e
*
i
,
h
*
i
+
e
*
g
,
0
,
h
*
g
+
e
*
i
,
j
*
g
+
c
,
j
*
i
-
e
*
f
,
0
,
h
*
i
-
e
*
g
,
j
*
i
+
e
*
f
,
d
*
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
},
setRotationFromEuler
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
e
=
a
.
z
;
a
=
Math
.
cos
(
b
);
b
=
Math
.
sin
(
b
);
var
d
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
f
=
Math
.
cos
(
e
);
e
=
Math
.
sin
(
e
);
var
g
=
a
*
c
,
i
=
b
*
c
;
this
.
n11
=
d
*
f
;
this
.
n12
=-
d
*
e
;
this
.
n13
=
c
;
this
.
n21
=
i
*
f
+
a
*
e
;
this
.
n22
=-
i
*
e
+
a
*
f
;
this
.
n23
=-
b
*
d
;
this
.
n31
=-
g
*
f
+
b
*
e
;
this
.
n32
=
g
*
e
+
b
*
f
;
this
.
n33
=
a
*
d
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
e
=
a
.
z
,
d
=
a
.
w
,
f
=
b
+
b
,
g
=
c
+
c
,
i
=
e
+
e
;
a
=
b
*
f
;
var
h
=
b
*
g
;
b
*=
i
;
var
j
=
c
*
g
;
c
*=
i
;
e
*=
i
;
f
*=
d
;
g
*=
d
;
d
*=
i
;
this
.
n11
=
1
-
(
j
+
e
);
this
.
n12
=
h
-
d
;
this
.
n13
=
b
+
g
;
this
.
n21
=
h
+
d
;
this
.
n22
=
1
-
(
a
+
e
);
this
.
n23
=
c
-
f
;
this
.
n31
=
b
-
g
;
this
.
n32
=
c
+
f
;
this
.
n33
=
1
-
(
a
+
j
)},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
;
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
a
;
this
.
n21
*=
b
;
this
.
n22
*=
c
;
this
.
n23
*=
a
;
this
.
n31
*=
b
;
this
.
n32
*=
c
;
this
.
n33
*=
a
;
this
.
n41
*=
b
;
this
.
n42
*=
c
;
this
.
n43
*=
a
;
return
this
},
toString
:
function
(){
return
"
|
"
+
this
.
n11
+
"
"
+
this
.
n12
+
"
"
+
this
.
n13
+
"
"
+
this
.
n14
+
"
|
\n
|
"
+
this
.
n21
+
"
"
+
this
.
n22
+
"
"
+
this
.
n23
+
"
"
+
this
.
n24
+
"
|
\n
|
"
+
this
.
n31
+
"
"
+
this
.
n32
+
"
"
+
this
.
n33
+
"
"
+
this
.
n34
+
"
|
\n
|
"
+
this
.
n41
+
"
"
+
this
.
n42
+
"
"
+
this
.
n43
+
"
"
+
this
.
n44
+
"
|
"
}};
...
...
@@ -43,9 +43,9 @@ THREE.Matrix4.makeFrustum=function(a,b,c,e,d,f){var g;g=new THREE.Matrix4;g.n11=
THREE
.
Matrix4
.
makeOrtho
=
function
(
a
,
b
,
c
,
e
,
d
,
f
){
var
g
,
i
,
h
,
j
;
g
=
new
THREE
.
Matrix4
;
i
=
b
-
a
;
h
=
c
-
e
;
j
=
f
-
d
;
g
.
n11
=
2
/
i
;
g
.
n12
=
0
;
g
.
n13
=
0
;
g
.
n14
=-
((
b
+
a
)
/
i
);
g
.
n21
=
0
;
g
.
n22
=
2
/
h
;
g
.
n23
=
0
;
g
.
n24
=-
((
c
+
e
)
/
h
);
g
.
n31
=
0
;
g
.
n32
=
0
;
g
.
n33
=-
2
/
j
;
g
.
n34
=-
((
f
+
d
)
/
j
);
g
.
n41
=
0
;
g
.
n42
=
0
;
g
.
n43
=
0
;
g
.
n44
=
1
;
return
g
};
THREE
.
Matrix4
.
__tmpVec1
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec2
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec3
=
new
THREE
.
Vector3
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
parent
=
undefined
;
this
.
children
=
[];
this
.
position
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
matrixWorld
=
new
THREE
.
Matrix4
;
this
.
matrixRotation
=
new
THREE
.
Matrix4
;
this
.
matrixRotationWorld
=
new
THREE
.
Matrix4
;
this
.
matrixNeedsUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
0
;
this
.
quaternion
=
new
THREE
.
Quaternion
;
this
.
useQuaternion
=!
1
;
this
.
boundRadius
=
0
;
this
.
boundRadiusScale
=
1
;
this
.
visible
=!
0
};
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
this
.
children
.
splice
(
b
,
1
);
a
.
parent
=
undefined
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
a
.
parent
=
undefined
;
this
.
children
.
splice
(
b
,
1
)
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
this
.
matrix
.
n12
=
this
.
matrixRotation
.
n12
;
this
.
matrix
.
n13
=
this
.
matrixRotation
.
n13
;
this
.
matrix
.
n21
=
this
.
matrixRotation
.
n21
;
this
.
matrix
.
n22
=
this
.
matrixRotation
.
n22
;
this
.
matrix
.
n23
=
this
.
matrixRotation
.
n23
;
this
.
matrix
.
n31
=
this
.
matrixRotation
.
n31
;
this
.
matrix
.
n32
=
this
.
matrixRotation
.
n32
;
this
.
matrix
.
n33
=
this
.
matrixRotation
.
n33
;
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
||
this
.
scale
.
z
!==
1
){
this
.
matrix
.
scale
(
this
.
scale
);
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
Math
.
max
(
this
.
scale
.
y
,
this
.
scale
.
z
))}
return
!
0
},
update
:
function
(
a
,
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
var
e
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
e
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
a
=
0
;
for
(
var
e
=
this
.
children
.
length
;
a
<
e
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Vertex ( position:
"
+
this
.
position
+
"
, normal:
"
+
this
.
normal
+
"
)
"
}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
e
,
d
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
d
instanceof
Array
?
d
:[
d
]};
THREE
.
Face3
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face3 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
)
"
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
e
,
d
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
e
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
Face4
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face4 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
"
+
this
.
d
+
"
)
"
}};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
...
...
@@ -57,7 +57,7 @@ THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget){this.matrix.loo
this
.
inverseMatrix
)}}
for
(
a
=
0
;
a
<
this
.
children
.
length
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)};
THREE
.
Camera
.
prototype
.
frustumContains
=
function
(
a
){
var
b
=
a
.
matrixWorld
.
n14
,
c
=
a
.
matrixWorld
.
n24
,
e
=
a
.
matrixWorld
.
n34
,
d
=
this
.
inverseMatrix
,
f
=
a
.
boundRadius
*
a
.
boundRadiusScale
,
g
=
d
.
n31
*
b
+
d
.
n32
*
c
+
d
.
n33
*
e
+
d
.
n34
;
if
(
g
-
f
>-
this
.
near
)
return
!
1
;
if
(
g
+
f
<-
this
.
far
)
return
!
1
;
g
-=
f
;
var
i
=
this
.
projectionMatrix
,
h
=
1
/
(
i
.
n43
*
g
),
j
=
h
*
this
.
screenCenterX
,
m
=
(
d
.
n11
*
b
+
d
.
n12
*
c
+
d
.
n13
*
e
+
d
.
n14
)
*
i
.
n11
*
j
;
f
=
i
.
n11
*
f
*
j
;
if
(
m
+
f
<-
this
.
screenCenterX
)
return
!
1
;
if
(
m
-
f
>
this
.
screenCenterX
)
return
!
1
;
b
=
(
d
.
n21
*
b
+
d
.
n22
*
c
+
d
.
n23
*
e
+
d
.
n24
)
*
i
.
n22
*
h
*
this
.
screenCenterY
;
if
(
b
+
f
<-
this
.
screenCenterY
)
return
!
1
;
if
(
b
-
f
>
this
.
screenCenterY
)
return
!
1
;
a
.
positionScreen
.
set
(
m
,
b
,
g
,
f
);
return
!
0
};
THREE
.
ParticleDOMMaterial
=
function
(
a
){
this
.
id
=
THREE
.
MaterialCounter
.
value
++
;
this
.
domElement
=
a
};
THREE
.
ParticleDOMMaterial
.
prototype
=
{
toString
:
function
(){
return
"
THREE.ParticleDOMMaterial ( domElement:
"
+
this
.
domElement
+
"
)
"
}};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
;
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
addChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
this
.
lights
.
indexOf
(
a
)
===-
1
&&
this
.
lights
.
push
(
a
);
else
if
(
a
instanceof
THREE
.
Sound3D
)
this
.
sounds
.
indexOf
(
a
)
===-
1
&&
this
.
sounds
.
push
(
a
);
else
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
||
this
.
objects
.
indexOf
(
a
)
===-
1
&&
this
.
objects
.
push
(
a
);
for
(
var
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
addChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
removeChild
=
function
(
a
){
this
.
supr
.
removeChild
.
call
(
this
,
a
);
this
.
removeChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
removeChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
lights
.
indexOf
(
a
);
b
!==-
1
&&
this
.
lights
.
splice
(
b
,
1
)}
else
if
(
a
instanceof
THREE
.
Sound3D
){
b
=
this
.
sounds
.
indexOf
(
a
);
b
!==-
1
&&
this
.
sounds
.
splice
(
b
,
1
)}
else
if
(
!
(
a
instanceof
THREE
.
Camera
)){
b
=
this
.
objects
.
indexOf
(
a
);
b
!==-
1
&&
this
.
objects
.
splice
(
b
,
1
)}
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
removeChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
addObject
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeObject
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Scene
.
prototype
.
addLight
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeLight
=
THREE
.
Scene
.
prototype
.
removeChild
;
...
...
build/custom/ThreeSVG.js
浏览文件 @
446834ba
...
...
@@ -29,8 +29,8 @@ s*H+t*L+j*E+a*D;this.n42=s*p+t*z+j*K+a*S;this.n43=s*y+t*v+j*J+a*x;this.n44=s*C+t
q
=
this
.
n42
,
s
=
this
.
n43
,
t
=
this
.
n44
,
j
=
a
.
n11
,
H
=
a
.
n21
,
p
=
a
.
n31
,
y
=
a
.
n12
,
C
=
a
.
n22
,
L
=
a
.
n32
,
z
=
a
.
n13
,
v
=
a
.
n23
,
I
=
a
.
n33
,
E
=
a
.
n14
,
K
=
a
.
n24
;
a
=
a
.
n34
;
this
.
n11
=
b
*
j
+
c
*
H
+
d
*
p
;
this
.
n12
=
b
*
y
+
c
*
C
+
d
*
L
;
this
.
n13
=
b
*
z
+
c
*
v
+
d
*
I
;
this
.
n14
=
b
*
E
+
c
*
K
+
d
*
a
+
e
;
this
.
n21
=
f
*
j
+
g
*
H
+
i
*
p
;
this
.
n22
=
f
*
y
+
g
*
C
+
i
*
L
;
this
.
n23
=
f
*
z
+
g
*
v
+
i
*
I
;
this
.
n24
=
f
*
E
+
g
*
K
+
i
*
a
+
h
;
this
.
n31
=
k
*
j
+
n
*
H
+
m
*
p
;
this
.
n32
=
k
*
y
+
n
*
C
+
m
*
L
;
this
.
n33
=
k
*
z
+
n
*
v
+
m
*
I
;
this
.
n34
=
k
*
E
+
n
*
K
+
m
*
a
+
l
;
this
.
n41
=
o
*
j
+
q
*
H
+
s
*
p
;
this
.
n42
=
o
*
y
+
q
*
C
+
s
*
L
;
this
.
n43
=
o
*
z
+
q
*
v
+
s
*
I
;
this
.
n44
=
o
*
E
+
q
*
K
+
s
*
a
+
t
;
return
this
},
multiplyScalar
:
function
(
a
){
this
.
n11
*=
a
;
this
.
n12
*=
a
;
this
.
n13
*=
a
;
this
.
n14
*=
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
},
determinant
:
function
(){
var
a
=
this
.
n11
,
b
=
this
.
n12
,
c
=
this
.
n13
,
d
=
this
.
n14
,
e
=
this
.
n21
,
f
=
this
.
n22
,
g
=
this
.
n23
,
i
=
this
.
n24
,
h
=
this
.
n31
,
k
=
this
.
n32
,
n
=
this
.
n33
,
m
=
this
.
n34
,
l
=
this
.
n41
,
o
=
this
.
n42
,
q
=
this
.
n43
,
s
=
this
.
n44
;
return
d
*
g
*
k
*
l
-
c
*
i
*
k
*
l
-
d
*
f
*
n
*
l
+
b
*
i
*
n
*
l
+
c
*
f
*
m
*
l
-
b
*
g
*
m
*
l
-
d
*
g
*
h
*
o
+
c
*
i
*
h
*
o
+
d
*
e
*
n
*
o
-
a
*
i
*
n
*
o
-
c
*
e
*
m
*
o
+
a
*
g
*
m
*
o
+
d
*
f
*
h
*
q
-
b
*
i
*
h
*
q
-
d
*
e
*
k
*
q
+
a
*
i
*
k
*
q
+
b
*
e
*
m
*
q
-
a
*
f
*
m
*
q
-
c
*
f
*
h
*
s
+
b
*
g
*
h
*
s
+
c
*
e
*
k
*
s
-
a
*
g
*
k
*
s
-
b
*
e
*
n
*
s
+
a
*
f
*
n
*
s
},
transpose
:
function
(){
function
a
(
b
,
c
,
d
){
var
e
=
b
[
c
];
b
[
c
]
=
b
[
d
];
b
[
d
]
=
e
}
a
(
this
,
"
n21
"
,
"
n12
"
);
a
(
this
,
"
n31
"
,
"
n13
"
);
a
(
this
,
"
n32
"
,
"
n23
"
);
a
(
this
,
"
n41
"
,
"
n14
"
);
a
(
this
,
"
n42
"
,
"
n24
"
);
a
(
this
,
"
n43
"
,
"
n34
"
);
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
.
flattenToArray
(
this
.
flat
);
return
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
},
setRotX
:
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
},
setRotY
:
function
(
a
){
var
b
=
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
.
flattenToArray
(
this
.
flat
);
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
},
setRotX
:
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
},
setRotY
:
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
},
setRotZ
:
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
},
setRotAxis
:
function
(
a
,
b
){
var
c
=
Math
.
cos
(
b
),
d
=
Math
.
sin
(
b
),
e
=
1
-
c
,
f
=
a
.
x
,
g
=
a
.
y
,
i
=
a
.
z
,
h
=
e
*
f
,
k
=
e
*
g
;
this
.
set
(
h
*
f
+
c
,
h
*
g
-
d
*
i
,
h
*
i
+
d
*
g
,
0
,
h
*
g
+
d
*
i
,
k
*
g
+
c
,
k
*
i
-
d
*
f
,
0
,
h
*
i
-
d
*
g
,
k
*
i
+
d
*
f
,
e
*
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
},
setRotationFromEuler
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
;
a
=
Math
.
cos
(
b
);
b
=
Math
.
sin
(
b
);
var
e
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
f
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
var
g
=
a
*
c
,
i
=
b
*
c
;
this
.
n11
=
e
*
f
;
this
.
n12
=-
e
*
d
;
this
.
n13
=
c
;
this
.
n21
=
i
*
f
+
a
*
d
;
this
.
n22
=-
i
*
d
+
a
*
f
;
this
.
n23
=-
b
*
e
;
this
.
n31
=-
g
*
f
+
b
*
d
;
this
.
n32
=
g
*
d
+
b
*
f
;
this
.
n33
=
a
*
e
},
setRotationFromQuaternion
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
,
d
=
a
.
z
,
e
=
a
.
w
,
f
=
b
+
b
,
g
=
c
+
c
,
i
=
d
+
d
;
a
=
b
*
f
;
var
h
=
b
*
g
;
b
*=
i
;
var
k
=
c
*
g
;
c
*=
i
;
d
*=
i
;
f
*=
e
;
g
*=
e
;
e
*=
i
;
this
.
n11
=
1
-
(
k
+
d
);
this
.
n12
=
h
-
e
;
this
.
n13
=
b
+
g
;
this
.
n21
=
h
+
e
;
this
.
n22
=
1
-
(
a
+
d
);
this
.
n23
=
c
-
f
;
this
.
n31
=
b
-
g
;
this
.
n32
=
c
+
f
;
this
.
n33
=
1
-
(
a
+
k
)},
scale
:
function
(
a
){
var
b
=
a
.
x
,
c
=
a
.
y
;
a
=
a
.
z
;
this
.
n11
*=
b
;
this
.
n12
*=
c
;
this
.
n13
*=
a
;
this
.
n21
*=
b
;
this
.
n22
*=
c
;
this
.
n23
*=
a
;
this
.
n31
*=
b
;
this
.
n32
*=
c
;
this
.
n33
*=
a
;
this
.
n41
*=
b
;
this
.
n42
*=
c
;
this
.
n43
*=
a
;
return
this
},
toString
:
function
(){
return
"
|
"
+
this
.
n11
+
"
"
+
this
.
n12
+
"
"
+
this
.
n13
+
"
"
+
this
.
n14
+
"
|
\n
|
"
+
this
.
n21
+
"
"
+
this
.
n22
+
"
"
+
this
.
n23
+
"
"
+
this
.
n24
+
"
|
\n
|
"
+
this
.
n31
+
"
"
+
this
.
n32
+
"
"
+
this
.
n33
+
"
"
+
this
.
n34
+
"
|
\n
|
"
+
this
.
n41
+
"
"
+
this
.
n42
+
"
"
+
this
.
n43
+
"
"
+
this
.
n44
+
"
|
"
}};
...
...
@@ -43,9 +43,9 @@ THREE.Matrix4.makeFrustum=function(a,b,c,d,e,f){var g;g=new THREE.Matrix4;g.n11=
THREE
.
Matrix4
.
makeOrtho
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
var
g
,
i
,
h
,
k
;
g
=
new
THREE
.
Matrix4
;
i
=
b
-
a
;
h
=
c
-
d
;
k
=
f
-
e
;
g
.
n11
=
2
/
i
;
g
.
n12
=
0
;
g
.
n13
=
0
;
g
.
n14
=-
((
b
+
a
)
/
i
);
g
.
n21
=
0
;
g
.
n22
=
2
/
h
;
g
.
n23
=
0
;
g
.
n24
=-
((
c
+
d
)
/
h
);
g
.
n31
=
0
;
g
.
n32
=
0
;
g
.
n33
=-
2
/
k
;
g
.
n34
=-
((
f
+
e
)
/
k
);
g
.
n41
=
0
;
g
.
n42
=
0
;
g
.
n43
=
0
;
g
.
n44
=
1
;
return
g
};
THREE
.
Matrix4
.
__tmpVec1
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec2
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec3
=
new
THREE
.
Vector3
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
parent
=
undefined
;
this
.
children
=
[];
this
.
position
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
matrixWorld
=
new
THREE
.
Matrix4
;
this
.
matrixRotation
=
new
THREE
.
Matrix4
;
this
.
matrixRotationWorld
=
new
THREE
.
Matrix4
;
this
.
matrixNeedsUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
0
;
this
.
quaternion
=
new
THREE
.
Quaternion
;
this
.
useQuaternion
=!
1
;
this
.
boundRadius
=
0
;
this
.
boundRadiusScale
=
1
;
this
.
visible
=!
0
};
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
this
.
children
.
splice
(
b
,
1
);
a
.
parent
=
undefined
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
b
=
this
.
children
.
indexOf
(
a
);
if
(
b
!==-
1
){
a
.
parent
=
undefined
;
this
.
children
.
splice
(
b
,
1
)
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
this
.
matrix
.
n12
=
this
.
matrixRotation
.
n12
;
this
.
matrix
.
n13
=
this
.
matrixRotation
.
n13
;
this
.
matrix
.
n21
=
this
.
matrixRotation
.
n21
;
this
.
matrix
.
n22
=
this
.
matrixRotation
.
n22
;
this
.
matrix
.
n23
=
this
.
matrixRotation
.
n23
;
this
.
matrix
.
n31
=
this
.
matrixRotation
.
n31
;
this
.
matrix
.
n32
=
this
.
matrixRotation
.
n32
;
this
.
matrix
.
n33
=
this
.
matrixRotation
.
n33
;
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
||
this
.
scale
.
z
!==
1
){
this
.
matrix
.
scale
(
this
.
scale
);
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
Math
.
max
(
this
.
scale
.
y
,
this
.
scale
.
z
))}
return
!
0
},
update
:
function
(
a
,
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
var
d
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
b
,
c
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
b
|=
this
.
updateMatrix
());
if
(
b
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
b
=!
0
}
a
=
0
;
for
(
var
d
=
this
.
children
.
length
;
a
<
d
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
b
,
c
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Vertex
=
function
(
a
,
b
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
b
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Vertex ( position:
"
+
this
.
position
+
"
, normal:
"
+
this
.
normal
+
"
)
"
}};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
]};
THREE
.
Face3
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face3 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
)
"
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
]};
THREE
.
Face4
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face4 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
"
+
this
.
d
+
"
)
"
}};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
...
...
@@ -100,7 +100,7 @@ THREE.ParticleCircleMaterial=function(a){this.id=THREE.MaterialCounter.value++;t
THREE
.
ParticleCircleMaterial
.
prototype
=
{
toString
:
function
(){
return
"
THREE.ParticleCircleMaterial (<br/>color:
"
+
this
.
color
+
"
<br/>opacity:
"
+
this
.
opacity
+
"
<br/>blending:
"
+
this
.
blending
+
"
<br/>)
"
}};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
Line
=
function
(
a
,
b
,
c
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
instanceof
Array
?
b
:[
b
];
this
.
type
=
c
!=
undefined
?
c
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
b
&&
b
.
length
?
b
:[
b
];
this
.
flipSided
=!
1
;
this
.
doubleSided
=!
1
;
this
.
overdraw
=!
1
;
if
(
this
.
geometry
){
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
();
this
.
boundRadius
=
a
.
boundingSphere
.
radius
}};
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
Mesh
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
;
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
addChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
this
.
lights
.
indexOf
(
a
)
===-
1
&&
this
.
lights
.
push
(
a
);
else
if
(
a
instanceof
THREE
.
Sound3D
)
this
.
sounds
.
indexOf
(
a
)
===-
1
&&
this
.
sounds
.
push
(
a
);
else
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
||
this
.
objects
.
indexOf
(
a
)
===-
1
&&
this
.
objects
.
push
(
a
);
for
(
var
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
addChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
removeChild
=
function
(
a
){
this
.
supr
.
removeChild
.
call
(
this
,
a
);
this
.
removeChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
removeChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
lights
.
indexOf
(
a
);
b
!==-
1
&&
this
.
lights
.
splice
(
b
,
1
)}
else
if
(
a
instanceof
THREE
.
Sound3D
){
b
=
this
.
sounds
.
indexOf
(
a
);
b
!==-
1
&&
this
.
sounds
.
splice
(
b
,
1
)}
else
if
(
!
(
a
instanceof
THREE
.
Camera
)){
b
=
this
.
objects
.
indexOf
(
a
);
b
!==-
1
&&
this
.
objects
.
splice
(
b
,
1
)}
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
removeChildRecurse
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
addObject
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeObject
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Scene
.
prototype
.
addLight
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeLight
=
THREE
.
Scene
.
prototype
.
removeChild
;
...
...
build/custom/ThreeWebGL.js
浏览文件 @
446834ba
...
...
@@ -29,7 +29,7 @@ ba+A*ja+E*va;this.n33=x*P+z*ca+A*na+E*wa;this.n34=x*b+z*ga+A*$+E*c;this.n41=H*R+
k
=
this
.
n22
,
o
=
this
.
n23
,
i
=
this
.
n24
,
t
=
this
.
n31
,
w
=
this
.
n32
,
x
=
this
.
n33
,
z
=
this
.
n34
,
A
=
this
.
n41
,
E
=
this
.
n42
,
H
=
this
.
n43
,
K
=
this
.
n44
,
J
=
a
.
n11
,
R
=
a
.
n21
,
L
=
a
.
n31
,
P
=
a
.
n12
,
b
=
a
.
n22
,
aa
=
a
.
n32
,
ba
=
a
.
n13
,
ca
=
a
.
n23
,
ga
=
a
.
n33
,
da
=
a
.
n14
,
ja
=
a
.
n24
;
a
=
a
.
n34
;
this
.
n11
=
c
*
J
+
d
*
R
+
f
*
L
;
this
.
n12
=
c
*
P
+
d
*
b
+
f
*
aa
;
this
.
n13
=
c
*
ba
+
d
*
ca
+
f
*
ga
;
this
.
n14
=
c
*
da
+
d
*
ja
+
f
*
a
+
g
;
this
.
n21
=
j
*
J
+
k
*
R
+
o
*
L
;
this
.
n22
=
j
*
P
+
k
*
b
+
o
*
aa
;
this
.
n23
=
j
*
ba
+
k
*
ca
+
o
*
ga
;
this
.
n24
=
j
*
da
+
k
*
ja
+
o
*
a
+
i
;
this
.
n31
=
t
*
J
+
w
*
R
+
x
*
L
;
this
.
n32
=
t
*
P
+
w
*
b
+
x
*
aa
;
this
.
n33
=
t
*
ba
+
w
*
ca
+
x
*
ga
;
this
.
n34
=
t
*
da
+
w
*
ja
+
x
*
a
+
z
;
this
.
n41
=
A
*
J
+
E
*
R
+
H
*
L
;
this
.
n42
=
A
*
P
+
E
*
b
+
H
*
aa
;
this
.
n43
=
A
*
ba
+
E
*
ca
+
H
*
ga
;
this
.
n44
=
A
*
da
+
E
*
ja
+
H
*
a
+
K
;
return
this
},
multiplyScalar
:
function
(
a
){
this
.
n11
*=
a
;
this
.
n12
*=
a
;
this
.
n13
*=
a
;
this
.
n14
*=
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
},
determinant
:
function
(){
var
a
=
this
.
n11
,
c
=
this
.
n12
,
d
=
this
.
n13
,
f
=
this
.
n14
,
g
=
this
.
n21
,
j
=
this
.
n22
,
k
=
this
.
n23
,
o
=
this
.
n24
,
i
=
this
.
n31
,
t
=
this
.
n32
,
w
=
this
.
n33
,
x
=
this
.
n34
,
z
=
this
.
n41
,
A
=
this
.
n42
,
E
=
this
.
n43
,
H
=
this
.
n44
;
return
f
*
k
*
t
*
z
-
d
*
o
*
t
*
z
-
f
*
j
*
w
*
z
+
c
*
o
*
w
*
z
+
d
*
j
*
x
*
z
-
c
*
k
*
x
*
z
-
f
*
k
*
i
*
A
+
d
*
o
*
i
*
A
+
f
*
g
*
w
*
A
-
a
*
o
*
w
*
A
-
d
*
g
*
x
*
A
+
a
*
k
*
x
*
A
+
f
*
j
*
i
*
E
-
c
*
o
*
i
*
E
-
f
*
g
*
t
*
E
+
a
*
o
*
t
*
E
+
c
*
g
*
x
*
E
-
a
*
j
*
x
*
E
-
d
*
j
*
i
*
H
+
c
*
k
*
i
*
H
+
d
*
g
*
t
*
H
-
a
*
k
*
t
*
H
-
c
*
g
*
w
*
H
+
a
*
j
*
w
*
H
},
transpose
:
function
(){
function
a
(
c
,
d
,
f
){
var
g
=
c
[
d
];
c
[
d
]
=
c
[
f
];
c
[
f
]
=
g
}
a
(
this
,
"
n21
"
,
"
n12
"
);
a
(
this
,
"
n31
"
,
"
n13
"
);
a
(
this
,
"
n32
"
,
"
n23
"
);
a
(
this
,
"
n41
"
,
"
n14
"
);
a
(
this
,
"
n42
"
,
"
n24
"
);
a
(
this
,
"
n43
"
,
"
n34
"
);
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
.
flattenToArray
(
this
.
flat
);
return
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
]
=
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
.
flattenToArray
(
this
.
flat
);
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
,
c
){
a
[
c
]
=
this
.
n11
;
a
[
c
+
1
]
=
this
.
n21
;
a
[
c
+
2
]
=
this
.
n31
;
a
[
c
+
3
]
=
this
.
n41
;
a
[
c
+
4
]
=
this
.
n12
;
a
[
c
+
5
]
=
this
.
n22
;
a
[
c
+
6
]
=
this
.
n32
;
a
[
c
+
7
]
=
this
.
n42
;
a
[
c
+
8
]
=
this
.
n13
;
a
[
c
+
9
]
=
this
.
n23
;
a
[
c
+
10
]
=
this
.
n33
;
a
[
c
+
11
]
=
this
.
n43
;
a
[
c
+
12
]
=
this
.
n14
;
a
[
c
+
13
]
=
this
.
n24
;
a
[
c
+
14
]
=
this
.
n34
;
a
[
c
+
15
]
=
this
.
n44
;
return
a
},
setTranslation
:
function
(
a
,
c
,
d
){
this
.
set
(
1
,
0
,
0
,
a
,
0
,
1
,
0
,
c
,
0
,
0
,
1
,
d
,
0
,
0
,
0
,
1
);
return
this
},
setScale
:
function
(
a
,
c
,
d
){
this
.
set
(
a
,
0
,
0
,
0
,
0
,
c
,
0
,
0
,
0
,
0
,
d
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotX
:
function
(
a
){
var
c
=
Math
.
cos
(
a
);
a
=
Math
.
sin
(
a
);
this
.
set
(
1
,
0
,
0
,
0
,
0
,
c
,
-
a
,
0
,
0
,
a
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotY
:
function
(
a
){
var
c
=
Math
.
cos
(
a
);
a
=
Math
.
sin
(
a
);
this
.
set
(
c
,
0
,
a
,
0
,
0
,
1
,
0
,
0
,
-
a
,
0
,
c
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotZ
:
function
(
a
){
var
c
=
Math
.
cos
(
a
);
a
=
Math
.
sin
(
a
);
this
.
set
(
c
,
-
a
,
0
,
0
,
a
,
c
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setRotAxis
:
function
(
a
,
c
){
var
d
=
Math
.
cos
(
c
),
f
=
Math
.
sin
(
c
),
g
=
1
-
d
,
j
=
a
.
x
,
k
=
a
.
y
,
o
=
a
.
z
,
i
=
g
*
j
,
t
=
g
*
k
;
this
.
set
(
i
*
j
+
d
,
i
*
k
-
f
*
o
,
i
*
o
+
f
*
k
,
0
,
i
*
k
+
f
*
o
,
t
*
k
+
d
,
t
*
o
-
f
*
j
,
0
,
i
*
o
-
f
*
k
,
t
*
o
+
f
*
j
,
g
*
o
*
o
+
d
,
0
,
0
,
0
,
0
,
1
);
return
this
},
setPosition
:
function
(
a
){
this
.
n14
=
a
.
x
;
this
.
n24
=
a
.
y
;
this
.
n34
=
a
.
z
;
return
this
},
setRotationFromEuler
:
function
(
a
){
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
;
a
=
Math
.
cos
(
c
);
c
=
Math
.
sin
(
c
);
var
g
=
Math
.
cos
(
d
);
d
=
Math
.
sin
(
d
);
var
j
=
Math
.
cos
(
f
);
f
=
Math
.
sin
(
f
);
var
k
=
a
*
d
,
o
=
c
*
d
;
this
.
n11
=
g
*
j
;
this
.
n12
=-
g
*
f
;
this
.
n13
=
d
;
this
.
n21
=
o
*
j
+
a
*
f
;
this
.
n22
=-
o
*
f
+
a
*
j
;
this
.
n23
=-
c
*
g
;
this
.
n31
=-
k
*
j
+
c
*
f
;
this
.
n32
=
k
*
f
+
c
*
j
;
this
.
n33
=
a
*
g
},
setRotationFromQuaternion
:
function
(
a
){
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
,
g
=
a
.
w
,
j
=
c
+
c
,
k
=
d
+
d
,
o
=
f
+
f
;
a
=
c
*
j
;
var
i
=
c
*
k
;
c
*=
o
;
var
t
=
...
...
@@ -43,9 +43,9 @@ THREE.Matrix4.makeFrustum=function(a,c,d,f,g,j){var k;k=new THREE.Matrix4;k.n11=
THREE
.
Matrix4
.
makeOrtho
=
function
(
a
,
c
,
d
,
f
,
g
,
j
){
var
k
,
o
,
i
,
t
;
k
=
new
THREE
.
Matrix4
;
o
=
c
-
a
;
i
=
d
-
f
;
t
=
j
-
g
;
k
.
n11
=
2
/
o
;
k
.
n12
=
0
;
k
.
n13
=
0
;
k
.
n14
=-
((
c
+
a
)
/
o
);
k
.
n21
=
0
;
k
.
n22
=
2
/
i
;
k
.
n23
=
0
;
k
.
n24
=-
((
d
+
f
)
/
i
);
k
.
n31
=
0
;
k
.
n32
=
0
;
k
.
n33
=-
2
/
t
;
k
.
n34
=-
((
j
+
g
)
/
t
);
k
.
n41
=
0
;
k
.
n42
=
0
;
k
.
n43
=
0
;
k
.
n44
=
1
;
return
k
};
THREE
.
Matrix4
.
__tmpVec1
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec2
=
new
THREE
.
Vector3
;
THREE
.
Matrix4
.
__tmpVec3
=
new
THREE
.
Vector3
;
THREE
.
Object3D
=
function
(){
this
.
id
=
THREE
.
Object3DCounter
.
value
++
;
this
.
parent
=
undefined
;
this
.
children
=
[];
this
.
position
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
rotation
=
new
THREE
.
Vector3
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
matrix
=
new
THREE
.
Matrix4
;
this
.
matrixWorld
=
new
THREE
.
Matrix4
;
this
.
matrixRotation
=
new
THREE
.
Matrix4
;
this
.
matrixRotationWorld
=
new
THREE
.
Matrix4
;
this
.
matrixNeedsUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
0
;
this
.
quaternion
=
new
THREE
.
Quaternion
;
this
.
useQuaternion
=!
1
;
this
.
boundRadius
=
0
;
this
.
boundRadiusScale
=
1
;
this
.
visible
=!
0
};
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
c
=
this
.
children
.
indexOf
(
a
);
if
(
c
!==-
1
){
this
.
children
.
splice
(
c
,
1
);
a
.
parent
=
undefined
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
THREE
.
Object3D
.
prototype
=
{
addChild
:
function
(
a
){
if
(
this
.
children
.
indexOf
(
a
)
===-
1
){
a
.
parent
!==
undefined
&&
a
.
parent
.
removeChild
(
a
);
a
.
parent
=
this
;
this
.
children
.
push
(
a
)}},
removeChild
:
function
(
a
){
var
c
=
this
.
children
.
indexOf
(
a
);
if
(
c
!==-
1
){
a
.
parent
=
undefined
;
this
.
children
.
splice
(
c
,
1
)
}},
updateMatrix
:
function
(){
this
.
matrix
.
setPosition
(
this
.
position
);
this
.
useQuaternion
?
this
.
matrixRotation
.
setRotationFromQuaternion
(
this
.
quaternion
):
this
.
matrixRotation
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
n11
=
this
.
matrixRotation
.
n11
;
this
.
matrix
.
n12
=
this
.
matrixRotation
.
n12
;
this
.
matrix
.
n13
=
this
.
matrixRotation
.
n13
;
this
.
matrix
.
n21
=
this
.
matrixRotation
.
n21
;
this
.
matrix
.
n22
=
this
.
matrixRotation
.
n22
;
this
.
matrix
.
n23
=
this
.
matrixRotation
.
n23
;
this
.
matrix
.
n31
=
this
.
matrixRotation
.
n31
;
this
.
matrix
.
n32
=
this
.
matrixRotation
.
n32
;
this
.
matrix
.
n33
=
this
.
matrixRotation
.
n33
;
if
(
this
.
scale
.
x
!==
1
||
this
.
scale
.
y
!==
1
||
this
.
scale
.
z
!==
1
){
this
.
matrix
.
scale
(
this
.
scale
);
this
.
boundRadiusScale
=
Math
.
max
(
this
.
scale
.
x
,
Math
.
max
(
this
.
scale
.
y
,
this
.
scale
.
z
))}
return
!
0
},
update
:
function
(
a
,
c
,
d
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
c
|=
this
.
updateMatrix
());
if
(
c
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
c
=!
0
}
var
f
=
this
.
children
.
length
;
for
(
a
=
0
;
a
<
f
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
c
,
d
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
c
,
d
){
if
(
this
.
visible
){
this
.
matrixAutoUpdate
&&
(
c
|=
this
.
updateMatrix
());
if
(
c
||
this
.
matrixNeedsUpdate
){
a
?
this
.
matrixWorld
.
multiply
(
a
,
this
.
matrix
):
this
.
matrixWorld
.
copy
(
this
.
matrix
);
this
.
matrixNeedsUpdate
=!
1
;
c
=!
0
}
a
=
0
;
for
(
var
f
=
this
.
children
.
length
;
a
<
f
;
a
++
)
this
.
children
[
a
].
update
(
this
.
matrixWorld
,
c
,
d
)}}};
THREE
.
Object3DCounter
=
{
value
:
0
};
THREE
.
Vertex
=
function
(
a
,
c
){
this
.
position
=
a
||
new
THREE
.
Vector3
;
this
.
positionWorld
=
new
THREE
.
Vector3
;
this
.
positionScreen
=
new
THREE
.
Vector4
;
this
.
normal
=
c
||
new
THREE
.
Vector3
;
this
.
normalWorld
=
new
THREE
.
Vector3
;
this
.
normalScreen
=
new
THREE
.
Vector3
;
this
.
tangent
=
new
THREE
.
Vector4
;
this
.
__visible
=!
0
};
THREE
.
Vertex
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Vertex ( position:
"
+
this
.
position
+
"
, normal:
"
+
this
.
normal
+
"
)
"
}};
THREE
.
Face3
=
function
(
a
,
c
,
d
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
c
;
this
.
c
=
d
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
]};
THREE
.
Face3
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face3 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
)
"
}};
THREE
.
Face4
=
function
(
a
,
c
,
d
,
f
,
g
,
j
){
this
.
a
=
a
;
this
.
b
=
c
;
this
.
c
=
d
;
this
.
d
=
f
;
this
.
centroid
=
new
THREE
.
Vector3
;
this
.
normal
=
g
instanceof
THREE
.
Vector3
?
g
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
g
instanceof
Array
?
g
:[];
this
.
materials
=
j
instanceof
Array
?
j
:[
j
]};
THREE
.
Face4
.
prototype
=
{
toString
:
function
(){
return
"
THREE.Face4 (
"
+
this
.
a
+
"
,
"
+
this
.
b
+
"
,
"
+
this
.
c
+
"
"
+
this
.
d
+
"
)
"
}};
THREE
.
UV
=
function
(
a
,
c
){
this
.
set
(
a
||
0
,
c
||
0
)};
...
...
@@ -109,7 +109,7 @@ THREE.RenderTarget=function(a,c,d){this.width=a;this.height=c;d=d||{};this.wrap_
var
Uniforms
=
{
clone
:
function
(
a
){
var
c
,
d
,
f
,
g
=
{};
for
(
c
in
a
){
g
[
c
]
=
{};
for
(
d
in
a
[
c
]){
f
=
a
[
c
][
d
];
g
[
c
][
d
]
=
f
instanceof
THREE
.
Color
||
f
instanceof
THREE
.
Vector3
||
f
instanceof
THREE
.
Texture
?
f
.
clone
():
f
}}
return
g
},
merge
:
function
(
a
){
var
c
,
d
,
f
,
g
=
{};
for
(
c
=
0
;
c
<
a
.
length
;
c
++
){
f
=
this
.
clone
(
a
[
c
]);
for
(
d
in
f
)
g
[
d
]
=
f
[
d
]}
return
g
}};
THREE
.
Particle
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
materials
=
a
instanceof
Array
?
a
:[
a
];
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Particle
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Particle
.
prototype
.
constructor
=
THREE
.
Particle
;
THREE
.
ParticleSystem
=
function
(
a
,
c
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
c
instanceof
Array
?
c
:[
c
];
this
.
sortParticles
=!
1
};
THREE
.
ParticleSystem
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
ParticleSystem
.
prototype
.
constructor
=
THREE
.
ParticleSystem
;
THREE
.
Line
=
function
(
a
,
c
,
d
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
c
instanceof
Array
?
c
:[
c
];
this
.
type
=
d
!=
undefined
?
d
:
THREE
.
LineStrip
};
THREE
.
LineStrip
=
0
;
THREE
.
LinePieces
=
1
;
THREE
.
Line
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Line
.
prototype
.
constructor
=
THREE
.
Line
;
THREE
.
Mesh
=
function
(
a
,
c
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
materials
=
c
&&
c
.
length
?
c
:[
c
];
this
.
flipSided
=!
1
;
this
.
doubleSided
=!
1
;
this
.
overdraw
=!
1
;
if
(
this
.
geometry
){
this
.
geometry
.
boundingSphere
||
this
.
geometry
.
computeBoundingSphere
();
this
.
boundRadius
=
a
.
boundingSphere
.
radius
}};
THREE
.
Mesh
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Mesh
.
prototype
.
constructor
=
THREE
.
Mesh
;
THREE
.
Mesh
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[];
this
.
lights
=
[];
this
.
sounds
=
[];
this
.
fog
=
null
;
this
.
matrixAutoUpdate
=!
1
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Scene
.
prototype
.
constructor
=
THREE
.
Scene
;
THREE
.
Scene
.
prototype
.
supr
=
THREE
.
Object3D
.
prototype
;
THREE
.
Scene
.
prototype
.
addChild
=
function
(
a
){
this
.
supr
.
addChild
.
call
(
this
,
a
);
this
.
addChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
addChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
this
.
lights
.
indexOf
(
a
)
===-
1
&&
this
.
lights
.
push
(
a
);
else
if
(
a
instanceof
THREE
.
Sound3D
)
this
.
sounds
.
indexOf
(
a
)
===-
1
&&
this
.
sounds
.
push
(
a
);
else
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
||
this
.
objects
.
indexOf
(
a
)
===-
1
&&
this
.
objects
.
push
(
a
);
for
(
var
c
=
0
;
c
<
a
.
children
.
length
;
c
++
)
this
.
addChildRecurse
(
a
.
children
[
c
])};
THREE
.
Scene
.
prototype
.
removeChild
=
function
(
a
){
this
.
supr
.
removeChild
.
call
(
this
,
a
);
this
.
removeChildRecurse
(
a
)};
THREE
.
Scene
.
prototype
.
removeChildRecurse
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
c
=
this
.
lights
.
indexOf
(
a
);
c
!==-
1
&&
this
.
lights
.
splice
(
c
,
1
)}
else
if
(
a
instanceof
THREE
.
Sound3D
){
c
=
this
.
sounds
.
indexOf
(
a
);
c
!==-
1
&&
this
.
sounds
.
splice
(
c
,
1
)}
else
if
(
!
(
a
instanceof
THREE
.
Camera
)){
c
=
this
.
objects
.
indexOf
(
a
);
c
!==-
1
&&
this
.
objects
.
splice
(
c
,
1
)}
for
(
c
=
0
;
c
<
a
.
children
.
length
;
c
++
)
this
.
removeChildRecurse
(
a
.
children
[
c
])};
THREE
.
Scene
.
prototype
.
addObject
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeObject
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Scene
.
prototype
.
addLight
=
THREE
.
Scene
.
prototype
.
addChild
;
THREE
.
Scene
.
prototype
.
removeLight
=
THREE
.
Scene
.
prototype
.
removeChild
;
THREE
.
Fog
=
function
(
a
,
c
,
d
){
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
near
=
c
||
1
;
this
.
far
=
d
||
1
E3
};
THREE
.
FogExp2
=
function
(
a
,
c
){
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
density
=
c
||
2.5
E
-
4
};
...
...
examples/webgl_sandbox.html
浏览文件 @
446834ba
...
...
@@ -26,13 +26,11 @@
a
{
color
:
#ffffff
;
}
#log
{
position
:
absolute
;
top
:
50px
;
text-align
:
left
;
display
:
block
;
z-index
:
100
}
</style>
</head>
<body>
<pre
id=
"log"
></pre>
<div
id=
"info"
><a
href=
"http://github.com/mrdoob/three.js"
target=
"_blank"
>
three.js
</a>
- webgl cube Fresnel shader demo.
</div>
<!-- <script type="text/javascript" src="../build/Three.js"></script> -->
...
...
src/core/Matrix4.js
浏览文件 @
446834ba
...
...
@@ -380,7 +380,7 @@ THREE.Matrix4.prototype = {
flatten
:
function
()
{
this
.
flattenToArray
(
this
.
flat
);
return
flat
;
return
this
.
flat
;
},
...
...
src/core/Object3D.js
浏览文件 @
446834ba
...
...
@@ -59,8 +59,8 @@ THREE.Object3D.prototype = {
if
(
childIndex
!==
-
1
)
{
this
.
children
.
splice
(
childIndex
,
1
);
child
.
parent
=
undefined
;
this
.
children
.
splice
(
childIndex
,
1
);
}
...
...
@@ -134,9 +134,7 @@ THREE.Object3D.prototype = {
// update children
var
i
,
l
=
this
.
children
.
length
;
for
(
i
=
0
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
this
.
children
.
length
;
i
<
l
;
i
++
)
{
this
.
children
[
i
].
update
(
this
.
matrixWorld
,
forceUpdate
,
camera
);
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
446834ba
...
...
@@ -2600,15 +2600,15 @@ THREE.WebGLRenderer = function ( parameters ) {
function
setCubeTexture
(
texture
,
slot
)
{
if
(
texture
.
image
.
length
==
6
)
{
if
(
texture
.
needsUpdate
)
{
if
(
!
texture
.
image
.
__webGLTextureCube
)
{
texture
.
image
.
__webGLTextureCube
=
_gl
.
createTexture
();
}
_gl
.
bindTexture
(
_gl
.
TEXTURE_CUBE_MAP
,
texture
.
image
.
__webGLTextureCube
);
_gl
.
texParameteri
(
_gl
.
TEXTURE_CUBE_MAP
,
_gl
.
TEXTURE_WRAP_S
,
_gl
.
CLAMP_TO_EDGE
);
...
...
@@ -2626,26 +2626,26 @@ THREE.WebGLRenderer = function ( parameters ) {
_gl
.
generateMipmap
(
_gl
.
TEXTURE_CUBE_MAP
);
_gl
.
bindTexture
(
_gl
.
TEXTURE_CUBE_MAP
,
null
);
texture
.
needsUpdate
=
false
;
}
_gl
.
activeTexture
(
_gl
.
TEXTURE0
+
slot
);
_gl
.
bindTexture
(
_gl
.
TEXTURE_CUBE_MAP
,
texture
.
image
.
__webGLTextureCube
);
}
};
function
setTexture
(
texture
,
slot
)
{
if
(
texture
.
needsUpdate
)
{
if
(
!
texture
.
__wasSetOnce
)
{
texture
.
__webGLTexture
=
_gl
.
createTexture
();
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
texture
.
__webGLTexture
);
_gl
.
texImage2D
(
_gl
.
TEXTURE_2D
,
0
,
_gl
.
RGBA
,
_gl
.
RGBA
,
_gl
.
UNSIGNED_BYTE
,
texture
.
image
);
...
...
@@ -2656,14 +2656,14 @@ THREE.WebGLRenderer = function ( parameters ) {
_gl
.
texParameteri
(
_gl
.
TEXTURE_2D
,
_gl
.
TEXTURE_MIN_FILTER
,
paramThreeToGL
(
texture
.
min_filter
)
);
_gl
.
generateMipmap
(
_gl
.
TEXTURE_2D
);
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
null
);
texture
.
__wasSetOnce
=
true
;
}
else
{
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
texture
.
__webGLTexture
);
_gl
.
texSubImage2D
(
_gl
.
TEXTURE_2D
,
0
,
0
,
0
,
_gl
.
RGBA
,
_gl
.
UNSIGNED_BYTE
,
texture
.
image
);
_gl
.
texParameteri
(
_gl
.
TEXTURE_2D
,
_gl
.
TEXTURE_WRAP_S
,
paramThreeToGL
(
texture
.
wrap_s
)
);
_gl
.
texParameteri
(
_gl
.
TEXTURE_2D
,
_gl
.
TEXTURE_WRAP_T
,
paramThreeToGL
(
texture
.
wrap_t
)
);
...
...
@@ -2671,15 +2671,15 @@ THREE.WebGLRenderer = function ( parameters ) {
_gl
.
texParameteri
(
_gl
.
TEXTURE_2D
,
_gl
.
TEXTURE_MIN_FILTER
,
paramThreeToGL
(
texture
.
min_filter
)
);
_gl
.
generateMipmap
(
_gl
.
TEXTURE_2D
);
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
null
);
}
}
texture
.
needsUpdate
=
false
;
}
_gl
.
activeTexture
(
_gl
.
TEXTURE0
+
slot
);
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
texture
.
__webGLTexture
);
_gl
.
bindTexture
(
_gl
.
TEXTURE_2D
,
texture
.
__webGLTexture
);
};
...
...
src/renderers/WebGLRenderer2.js
浏览文件 @
446834ba
...
...
@@ -114,6 +114,8 @@ THREE.WebGLRenderer2 = function ( antialias ) {
}
*/
scene
.
update
(
undefined
,
false
,
camera
);
_renderList
=
_projector
.
projectObjects
(
scene
,
camera
,
this
.
sortObjects
);
for
(
o
=
0
,
ol
=
_renderList
.
length
;
o
<
ol
;
o
++
)
{
...
...
src/scenes/Scene.js
浏览文件 @
446834ba
...
...
@@ -3,7 +3,7 @@
* @author mikael emtinger / http://gomo.se/
*/
THREE
.
Scene
=
function
()
{
THREE
.
Scene
=
function
()
{
THREE
.
Object3D
.
call
(
this
);
...
...
@@ -13,6 +13,8 @@ THREE.Scene = function() {
this
.
fog
=
null
;
this
.
matrixAutoUpdate
=
false
;
};
THREE
.
Scene
.
prototype
=
new
THREE
.
Object3D
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录