Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
57936758
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,发现更多精彩内容 >>
提交
57936758
编写于
7月 11, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rebuild libs.
上级
d141ea85
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
17 deletion
+17
-17
build/Three.js
build/Three.js
+6
-6
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+1
-1
build/custom/ThreeDOM.js
build/custom/ThreeDOM.js
+1
-1
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+4
-4
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+4
-4
未找到文件。
build/Three.js
浏览文件 @
57936758
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;thi
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;thi
f
;
this
.
z
=
b
.
z
*
f
;
this
.
w
=
Math
.
cos
(
e
);
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
b
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
b
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
b
=
1
/
b
,
this
.
x
*=
b
,
this
.
y
*=
b
,
this
.
z
*=
b
,
this
.
w
*=
b
);
return
this
},
f
;
this
.
z
=
b
.
z
*
f
;
this
.
w
=
Math
.
cos
(
e
);
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
b
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
b
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
b
=
1
/
b
,
this
.
x
*=
b
,
this
.
y
*=
b
,
this
.
z
*=
b
,
this
.
w
*=
b
);
return
this
},
multiplySelf
:
function
(
b
){
var
c
=
this
.
x
,
e
=
this
.
y
,
f
=
this
.
z
,
g
=
this
.
w
,
k
=
b
.
x
,
h
=
b
.
y
,
m
=
b
.
z
,
b
=
b
.
w
;
this
.
x
=
c
*
b
+
g
*
k
+
e
*
m
-
f
*
h
;
this
.
y
=
e
*
b
+
g
*
h
+
f
*
k
-
c
*
m
;
this
.
z
=
f
*
b
+
g
*
m
+
c
*
h
-
e
*
k
;
this
.
w
=
g
*
b
-
c
*
k
-
e
*
h
-
f
*
m
;
return
this
},
multiply
:
function
(
b
,
c
){
this
.
x
=
b
.
x
*
c
.
w
+
b
.
y
*
c
.
z
-
b
.
z
*
c
.
y
+
b
.
w
*
c
.
x
;
this
.
y
=-
b
.
x
*
c
.
z
+
b
.
y
*
c
.
w
+
b
.
z
*
c
.
x
+
b
.
w
*
c
.
y
;
this
.
z
=
b
.
x
*
c
.
y
-
b
.
y
*
c
.
x
+
b
.
z
*
c
.
w
+
b
.
w
*
c
.
z
;
this
.
w
=-
b
.
x
*
c
.
x
-
b
.
y
*
c
.
y
-
b
.
z
*
c
.
z
+
b
.
w
*
c
.
w
;
return
this
},
multiplyVector3
:
function
(
b
,
c
){
c
||
(
c
=
b
);
var
e
=
b
.
x
,
f
=
b
.
y
,
g
=
b
.
z
,
k
=
this
.
x
,
h
=
this
.
y
,
m
=
this
.
z
,
n
=
this
.
w
,
o
=
n
*
e
+
h
*
g
-
m
*
f
,
p
=
multiplySelf
:
function
(
b
){
var
c
=
this
.
x
,
e
=
this
.
y
,
f
=
this
.
z
,
g
=
this
.
w
,
k
=
b
.
x
,
h
=
b
.
y
,
m
=
b
.
z
,
b
=
b
.
w
;
this
.
x
=
c
*
b
+
g
*
k
+
e
*
m
-
f
*
h
;
this
.
y
=
e
*
b
+
g
*
h
+
f
*
k
-
c
*
m
;
this
.
z
=
f
*
b
+
g
*
m
+
c
*
h
-
e
*
k
;
this
.
w
=
g
*
b
-
c
*
k
-
e
*
h
-
f
*
m
;
return
this
},
multiply
:
function
(
b
,
c
){
this
.
x
=
b
.
x
*
c
.
w
+
b
.
y
*
c
.
z
-
b
.
z
*
c
.
y
+
b
.
w
*
c
.
x
;
this
.
y
=-
b
.
x
*
c
.
z
+
b
.
y
*
c
.
w
+
b
.
z
*
c
.
x
+
b
.
w
*
c
.
y
;
this
.
z
=
b
.
x
*
c
.
y
-
b
.
y
*
c
.
x
+
b
.
z
*
c
.
w
+
b
.
w
*
c
.
z
;
this
.
w
=-
b
.
x
*
c
.
x
-
b
.
y
*
c
.
y
-
b
.
z
*
c
.
z
+
b
.
w
*
c
.
w
;
return
this
},
multiplyVector3
:
function
(
b
,
c
){
c
||
(
c
=
b
);
var
e
=
b
.
x
,
f
=
b
.
y
,
g
=
b
.
z
,
k
=
this
.
x
,
h
=
this
.
y
,
m
=
this
.
z
,
n
=
this
.
w
,
o
=
n
*
e
+
h
*
g
-
m
*
f
,
p
=
n
*
f
+
m
*
e
-
k
*
g
,
t
=
n
*
g
+
k
*
f
-
h
*
e
,
e
=-
k
*
e
-
h
*
f
-
m
*
g
;
c
.
x
=
o
*
n
+
e
*-
k
+
p
*-
m
-
t
*-
h
;
c
.
y
=
p
*
n
+
e
*-
h
+
t
*-
k
-
o
*-
m
;
c
.
z
=
t
*
n
+
e
*-
m
+
o
*-
h
-
p
*-
k
;
return
c
}};
n
*
f
+
m
*
e
-
k
*
g
,
t
=
n
*
g
+
k
*
f
-
h
*
e
,
e
=-
k
*
e
-
h
*
f
-
m
*
g
;
c
.
x
=
o
*
n
+
e
*-
k
+
p
*-
m
-
t
*-
h
;
c
.
y
=
p
*
n
+
e
*-
h
+
t
*-
k
-
o
*-
m
;
c
.
z
=
t
*
n
+
e
*-
m
+
o
*-
h
-
p
*-
k
;
return
c
}};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
c
,
e
,
f
){
var
g
=
b
.
w
*
c
.
w
+
b
.
x
*
c
.
x
+
b
.
y
*
c
.
y
+
b
.
z
*
c
.
z
;
if
(
Math
.
abs
(
g
)
>=
1
)
return
e
.
w
=
b
.
w
,
e
.
x
=
b
.
x
,
e
.
y
=
b
.
y
,
e
.
z
=
b
.
z
,
e
;
var
k
=
Math
.
acos
(
g
),
h
=
Math
.
sqrt
(
1
-
g
*
g
);
if
(
Math
.
abs
(
h
)
<
0.001
)
return
e
.
w
=
0.5
*
(
b
.
w
+
c
.
w
),
e
.
x
=
0.5
*
(
b
.
x
+
c
.
x
),
e
.
y
=
0.5
*
(
b
.
y
+
c
.
y
),
e
.
z
=
0.5
*
(
b
.
z
+
c
.
z
),
e
;
g
=
Math
.
sin
((
1
-
f
)
*
k
)
/
h
;
f
=
Math
.
sin
(
f
*
k
)
/
h
;
e
.
w
=
b
.
w
*
g
+
c
.
w
*
f
;
e
.
x
=
b
.
x
*
g
+
c
.
x
*
f
;
e
.
y
=
b
.
y
*
g
+
c
.
y
*
f
;
e
.
z
=
b
.
z
*
g
+
c
.
z
*
f
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
c
,
e
,
f
){
var
g
=
b
.
w
*
c
.
w
+
b
.
x
*
c
.
x
+
b
.
y
*
c
.
y
+
b
.
z
*
c
.
z
;
if
(
Math
.
abs
(
g
)
>=
1
)
return
e
.
w
=
b
.
w
,
e
.
x
=
b
.
x
,
e
.
y
=
b
.
y
,
e
.
z
=
b
.
z
,
e
;
var
k
=
Math
.
acos
(
g
),
h
=
Math
.
sqrt
(
1
-
g
*
g
);
if
(
Math
.
abs
(
h
)
<
0.001
0
)
return
e
.
w
=
0.5
*
(
b
.
w
+
c
.
w
),
e
.
x
=
0.5
*
(
b
.
x
+
c
.
x
),
e
.
y
=
0.5
*
(
b
.
y
+
c
.
y
),
e
.
z
=
0.5
*
(
b
.
z
+
c
.
z
),
e
;
g
=
Math
.
sin
((
1
-
f
)
*
k
)
/
h
;
f
=
Math
.
sin
(
f
*
k
)
/
h
;
e
.
w
=
b
.
w
*
g
+
c
.
w
*
f
;
e
.
x
=
b
.
x
*
g
+
c
.
x
*
f
;
e
.
y
=
b
.
y
*
g
+
c
.
y
*
f
;
e
.
z
=
b
.
z
*
g
+
c
.
z
*
f
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
b
,
c
,
e
,
f
,
g
,
k
){
this
.
a
=
b
;
this
.
b
=
c
;
this
.
c
=
e
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
k
instanceof
Array
?
k
:[
k
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
b
,
c
,
e
,
f
,
g
,
k
){
this
.
a
=
b
;
this
.
b
=
c
;
this
.
c
=
e
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
k
instanceof
Array
?
k
:[
k
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
b
,
c
,
e
,
f
,
g
,
k
,
h
){
this
.
a
=
b
;
this
.
b
=
c
;
this
.
c
=
e
;
this
.
d
=
f
;
this
.
normal
=
g
instanceof
THREE
.
Vector3
?
g
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
g
instanceof
Array
?
g
:[];
this
.
color
=
k
instanceof
THREE
.
Color
?
k
:
new
THREE
.
Color
;
this
.
vertexColors
=
k
instanceof
Array
?
k
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
b
,
c
){
this
.
set
(
b
||
0
,
c
||
0
)};
THREE
.
Face4
=
function
(
b
,
c
,
e
,
f
,
g
,
k
,
h
){
this
.
a
=
b
;
this
.
b
=
c
;
this
.
c
=
e
;
this
.
d
=
f
;
this
.
normal
=
g
instanceof
THREE
.
Vector3
?
g
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
g
instanceof
Array
?
g
:[];
this
.
color
=
k
instanceof
THREE
.
Color
?
k
:
new
THREE
.
Color
;
this
.
vertexColors
=
k
instanceof
Array
?
k
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
b
,
c
){
this
.
set
(
b
||
0
,
c
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
b
,
c
){
this
.
u
=
b
;
this
.
v
=
c
;
return
this
},
copy
:
function
(
b
){
this
.
set
(
b
.
u
,
b
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
.
prototype
=
{
set
:
function
(
b
,
c
){
this
.
u
=
b
;
this
.
v
=
c
;
return
this
},
copy
:
function
(
b
){
this
.
set
(
b
.
u
,
b
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
@@ -252,7 +252,7 @@ g.uvScale.y),j.uniform2f(h.uvOffset,g.uvOffset.x,g.uvOffset.y),j.uniform2f(h.ali
...
@@ -252,7 +252,7 @@ g.uvScale.y),j.uniform2f(h.uvOffset,g.uvOffset.x,g.uvOffset.y),j.uniform2f(h.ali
new
THREE
.
Vector3
,
t
=
U
/
W
,
p
=
W
*
0.5
,
o
=
U
*
0.5
,
u
=
16
/
U
,
v
=
[
u
*
t
,
u
],
w
=
[
1
,
1
,
0
],
y
=
[
1
,
1
],
A
=
O
.
uniforms
;
c
=
O
.
attributes
;
j
.
useProgram
(
O
.
program
);
T
=
O
.
program
;
aa
=-
1
;
oa
||
(
j
.
enableVertexAttribArray
(
O
.
attributes
.
vertex
),
j
.
enableVertexAttribArray
(
O
.
attributes
.
uv
),
oa
=!
0
);
j
.
uniform1i
(
A
.
occlusionMap
,
0
);
j
.
uniform1i
(
A
.
map
,
1
);
j
.
bindBuffer
(
j
.
ARRAY_BUFFER
,
O
.
vertexBuffer
);
j
.
vertexAttribPointer
(
c
.
vertex
,
2
,
j
.
FLOAT
,
!
1
,
16
,
0
);
j
.
vertexAttribPointer
(
c
.
uv
,
2
,
j
.
FLOAT
,
!
1
,
16
,
8
);
j
.
bindBuffer
(
j
.
ELEMENT_ARRAY_BUFFER
,
O
.
elementBuffer
);
j
.
disable
(
j
.
CULL_FACE
);
new
THREE
.
Vector3
,
t
=
U
/
W
,
p
=
W
*
0.5
,
o
=
U
*
0.5
,
u
=
16
/
U
,
v
=
[
u
*
t
,
u
],
w
=
[
1
,
1
,
0
],
y
=
[
1
,
1
],
A
=
O
.
uniforms
;
c
=
O
.
attributes
;
j
.
useProgram
(
O
.
program
);
T
=
O
.
program
;
aa
=-
1
;
oa
||
(
j
.
enableVertexAttribArray
(
O
.
attributes
.
vertex
),
j
.
enableVertexAttribArray
(
O
.
attributes
.
uv
),
oa
=!
0
);
j
.
uniform1i
(
A
.
occlusionMap
,
0
);
j
.
uniform1i
(
A
.
map
,
1
);
j
.
bindBuffer
(
j
.
ARRAY_BUFFER
,
O
.
vertexBuffer
);
j
.
vertexAttribPointer
(
c
.
vertex
,
2
,
j
.
FLOAT
,
!
1
,
16
,
0
);
j
.
vertexAttribPointer
(
c
.
uv
,
2
,
j
.
FLOAT
,
!
1
,
16
,
8
);
j
.
bindBuffer
(
j
.
ELEMENT_ARRAY_BUFFER
,
O
.
elementBuffer
);
j
.
disable
(
j
.
CULL_FACE
);
j
.
depthMask
(
!
1
);
j
.
activeTexture
(
j
.
TEXTURE0
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
occlusionTexture
);
j
.
activeTexture
(
j
.
TEXTURE1
);
for
(
f
=
0
;
f
<
g
;
f
++
)
if
(
c
=
b
.
__webglLensFlares
[
f
].
object
,
n
.
set
(
c
.
matrixWorld
.
n14
,
c
.
matrixWorld
.
n24
,
c
.
matrixWorld
.
n34
),
e
.
matrixWorldInverse
.
multiplyVector3
(
n
),
e
.
projectionMatrix
.
multiplyVector3
(
n
),
w
[
0
]
=
n
.
x
,
w
[
1
]
=
n
.
y
,
w
[
2
]
=
n
.
z
,
y
[
0
]
=
w
[
0
]
*
p
+
p
,
y
[
1
]
=
w
[
1
]
*
o
+
o
,
O
.
hasVertexTexture
||
y
[
0
]
>
0
&&
y
[
0
]
<
W
&&
y
[
1
]
>
0
&&
y
[
1
]
<
U
){
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
tempTexture
);
j
.
copyTexImage2D
(
j
.
TEXTURE_2D
,
0
,
j
.
RGB
,
y
[
0
]
-
j
.
depthMask
(
!
1
);
j
.
activeTexture
(
j
.
TEXTURE0
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
occlusionTexture
);
j
.
activeTexture
(
j
.
TEXTURE1
);
for
(
f
=
0
;
f
<
g
;
f
++
)
if
(
c
=
b
.
__webglLensFlares
[
f
].
object
,
n
.
set
(
c
.
matrixWorld
.
n14
,
c
.
matrixWorld
.
n24
,
c
.
matrixWorld
.
n34
),
e
.
matrixWorldInverse
.
multiplyVector3
(
n
),
e
.
projectionMatrix
.
multiplyVector3
(
n
),
w
[
0
]
=
n
.
x
,
w
[
1
]
=
n
.
y
,
w
[
2
]
=
n
.
z
,
y
[
0
]
=
w
[
0
]
*
p
+
p
,
y
[
1
]
=
w
[
1
]
*
o
+
o
,
O
.
hasVertexTexture
||
y
[
0
]
>
0
&&
y
[
0
]
<
W
&&
y
[
1
]
>
0
&&
y
[
1
]
<
U
){
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
tempTexture
);
j
.
copyTexImage2D
(
j
.
TEXTURE_2D
,
0
,
j
.
RGB
,
y
[
0
]
-
8
,
y
[
1
]
-
8
,
16
,
16
,
0
);
j
.
uniform1i
(
A
.
renderType
,
0
);
j
.
uniform2fv
(
A
.
scale
,
v
);
j
.
uniform3fv
(
A
.
screenPosition
,
w
);
j
.
disable
(
j
.
BLEND
);
j
.
enable
(
j
.
DEPTH_TEST
);
j
.
drawElements
(
j
.
TRIANGLES
,
6
,
j
.
UNSIGNED_SHORT
,
0
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
occlusionTexture
);
j
.
copyTexImage2D
(
j
.
TEXTURE_2D
,
0
,
j
.
RGBA
,
y
[
0
]
-
8
,
y
[
1
]
-
8
,
16
,
16
,
0
);
j
.
uniform1i
(
A
.
renderType
,
1
);
j
.
disable
(
j
.
DEPTH_TEST
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
tempTexture
);
j
.
drawElements
(
j
.
TRIANGLES
,
6
,
j
.
UNSIGNED_SHORT
,
0
);
c
.
positionScreen
.
x
=
w
[
0
];
c
.
positionScreen
.
y
=
w
[
1
];
c
.
positionScreen
.
z
=
8
,
y
[
1
]
-
8
,
16
,
16
,
0
);
j
.
uniform1i
(
A
.
renderType
,
0
);
j
.
uniform2fv
(
A
.
scale
,
v
);
j
.
uniform3fv
(
A
.
screenPosition
,
w
);
j
.
disable
(
j
.
BLEND
);
j
.
enable
(
j
.
DEPTH_TEST
);
j
.
drawElements
(
j
.
TRIANGLES
,
6
,
j
.
UNSIGNED_SHORT
,
0
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
occlusionTexture
);
j
.
copyTexImage2D
(
j
.
TEXTURE_2D
,
0
,
j
.
RGBA
,
y
[
0
]
-
8
,
y
[
1
]
-
8
,
16
,
16
,
0
);
j
.
uniform1i
(
A
.
renderType
,
1
);
j
.
disable
(
j
.
DEPTH_TEST
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
O
.
tempTexture
);
j
.
drawElements
(
j
.
TRIANGLES
,
6
,
j
.
UNSIGNED_SHORT
,
0
);
c
.
positionScreen
.
x
=
w
[
0
];
c
.
positionScreen
.
y
=
w
[
1
];
c
.
positionScreen
.
z
=
w
[
2
];
c
.
customUpdateCallback
?
c
.
customUpdateCallback
(
c
):
c
.
updateLensFlares
();
j
.
uniform1i
(
A
.
renderType
,
2
);
j
.
enable
(
j
.
BLEND
);
h
=
0
;
for
(
k
=
c
.
lensFlares
.
length
;
h
<
k
;
h
++
)
if
(
m
=
c
.
lensFlares
[
h
],
m
.
opacity
>
0.001
&&
m
.
scale
>
0.001
)
w
[
0
]
=
m
.
x
,
w
[
1
]
=
m
.
y
,
w
[
2
]
=
m
.
z
,
u
=
m
.
size
*
m
.
scale
/
U
,
v
[
0
]
=
u
*
t
,
v
[
1
]
=
u
,
j
.
uniform3fv
(
A
.
screenPosition
,
w
),
j
.
uniform2fv
(
A
.
scale
,
v
),
j
.
uniform1f
(
A
.
rotation
,
m
.
rotation
),
j
.
uniform1f
(
A
.
opacity
,
m
.
opacity
),
D
(
m
.
blending
),
J
(
m
.
texture
,
1
),
j
.
drawElements
(
j
.
TRIANGLES
,
6
,
j
.
UNSIGNED_SHORT
,
0
)}
j
.
enable
(
j
.
CULL_FACE
);
j
.
enable
(
j
.
DEPTH_TEST
);
w
[
2
];
c
.
customUpdateCallback
?
c
.
customUpdateCallback
(
c
):
c
.
updateLensFlares
();
j
.
uniform1i
(
A
.
renderType
,
2
);
j
.
enable
(
j
.
BLEND
);
h
=
0
;
for
(
k
=
c
.
lensFlares
.
length
;
h
<
k
;
h
++
)
if
(
m
=
c
.
lensFlares
[
h
],
m
.
opacity
>
0.001
0
&&
m
.
scale
>
0.0010
)
w
[
0
]
=
m
.
x
,
w
[
1
]
=
m
.
y
,
w
[
2
]
=
m
.
z
,
u
=
m
.
size
*
m
.
scale
/
U
,
v
[
0
]
=
u
*
t
,
v
[
1
]
=
u
,
j
.
uniform3fv
(
A
.
screenPosition
,
w
),
j
.
uniform2fv
(
A
.
scale
,
v
),
j
.
uniform1f
(
A
.
rotation
,
m
.
rotation
),
j
.
uniform1f
(
A
.
opacity
,
m
.
opacity
),
D
(
m
.
blending
),
J
(
m
.
texture
,
1
),
j
.
drawElements
(
j
.
TRIANGLES
,
6
,
j
.
UNSIGNED_SHORT
,
0
)}
j
.
enable
(
j
.
CULL_FACE
);
j
.
enable
(
j
.
DEPTH_TEST
);
j
.
depthMask
(
N
)}
function
y
(
b
,
e
){
b
.
_modelViewMatrix
.
multiplyToArray
(
e
.
matrixWorldInverse
,
b
.
matrixWorld
,
b
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
b
.
_modelViewMatrix
).
transposeIntoArray
(
b
.
_normalMatrixArray
)}
function
G
(
b
){
var
e
,
f
,
g
,
h
;
if
(
b
instanceof
THREE
.
Mesh
){
f
=
b
.
geometry
;
for
(
e
in
f
.
geometryGroups
){
g
=
f
.
geometryGroups
[
e
];
a
:{
for
(
var
k
=
h
=
void
0
,
m
=
void
0
,
n
=
void
0
,
t
=
void
0
,
t
=
g
.
__materials
,
k
=
0
,
m
=
t
.
length
;
k
<
m
;
k
++
)
if
(
n
=
t
[
k
],
n
.
attributes
)
for
(
h
in
n
.
attributes
)
if
(
n
.
attributes
[
h
].
needsUpdate
){
h
=!
0
;
j
.
depthMask
(
N
)}
function
y
(
b
,
e
){
b
.
_modelViewMatrix
.
multiplyToArray
(
e
.
matrixWorldInverse
,
b
.
matrixWorld
,
b
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
b
.
_modelViewMatrix
).
transposeIntoArray
(
b
.
_normalMatrixArray
)}
function
G
(
b
){
var
e
,
f
,
g
,
h
;
if
(
b
instanceof
THREE
.
Mesh
){
f
=
b
.
geometry
;
for
(
e
in
f
.
geometryGroups
){
g
=
f
.
geometryGroups
[
e
];
a
:{
for
(
var
k
=
h
=
void
0
,
m
=
void
0
,
n
=
void
0
,
t
=
void
0
,
t
=
g
.
__materials
,
k
=
0
,
m
=
t
.
length
;
k
<
m
;
k
++
)
if
(
n
=
t
[
k
],
n
.
attributes
)
for
(
h
in
n
.
attributes
)
if
(
n
.
attributes
[
h
].
needsUpdate
){
h
=!
0
;
break
a
}
h
=!
1
}
if
(
f
.
__dirtyVertices
||
f
.
__dirtyMorphTargets
||
f
.
__dirtyElements
||
f
.
__dirtyUvs
||
f
.
__dirtyNormals
||
f
.
__dirtyColors
||
f
.
__dirtyTangents
||
h
)
if
(
h
=
g
,
k
=
b
,
m
=
j
.
DYNAMIC_DRAW
,
h
.
__inittedArrays
){
var
p
=
t
=
n
=
void
0
,
o
=
void
0
,
u
=
p
=
void
0
,
v
=
void
0
,
w
=
void
0
,
y
=
void
0
,
A
=
void
0
,
B
=
void
0
,
z
=
void
0
,
H
=
void
0
,
G
=
void
0
,
D
=
void
0
,
Y
=
void
0
,
C
=
void
0
,
ka
=
void
0
,
E
=
o
=
y
=
o
=
w
=
v
=
void
0
,
F
=
void
0
,
x
=
F
=
E
=
v
=
void
0
,
K
=
void
0
,
J
=
x
=
F
=
E
=
p
=
p
=
u
=
y
=
o
=
x
=
F
=
E
=
K
=
x
=
F
=
E
=
K
=
x
=
F
=
E
=
void
0
,
I
=
0
,
L
=
0
,
N
=
0
,
P
=
0
,
la
=
0
,
O
=
0
,
ga
=
0
,
aa
=
0
,
Q
=
0
,
M
=
0
,
R
=
0
,
F
=
E
=
0
,
S
=
h
.
__vertexArray
,
break
a
}
h
=!
1
}
if
(
f
.
__dirtyVertices
||
f
.
__dirtyMorphTargets
||
f
.
__dirtyElements
||
f
.
__dirtyUvs
||
f
.
__dirtyNormals
||
f
.
__dirtyColors
||
f
.
__dirtyTangents
||
h
)
if
(
h
=
g
,
k
=
b
,
m
=
j
.
DYNAMIC_DRAW
,
h
.
__inittedArrays
){
var
p
=
t
=
n
=
void
0
,
o
=
void
0
,
u
=
p
=
void
0
,
v
=
void
0
,
w
=
void
0
,
y
=
void
0
,
A
=
void
0
,
B
=
void
0
,
z
=
void
0
,
H
=
void
0
,
G
=
void
0
,
D
=
void
0
,
Y
=
void
0
,
C
=
void
0
,
ka
=
void
0
,
E
=
o
=
y
=
o
=
w
=
v
=
void
0
,
F
=
void
0
,
x
=
F
=
E
=
v
=
void
0
,
K
=
void
0
,
J
=
x
=
F
=
E
=
p
=
p
=
u
=
y
=
o
=
x
=
F
=
E
=
K
=
x
=
F
=
E
=
K
=
x
=
F
=
E
=
void
0
,
I
=
0
,
L
=
0
,
N
=
0
,
P
=
0
,
la
=
0
,
O
=
0
,
ga
=
0
,
aa
=
0
,
Q
=
0
,
M
=
0
,
R
=
0
,
F
=
E
=
0
,
S
=
h
.
__vertexArray
,
ca
=
h
.
__uvArray
,
ea
=
h
.
__uv2Array
,
da
=
h
.
__normalArray
,
T
=
h
.
__tangentArray
,
Z
=
h
.
__colorArray
,
U
=
h
.
__skinVertexAArray
,
W
=
h
.
__skinVertexBArray
,
X
=
h
.
__skinIndexArray
,
$
=
h
.
__skinWeightArray
,
Da
=
h
.
__morphTargetsArrays
,
ia
=
h
.
__webglCustomAttributes
,
x
=
void
0
,
fa
=
h
.
__faceArray
,
ha
=
h
.
__lineArray
,
na
=
h
.
__needsSmoothNormals
,
B
=
h
.
__vertexColorType
,
A
=
h
.
__uvType
,
z
=
h
.
__normalType
,
ja
=
k
.
geometry
,
ua
=
ja
.
__dirtyVertices
,
ta
=
ja
.
__dirtyElements
,
oa
=
ja
.
__dirtyUvs
,
qa
=
ja
.
__dirtyNormals
,
Aa
=
ja
.
__dirtyTangents
,
va
=
ja
.
__dirtyColors
,
ya
=
ja
.
__dirtyMorphTargets
,
ca
=
h
.
__uvArray
,
ea
=
h
.
__uv2Array
,
da
=
h
.
__normalArray
,
T
=
h
.
__tangentArray
,
Z
=
h
.
__colorArray
,
U
=
h
.
__skinVertexAArray
,
W
=
h
.
__skinVertexBArray
,
X
=
h
.
__skinIndexArray
,
$
=
h
.
__skinWeightArray
,
Da
=
h
.
__morphTargetsArrays
,
ia
=
h
.
__webglCustomAttributes
,
x
=
void
0
,
fa
=
h
.
__faceArray
,
ha
=
h
.
__lineArray
,
na
=
h
.
__needsSmoothNormals
,
B
=
h
.
__vertexColorType
,
A
=
h
.
__uvType
,
z
=
h
.
__normalType
,
ja
=
k
.
geometry
,
ua
=
ja
.
__dirtyVertices
,
ta
=
ja
.
__dirtyElements
,
oa
=
ja
.
__dirtyUvs
,
qa
=
ja
.
__dirtyNormals
,
Aa
=
ja
.
__dirtyTangents
,
va
=
ja
.
__dirtyColors
,
ya
=
ja
.
__dirtyMorphTargets
,
...
@@ -370,7 +370,7 @@ this.getPrevKeyWith("pos",u,h.index-1).pos,this.points[1]=g,this.points[2]=k,thi
...
@@ -370,7 +370,7 @@ this.getPrevKeyWith("pos",u,h.index-1).pos,this.points[1]=g,this.points[2]=k,thi
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
b
,
c
){
var
e
=
[],
f
=
[],
g
,
k
,
h
,
m
,
n
,
o
;
g
=
(
b
.
length
-
1
)
*
c
;
k
=
Math
.
floor
(
g
);
g
-=
k
;
e
[
0
]
=
k
==
0
?
k
:
k
-
1
;
e
[
1
]
=
k
;
e
[
2
]
=
k
>
b
.
length
-
2
?
k
:
k
+
1
;
e
[
3
]
=
k
>
b
.
length
-
3
?
k
:
k
+
2
;
k
=
b
[
e
[
0
]];
m
=
b
[
e
[
1
]];
n
=
b
[
e
[
2
]];
o
=
b
[
e
[
3
]];
e
=
g
*
g
;
h
=
g
*
e
;
f
[
0
]
=
this
.
interpolate
(
k
[
0
],
m
[
0
],
n
[
0
],
o
[
0
],
g
,
e
,
h
);
f
[
1
]
=
this
.
interpolate
(
k
[
1
],
m
[
1
],
n
[
1
],
o
[
1
],
g
,
e
,
h
);
f
[
2
]
=
this
.
interpolate
(
k
[
2
],
m
[
2
],
n
[
2
],
o
[
2
],
g
,
e
,
h
);
return
f
};
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
b
,
c
){
var
e
=
[],
f
=
[],
g
,
k
,
h
,
m
,
n
,
o
;
g
=
(
b
.
length
-
1
)
*
c
;
k
=
Math
.
floor
(
g
);
g
-=
k
;
e
[
0
]
=
k
==
0
?
k
:
k
-
1
;
e
[
1
]
=
k
;
e
[
2
]
=
k
>
b
.
length
-
2
?
k
:
k
+
1
;
e
[
3
]
=
k
>
b
.
length
-
3
?
k
:
k
+
2
;
k
=
b
[
e
[
0
]];
m
=
b
[
e
[
1
]];
n
=
b
[
e
[
2
]];
o
=
b
[
e
[
3
]];
e
=
g
*
g
;
h
=
g
*
e
;
f
[
0
]
=
this
.
interpolate
(
k
[
0
],
m
[
0
],
n
[
0
],
o
[
0
],
g
,
e
,
h
);
f
[
1
]
=
this
.
interpolate
(
k
[
1
],
m
[
1
],
n
[
1
],
o
[
1
],
g
,
e
,
h
);
f
[
2
]
=
this
.
interpolate
(
k
[
2
],
m
[
2
],
n
[
2
],
o
[
2
],
g
,
e
,
h
);
return
f
};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
b
,
c
,
e
,
f
,
g
,
k
,
h
){
b
=
(
e
-
b
)
*
0.5
;
f
=
(
f
-
c
)
*
0.5
;
return
(
2
*
(
c
-
e
)
+
b
+
f
)
*
h
+
(
-
3
*
(
c
-
e
)
-
2
*
b
-
f
)
*
k
+
b
*
g
+
c
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
b
,
c
,
e
){
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
e
=
e
<
f
.
length
-
1
?
e
:
f
.
length
-
1
:
e
%=
f
.
length
;
e
<
f
.
length
;
e
++
)
if
(
f
[
e
][
b
]
!==
void
0
)
return
f
[
e
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
b
,
c
,
e
,
f
,
g
,
k
,
h
){
b
=
(
e
-
b
)
*
0.5
;
f
=
(
f
-
c
)
*
0.5
;
return
(
2
*
(
c
-
e
)
+
b
+
f
)
*
h
+
(
-
3
*
(
c
-
e
)
-
2
*
b
-
f
)
*
k
+
b
*
g
+
c
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
b
,
c
,
e
){
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
e
=
e
<
f
.
length
-
1
?
e
:
f
.
length
-
1
:
e
%=
f
.
length
;
e
<
f
.
length
;
e
++
)
if
(
f
[
e
][
b
]
!==
void
0
)
return
f
[
e
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
b
,
c
,
e
){
for
(
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
,
e
=
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
e
>
0
?
e
:
0
:
e
>=
0
?
e
:
e
+
f
.
length
;
e
>=
0
;
e
--
)
if
(
f
[
e
][
b
]
!==
void
0
)
return
f
[
e
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
f
.
length
-
1
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
b
,
c
,
e
){
for
(
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
,
e
=
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
e
>
0
?
e
:
0
:
e
>=
0
?
e
:
e
+
f
.
length
;
e
>=
0
;
e
--
)
if
(
f
[
e
][
b
]
!==
void
0
)
return
f
[
e
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
f
.
length
-
1
]};
THREE
.
FirstPersonCamera
=
function
(
b
){
function
c
(
b
,
c
){
return
function
(){
c
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
b
.
fov
,
b
.
aspect
,
b
.
near
,
b
.
far
,
b
.
target
);
this
.
movementSpeed
=
1
;
this
.
lookSpeed
=
0.005
;
this
.
noFly
=!
1
;
this
.
lookVertical
=!
0
;
this
.
autoForward
=!
1
;
this
.
activeLook
=!
0
;
this
.
heightSpeed
=!
1
;
this
.
heightCoef
=
1
;
this
.
heightMin
=
0
;
this
.
constrainVertical
=!
1
;
this
.
verticalMin
=
0
;
this
.
verticalMax
=
3.14
;
this
.
domElement
=
document
;
this
.
lastUpdate
=
(
new
Date
).
getTime
();
this
.
tdiff
=
0
;
if
(
b
){
if
(
b
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
THREE
.
FirstPersonCamera
=
function
(
b
){
function
c
(
b
,
c
){
return
function
(){
c
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
b
.
fov
,
b
.
aspect
,
b
.
near
,
b
.
far
,
b
.
target
);
this
.
movementSpeed
=
1
;
this
.
lookSpeed
=
0.005
0
;
this
.
noFly
=!
1
;
this
.
lookVertical
=!
0
;
this
.
autoForward
=!
1
;
this
.
activeLook
=!
0
;
this
.
heightSpeed
=!
1
;
this
.
heightCoef
=
1
;
this
.
heightMin
=
0
;
this
.
constrainVertical
=!
1
;
this
.
verticalMin
=
0
;
this
.
verticalMax
=
3.14
;
this
.
domElement
=
document
;
this
.
lastUpdate
=
(
new
Date
).
getTime
();
this
.
tdiff
=
0
;
if
(
b
){
if
(
b
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
b
.
movementSpeed
;
if
(
b
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
b
.
lookSpeed
;
if
(
b
.
noFly
!==
void
0
)
this
.
noFly
=
b
.
noFly
;
if
(
b
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
b
.
lookVertical
;
if
(
b
.
autoForward
!==
void
0
)
this
.
autoForward
=
b
.
autoForward
;
if
(
b
.
activeLook
!==
void
0
)
this
.
activeLook
=
b
.
activeLook
;
if
(
b
.
heightSpeed
!==
void
0
)
this
.
heightSpeed
=
b
.
heightSpeed
;
if
(
b
.
heightCoef
!==
void
0
)
this
.
heightCoef
=
b
.
heightCoef
;
if
(
b
.
heightMin
!==
void
0
)
this
.
heightMin
=
b
.
heightMin
;
if
(
b
.
heightMax
!==
void
0
)
this
.
heightMax
=
b
.
heightMax
;
if
(
b
.
constrainVertical
!==
b
.
movementSpeed
;
if
(
b
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
b
.
lookSpeed
;
if
(
b
.
noFly
!==
void
0
)
this
.
noFly
=
b
.
noFly
;
if
(
b
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
b
.
lookVertical
;
if
(
b
.
autoForward
!==
void
0
)
this
.
autoForward
=
b
.
autoForward
;
if
(
b
.
activeLook
!==
void
0
)
this
.
activeLook
=
b
.
activeLook
;
if
(
b
.
heightSpeed
!==
void
0
)
this
.
heightSpeed
=
b
.
heightSpeed
;
if
(
b
.
heightCoef
!==
void
0
)
this
.
heightCoef
=
b
.
heightCoef
;
if
(
b
.
heightMin
!==
void
0
)
this
.
heightMin
=
b
.
heightMin
;
if
(
b
.
heightMax
!==
void
0
)
this
.
heightMax
=
b
.
heightMax
;
if
(
b
.
constrainVertical
!==
void
0
)
this
.
constrainVertical
=
b
.
constrainVertical
;
if
(
b
.
verticalMin
!==
void
0
)
this
.
verticalMin
=
b
.
verticalMin
;
if
(
b
.
verticalMax
!==
void
0
)
this
.
verticalMax
=
b
.
verticalMax
;
if
(
b
.
domElement
!==
void
0
)
this
.
domElement
=
b
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
this
.
autoSpeedFactor
=
0
;
this
.
mouseDragOn
=
this
.
freeze
=
this
.
moveRight
=
this
.
moveLeft
=
this
.
moveBackward
=
this
.
moveForward
=!
1
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
this
.
onMouseDown
=
function
(
b
){
b
.
preventDefault
();
void
0
)
this
.
constrainVertical
=
b
.
constrainVertical
;
if
(
b
.
verticalMin
!==
void
0
)
this
.
verticalMin
=
b
.
verticalMin
;
if
(
b
.
verticalMax
!==
void
0
)
this
.
verticalMax
=
b
.
verticalMax
;
if
(
b
.
domElement
!==
void
0
)
this
.
domElement
=
b
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
this
.
autoSpeedFactor
=
0
;
this
.
mouseDragOn
=
this
.
freeze
=
this
.
moveRight
=
this
.
moveLeft
=
this
.
moveBackward
=
this
.
moveForward
=!
1
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
this
.
onMouseDown
=
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
b
.
button
){
case
0
:
this
.
moveForward
=!
0
;
break
;
case
2
:
this
.
moveBackward
=!
0
}
this
.
mouseDragOn
=!
0
};
this
.
onMouseUp
=
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
b
.
button
){
case
0
:
this
.
moveForward
=!
1
;
break
;
case
2
:
this
.
moveBackward
=!
1
}
this
.
mouseDragOn
=!
1
};
this
.
onMouseMove
=
function
(
b
){
this
.
mouseX
=
b
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
b
.
clientY
-
this
.
windowHalfY
};
this
.
onKeyDown
=
function
(
b
){
switch
(
b
.
keyCode
){
case
38
:
case
87
:
this
.
moveForward
=
b
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
b
.
button
){
case
0
:
this
.
moveForward
=!
0
;
break
;
case
2
:
this
.
moveBackward
=!
0
}
this
.
mouseDragOn
=!
0
};
this
.
onMouseUp
=
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
b
.
button
){
case
0
:
this
.
moveForward
=!
1
;
break
;
case
2
:
this
.
moveBackward
=!
1
}
this
.
mouseDragOn
=!
1
};
this
.
onMouseMove
=
function
(
b
){
this
.
mouseX
=
b
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
b
.
clientY
-
this
.
windowHalfY
};
this
.
onKeyDown
=
function
(
b
){
switch
(
b
.
keyCode
){
case
38
:
case
87
:
this
.
moveForward
=
...
@@ -382,7 +382,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
...
@@ -382,7 +382,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
THREE
.
FirstPersonCamera
.
prototype
.
translate
=
function
(
b
,
c
){
this
.
matrix
.
rotateAxis
(
c
);
if
(
this
.
noFly
)
c
.
y
=
0
;
this
.
position
.
addSelf
(
c
.
multiplyScalar
(
b
));
this
.
target
.
position
.
addSelf
(
c
.
multiplyScalar
(
b
))};
THREE
.
FirstPersonCamera
.
prototype
.
translate
=
function
(
b
,
c
){
this
.
matrix
.
rotateAxis
(
c
);
if
(
this
.
noFly
)
c
.
y
=
0
;
this
.
position
.
addSelf
(
c
.
multiplyScalar
(
b
));
this
.
target
.
position
.
addSelf
(
c
.
multiplyScalar
(
b
))};
THREE
.
PathCamera
=
function
(
b
){
function
c
(
b
,
e
,
c
,
f
){
var
g
=
{
name
:
c
,
fps
:
0.6
,
length
:
f
,
hierarchy
:[]},
h
,
k
=
e
.
getControlPointsArray
(),
m
=
e
.
getLength
(),
n
=
k
.
length
,
G
=
0
;
h
=
n
-
1
;
e
=
{
parent
:
-
1
,
keys
:[]};
e
.
keys
[
0
]
=
{
time
:
0
,
pos
:
k
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
e
.
keys
[
h
]
=
{
time
:
f
,
pos
:
k
[
h
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
h
=
1
;
h
<
n
-
1
;
h
++
)
G
=
f
*
m
.
chunks
[
h
]
/
m
.
total
,
e
.
keys
[
h
]
=
{
time
:
G
,
pos
:
k
[
h
]};
g
.
hierarchy
[
0
]
=
e
;
THREE
.
AnimationHandler
.
add
(
g
);
return
new
THREE
.
Animation
(
b
,
c
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
e
(
b
,
e
){
var
c
,
THREE
.
PathCamera
=
function
(
b
){
function
c
(
b
,
e
,
c
,
f
){
var
g
=
{
name
:
c
,
fps
:
0.6
,
length
:
f
,
hierarchy
:[]},
h
,
k
=
e
.
getControlPointsArray
(),
m
=
e
.
getLength
(),
n
=
k
.
length
,
G
=
0
;
h
=
n
-
1
;
e
=
{
parent
:
-
1
,
keys
:[]};
e
.
keys
[
0
]
=
{
time
:
0
,
pos
:
k
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
e
.
keys
[
h
]
=
{
time
:
f
,
pos
:
k
[
h
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
h
=
1
;
h
<
n
-
1
;
h
++
)
G
=
f
*
m
.
chunks
[
h
]
/
m
.
total
,
e
.
keys
[
h
]
=
{
time
:
G
,
pos
:
k
[
h
]};
g
.
hierarchy
[
0
]
=
e
;
THREE
.
AnimationHandler
.
add
(
g
);
return
new
THREE
.
Animation
(
b
,
c
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
e
(
b
,
e
){
var
c
,
f
,
h
=
new
THREE
.
Geometry
;
for
(
c
=
0
;
c
<
b
.
points
.
length
*
e
;
c
++
)
f
=
c
/
(
b
.
points
.
length
*
e
),
f
=
b
.
getPoint
(
f
),
h
.
vertices
[
c
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
f
.
x
,
f
.
y
,
f
.
z
));
return
h
}
function
f
(
b
,
c
){
var
f
=
e
(
c
,
10
),
h
=
e
(
c
,
10
),
g
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
f
,
g
);
particleObj
=
new
THREE
.
ParticleSystem
(
h
,
new
THREE
.
ParticleBasicMaterial
({
color
:
16755200
,
size
:
3
}));
lineObj
.
scale
.
set
(
1
,
1
,
1
);
b
.
addChild
(
lineObj
);
particleObj
.
scale
.
set
(
1
,
1
,
1
);
b
.
addChild
(
particleObj
);
h
=
new
THREE
.
SphereGeometry
(
1
,
f
,
h
=
new
THREE
.
Geometry
;
for
(
c
=
0
;
c
<
b
.
points
.
length
*
e
;
c
++
)
f
=
c
/
(
b
.
points
.
length
*
e
),
f
=
b
.
getPoint
(
f
),
h
.
vertices
[
c
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
f
.
x
,
f
.
y
,
f
.
z
));
return
h
}
function
f
(
b
,
c
){
var
f
=
e
(
c
,
10
),
h
=
e
(
c
,
10
),
g
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
f
,
g
);
particleObj
=
new
THREE
.
ParticleSystem
(
h
,
new
THREE
.
ParticleBasicMaterial
({
color
:
16755200
,
size
:
3
}));
lineObj
.
scale
.
set
(
1
,
1
,
1
);
b
.
addChild
(
lineObj
);
particleObj
.
scale
.
set
(
1
,
1
,
1
);
b
.
addChild
(
particleObj
);
h
=
new
THREE
.
SphereGeometry
(
1
,
16
,
8
);
g
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
c
.
points
.
length
;
i
++
)
f
=
new
THREE
.
Mesh
(
h
,
g
),
f
.
position
.
copy
(
c
.
points
[
i
]),
f
.
updateMatrix
(),
b
.
addChild
(
f
)}
THREE
.
Camera
.
call
(
this
,
b
.
fov
,
b
.
aspect
,
b
.
near
,
b
.
far
,
b
.
target
);
this
.
id
=
"
PathCamera
"
+
THREE
.
PathCameraIdCounter
++
;
this
.
duration
=
1
E4
;
this
.
waypoints
=
[];
this
.
useConstantSpeed
=!
0
;
this
.
resamplingCoef
=
50
;
this
.
debugPath
=
new
THREE
.
Object3D
;
this
.
debugDummy
=
new
THREE
.
Object3D
;
this
.
animationParent
=
new
THREE
.
Object3D
;
this
.
lookSpeed
=
0.005
;
this
.
lookHorizontal
=
16
,
8
);
g
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
c
.
points
.
length
;
i
++
)
f
=
new
THREE
.
Mesh
(
h
,
g
),
f
.
position
.
copy
(
c
.
points
[
i
]),
f
.
updateMatrix
(),
b
.
addChild
(
f
)}
THREE
.
Camera
.
call
(
this
,
b
.
fov
,
b
.
aspect
,
b
.
near
,
b
.
far
,
b
.
target
);
this
.
id
=
"
PathCamera
"
+
THREE
.
PathCameraIdCounter
++
;
this
.
duration
=
1
E4
;
this
.
waypoints
=
[];
this
.
useConstantSpeed
=!
0
;
this
.
resamplingCoef
=
50
;
this
.
debugPath
=
new
THREE
.
Object3D
;
this
.
debugDummy
=
new
THREE
.
Object3D
;
this
.
animationParent
=
new
THREE
.
Object3D
;
this
.
lookSpeed
=
0.005
0
;
this
.
lookHorizontal
=
this
.
lookVertical
=!
0
;
this
.
verticalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
horizontalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
domElement
=
document
;
if
(
b
){
if
(
b
.
duration
!==
void
0
)
this
.
duration
=
b
.
duration
*
1
E3
;
if
(
b
.
waypoints
!==
void
0
)
this
.
waypoints
=
b
.
waypoints
;
if
(
b
.
useConstantSpeed
!==
void
0
)
this
.
useConstantSpeed
=
b
.
useConstantSpeed
;
if
(
b
.
resamplingCoef
!==
void
0
)
this
.
resamplingCoef
=
b
.
resamplingCoef
;
if
(
b
.
createDebugPath
!==
void
0
)
this
.
createDebugPath
=
b
.
createDebugPath
;
if
(
b
.
createDebugDummy
!==
this
.
lookVertical
=!
0
;
this
.
verticalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
horizontalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
domElement
=
document
;
if
(
b
){
if
(
b
.
duration
!==
void
0
)
this
.
duration
=
b
.
duration
*
1
E3
;
if
(
b
.
waypoints
!==
void
0
)
this
.
waypoints
=
b
.
waypoints
;
if
(
b
.
useConstantSpeed
!==
void
0
)
this
.
useConstantSpeed
=
b
.
useConstantSpeed
;
if
(
b
.
resamplingCoef
!==
void
0
)
this
.
resamplingCoef
=
b
.
resamplingCoef
;
if
(
b
.
createDebugPath
!==
void
0
)
this
.
createDebugPath
=
b
.
createDebugPath
;
if
(
b
.
createDebugDummy
!==
void
0
)
this
.
createDebugDummy
=
b
.
createDebugDummy
;
if
(
b
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
b
.
lookSpeed
;
if
(
b
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
b
.
lookVertical
;
if
(
b
.
lookHorizontal
!==
void
0
)
this
.
lookHorizontal
=
b
.
lookHorizontal
;
if
(
b
.
verticalAngleMap
!==
void
0
)
this
.
verticalAngleMap
=
b
.
verticalAngleMap
;
if
(
b
.
horizontalAngleMap
!==
void
0
)
this
.
horizontalAngleMap
=
b
.
horizontalAngleMap
;
if
(
b
.
domElement
!==
void
0
)
this
.
domElement
=
b
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
0
;
this
.
windowHalfX
=
void
0
)
this
.
createDebugDummy
=
b
.
createDebugDummy
;
if
(
b
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
b
.
lookSpeed
;
if
(
b
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
b
.
lookVertical
;
if
(
b
.
lookHorizontal
!==
void
0
)
this
.
lookHorizontal
=
b
.
lookHorizontal
;
if
(
b
.
verticalAngleMap
!==
void
0
)
this
.
verticalAngleMap
=
b
.
verticalAngleMap
;
if
(
b
.
horizontalAngleMap
!==
void
0
)
this
.
horizontalAngleMap
=
b
.
horizontalAngleMap
;
if
(
b
.
domElement
!==
void
0
)
this
.
domElement
=
b
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
0
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
var
g
=
Math
.
PI
*
2
,
k
=
Math
.
PI
/
180
;
this
.
update
=
function
(
b
,
e
,
c
){
var
f
,
h
;
this
.
lookHorizontal
&&
(
this
.
lon
+=
this
.
mouseX
*
this
.
lookSpeed
);
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
this
.
lookSpeed
);
this
.
lon
=
Math
.
max
(
0
,
Math
.
min
(
360
,
this
.
lon
));
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
k
;
this
.
theta
=
this
.
lon
*
k
;
f
=
this
.
phi
%
g
;
this
.
phi
=
f
>=
0
?
f
:
f
+
g
;
f
=
this
.
verticalAngleMap
.
srcRange
;
h
=
this
.
verticalAngleMap
.
dstRange
;
var
m
=
h
[
1
]
-
h
[
0
];
this
.
phi
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
var
g
=
Math
.
PI
*
2
,
k
=
Math
.
PI
/
180
;
this
.
update
=
function
(
b
,
e
,
c
){
var
f
,
h
;
this
.
lookHorizontal
&&
(
this
.
lon
+=
this
.
mouseX
*
this
.
lookSpeed
);
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
this
.
lookSpeed
);
this
.
lon
=
Math
.
max
(
0
,
Math
.
min
(
360
,
this
.
lon
));
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
k
;
this
.
theta
=
this
.
lon
*
k
;
f
=
this
.
phi
%
g
;
this
.
phi
=
f
>=
0
?
f
:
f
+
g
;
f
=
this
.
verticalAngleMap
.
srcRange
;
h
=
this
.
verticalAngleMap
.
dstRange
;
var
m
=
h
[
1
]
-
h
[
0
];
this
.
phi
=
...
@@ -390,7 +390,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h
...
@@ -390,7 +390,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h
b
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
b
.
clientY
-
this
.
windowHalfY
};
this
.
spline
=
new
THREE
.
Spline
;
this
.
spline
.
initFromArray
(
this
.
waypoints
);
this
.
useConstantSpeed
&&
this
.
spline
.
reparametrizeByArcLength
(
this
.
resamplingCoef
);
if
(
this
.
createDebugDummy
){
var
b
=
new
THREE
.
MeshLambertMaterial
({
color
:
30719
}),
h
=
new
THREE
.
MeshLambertMaterial
({
color
:
65280
}),
m
=
new
THREE
.
CubeGeometry
(
10
,
10
,
20
),
n
=
new
THREE
.
CubeGeometry
(
2
,
2
,
10
);
this
.
animationParent
=
new
THREE
.
Mesh
(
m
,
b
);
b
=
new
THREE
.
Mesh
(
n
,
h
);
b
.
position
.
set
(
0
,
10
,
0
);
this
.
animation
=
b
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
b
.
clientY
-
this
.
windowHalfY
};
this
.
spline
=
new
THREE
.
Spline
;
this
.
spline
.
initFromArray
(
this
.
waypoints
);
this
.
useConstantSpeed
&&
this
.
spline
.
reparametrizeByArcLength
(
this
.
resamplingCoef
);
if
(
this
.
createDebugDummy
){
var
b
=
new
THREE
.
MeshLambertMaterial
({
color
:
30719
}),
h
=
new
THREE
.
MeshLambertMaterial
({
color
:
65280
}),
m
=
new
THREE
.
CubeGeometry
(
10
,
10
,
20
),
n
=
new
THREE
.
CubeGeometry
(
2
,
2
,
10
);
this
.
animationParent
=
new
THREE
.
Mesh
(
m
,
b
);
b
=
new
THREE
.
Mesh
(
n
,
h
);
b
.
position
.
set
(
0
,
10
,
0
);
this
.
animation
=
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
);
this
.
animationParent
.
addChild
(
this
);
this
.
animationParent
.
addChild
(
this
.
target
);
this
.
animationParent
.
addChild
(
b
)}
else
this
.
animation
=
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
),
this
.
animationParent
.
addChild
(
this
.
target
),
this
.
animationParent
.
addChild
(
this
);
this
.
createDebugPath
&&
f
(
this
.
debugPath
,
this
.
spline
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
function
(
b
,
e
){
return
function
(){
e
.
apply
(
b
,
arguments
)}}(
this
,
this
.
onMouseMove
),
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
);
this
.
animationParent
.
addChild
(
this
);
this
.
animationParent
.
addChild
(
this
.
target
);
this
.
animationParent
.
addChild
(
b
)}
else
this
.
animation
=
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
),
this
.
animationParent
.
addChild
(
this
.
target
),
this
.
animationParent
.
addChild
(
this
);
this
.
createDebugPath
&&
f
(
this
.
debugPath
,
this
.
spline
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
function
(
b
,
e
){
return
function
(){
e
.
apply
(
b
,
arguments
)}}(
this
,
this
.
onMouseMove
),
!
1
)};
THREE
.
PathCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PathCamera
.
prototype
.
constructor
=
THREE
.
PathCamera
;
THREE
.
PathCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
PathCameraIdCounter
=
0
;
!
1
)};
THREE
.
PathCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PathCamera
.
prototype
.
constructor
=
THREE
.
PathCamera
;
THREE
.
PathCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
PathCameraIdCounter
=
0
;
THREE
.
FlyCamera
=
function
(
b
){
function
c
(
b
,
c
){
return
function
(){
c
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
b
.
fov
,
b
.
aspect
,
b
.
near
,
b
.
far
,
b
.
target
);
this
.
tmpQuaternion
=
new
THREE
.
Quaternion
;
this
.
movementSpeed
=
1
;
this
.
rollSpeed
=
0.005
;
this
.
autoForward
=
this
.
dragToLook
=!
1
;
this
.
domElement
=
document
;
if
(
b
){
if
(
b
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
b
.
movementSpeed
;
if
(
b
.
rollSpeed
!==
void
0
)
this
.
rollSpeed
=
b
.
rollSpeed
;
if
(
b
.
dragToLook
!==
void
0
)
this
.
dragToLook
=
b
.
dragToLook
;
if
(
b
.
autoForward
!==
void
0
)
this
.
autoForward
=
THREE
.
FlyCamera
=
function
(
b
){
function
c
(
b
,
c
){
return
function
(){
c
.
apply
(
b
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
b
.
fov
,
b
.
aspect
,
b
.
near
,
b
.
far
,
b
.
target
);
this
.
tmpQuaternion
=
new
THREE
.
Quaternion
;
this
.
movementSpeed
=
1
;
this
.
rollSpeed
=
0.005
0
;
this
.
autoForward
=
this
.
dragToLook
=!
1
;
this
.
domElement
=
document
;
if
(
b
){
if
(
b
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
b
.
movementSpeed
;
if
(
b
.
rollSpeed
!==
void
0
)
this
.
rollSpeed
=
b
.
rollSpeed
;
if
(
b
.
dragToLook
!==
void
0
)
this
.
dragToLook
=
b
.
dragToLook
;
if
(
b
.
autoForward
!==
void
0
)
this
.
autoForward
=
b
.
autoForward
;
if
(
b
.
domElement
!==
void
0
)
this
.
domElement
=
b
.
domElement
}
this
.
useTarget
=!
1
;
this
.
useQuaternion
=!
0
;
this
.
mouseStatus
=
0
;
this
.
moveState
=
{
up
:
0
,
down
:
0
,
left
:
0
,
right
:
0
,
forward
:
0
,
back
:
0
,
pitchUp
:
0
,
pitchDown
:
0
,
yawLeft
:
0
,
yawRight
:
0
,
rollLeft
:
0
,
rollRight
:
0
};
this
.
moveVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
rotationVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
lastUpdate
=-
1
;
this
.
tdiff
=
0
;
this
.
handleEvent
=
function
(
b
){
if
(
typeof
this
[
b
.
type
]
==
"
function
"
)
this
[
b
.
type
](
b
)};
this
.
keydown
=
function
(
b
){
if
(
!
b
.
altKey
){
switch
(
b
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
b
.
autoForward
;
if
(
b
.
domElement
!==
void
0
)
this
.
domElement
=
b
.
domElement
}
this
.
useTarget
=!
1
;
this
.
useQuaternion
=!
0
;
this
.
mouseStatus
=
0
;
this
.
moveState
=
{
up
:
0
,
down
:
0
,
left
:
0
,
right
:
0
,
forward
:
0
,
back
:
0
,
pitchUp
:
0
,
pitchDown
:
0
,
yawLeft
:
0
,
yawRight
:
0
,
rollLeft
:
0
,
rollRight
:
0
};
this
.
moveVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
rotationVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
lastUpdate
=-
1
;
this
.
tdiff
=
0
;
this
.
handleEvent
=
function
(
b
){
if
(
typeof
this
[
b
.
type
]
==
"
function
"
)
this
[
b
.
type
](
b
)};
this
.
keydown
=
function
(
b
){
if
(
!
b
.
altKey
){
switch
(
b
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
0.1
;
break
;
case
87
:
this
.
moveState
.
forward
=
1
;
break
;
case
83
:
this
.
moveState
.
back
=
1
;
break
;
case
65
:
this
.
moveState
.
left
=
1
;
break
;
case
68
:
this
.
moveState
.
right
=
1
;
break
;
case
82
:
this
.
moveState
.
up
=
1
;
break
;
case
70
:
this
.
moveState
.
down
=
1
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
1
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
1
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
1
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
1
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
1
;
break
;
case
69
:
this
.
moveState
.
rollRight
=
1
}
this
.
updateMovementVector
();
this
.
updateRotationVector
()}};
0.1
;
break
;
case
87
:
this
.
moveState
.
forward
=
1
;
break
;
case
83
:
this
.
moveState
.
back
=
1
;
break
;
case
65
:
this
.
moveState
.
left
=
1
;
break
;
case
68
:
this
.
moveState
.
right
=
1
;
break
;
case
82
:
this
.
moveState
.
up
=
1
;
break
;
case
70
:
this
.
moveState
.
down
=
1
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
1
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
1
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
1
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
1
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
1
;
break
;
case
69
:
this
.
moveState
.
rollRight
=
1
}
this
.
updateMovementVector
();
this
.
updateRotationVector
()}};
this
.
keyup
=
function
(
b
){
switch
(
b
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
1
;
break
;
case
87
:
this
.
moveState
.
forward
=
0
;
break
;
case
83
:
this
.
moveState
.
back
=
0
;
break
;
case
65
:
this
.
moveState
.
left
=
0
;
break
;
case
68
:
this
.
moveState
.
right
=
0
;
break
;
case
82
:
this
.
moveState
.
up
=
0
;
break
;
case
70
:
this
.
moveState
.
down
=
0
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
0
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
0
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
0
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
0
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
0
;
break
;
this
.
keyup
=
function
(
b
){
switch
(
b
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
1
;
break
;
case
87
:
this
.
moveState
.
forward
=
0
;
break
;
case
83
:
this
.
moveState
.
back
=
0
;
break
;
case
65
:
this
.
moveState
.
left
=
0
;
break
;
case
68
:
this
.
moveState
.
right
=
0
;
break
;
case
82
:
this
.
moveState
.
up
=
0
;
break
;
case
70
:
this
.
moveState
.
down
=
0
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
0
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
0
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
0
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
0
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
0
;
break
;
...
@@ -428,7 +428,7 @@ f));e instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(t.position.x,t.
...
@@ -428,7 +428,7 @@ f));e instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(t.position.x,t.
THREE
.
IcosahedronGeometry
=
function
(
b
){
function
c
(
b
,
e
,
c
){
var
f
=
Math
.
sqrt
(
b
*
b
+
e
*
e
+
c
*
c
);
return
g
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
b
/
f
,
e
/
f
,
c
/
f
)))
-
1
}
function
e
(
b
,
e
,
c
,
f
){
f
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
e
,
c
))}
function
f
(
b
,
e
){
var
f
=
g
.
vertices
[
b
].
position
,
h
=
g
.
vertices
[
e
].
position
;
return
c
((
f
.
x
+
h
.
x
)
/
2
,(
f
.
y
+
h
.
y
)
/
2
,(
f
.
z
+
h
.
z
)
/
2
)}
var
g
=
this
,
k
=
new
THREE
.
Geometry
,
h
;
this
.
subdivisions
=
b
||
0
;
THREE
.
Geometry
.
call
(
this
);
b
=
(
1
+
Math
.
sqrt
(
5
))
/
2
;
c
(
-
1
,
b
,
0
);
c
(
1
,
b
,
0
);
c
(
-
1
,
-
b
,
0
);
c
(
1
,
-
b
,
0
);
c
(
0
,
-
1
,
b
);
c
(
0
,
1
,
b
);
c
(
0
,
-
1
,
THREE
.
IcosahedronGeometry
=
function
(
b
){
function
c
(
b
,
e
,
c
){
var
f
=
Math
.
sqrt
(
b
*
b
+
e
*
e
+
c
*
c
);
return
g
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
b
/
f
,
e
/
f
,
c
/
f
)))
-
1
}
function
e
(
b
,
e
,
c
,
f
){
f
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
e
,
c
))}
function
f
(
b
,
e
){
var
f
=
g
.
vertices
[
b
].
position
,
h
=
g
.
vertices
[
e
].
position
;
return
c
((
f
.
x
+
h
.
x
)
/
2
,(
f
.
y
+
h
.
y
)
/
2
,(
f
.
z
+
h
.
z
)
/
2
)}
var
g
=
this
,
k
=
new
THREE
.
Geometry
,
h
;
this
.
subdivisions
=
b
||
0
;
THREE
.
Geometry
.
call
(
this
);
b
=
(
1
+
Math
.
sqrt
(
5
))
/
2
;
c
(
-
1
,
b
,
0
);
c
(
1
,
b
,
0
);
c
(
-
1
,
-
b
,
0
);
c
(
1
,
-
b
,
0
);
c
(
0
,
-
1
,
b
);
c
(
0
,
1
,
b
);
c
(
0
,
-
1
,
-
b
);
c
(
0
,
1
,
-
b
);
c
(
b
,
0
,
-
1
);
c
(
b
,
0
,
1
);
c
(
-
b
,
0
,
-
1
);
c
(
-
b
,
0
,
1
);
e
(
0
,
11
,
5
,
k
);
e
(
0
,
5
,
1
,
k
);
e
(
0
,
1
,
7
,
k
);
e
(
0
,
7
,
10
,
k
);
e
(
0
,
10
,
11
,
k
);
e
(
1
,
5
,
9
,
k
);
e
(
5
,
11
,
4
,
k
);
e
(
11
,
10
,
2
,
k
);
e
(
10
,
7
,
6
,
k
);
e
(
7
,
1
,
8
,
k
);
e
(
3
,
9
,
4
,
k
);
e
(
3
,
4
,
2
,
k
);
e
(
3
,
2
,
6
,
k
);
e
(
3
,
6
,
8
,
k
);
e
(
3
,
8
,
9
,
k
);
e
(
4
,
9
,
5
,
k
);
e
(
2
,
4
,
11
,
k
);
e
(
6
,
2
,
10
,
k
);
e
(
8
,
6
,
7
,
k
);
e
(
9
,
8
,
1
,
k
);
for
(
b
=
0
;
b
<
this
.
subdivisions
;
b
++
){
h
=
new
THREE
.
Geometry
;
for
(
var
m
in
k
.
faces
){
var
n
=
f
(
k
.
faces
[
m
].
a
,
k
.
faces
[
m
].
b
),
o
=
f
(
k
.
faces
[
m
].
b
,
k
.
faces
[
m
].
c
),
p
=
f
(
k
.
faces
[
m
].
c
,
k
.
faces
[
m
].
a
);
e
(
k
.
faces
[
m
].
a
,
n
,
p
,
h
);
e
(
k
.
faces
[
m
].
b
,
o
,
n
,
h
);
-
b
);
c
(
0
,
1
,
-
b
);
c
(
b
,
0
,
-
1
);
c
(
b
,
0
,
1
);
c
(
-
b
,
0
,
-
1
);
c
(
-
b
,
0
,
1
);
e
(
0
,
11
,
5
,
k
);
e
(
0
,
5
,
1
,
k
);
e
(
0
,
1
,
7
,
k
);
e
(
0
,
7
,
10
,
k
);
e
(
0
,
10
,
11
,
k
);
e
(
1
,
5
,
9
,
k
);
e
(
5
,
11
,
4
,
k
);
e
(
11
,
10
,
2
,
k
);
e
(
10
,
7
,
6
,
k
);
e
(
7
,
1
,
8
,
k
);
e
(
3
,
9
,
4
,
k
);
e
(
3
,
4
,
2
,
k
);
e
(
3
,
2
,
6
,
k
);
e
(
3
,
6
,
8
,
k
);
e
(
3
,
8
,
9
,
k
);
e
(
4
,
9
,
5
,
k
);
e
(
2
,
4
,
11
,
k
);
e
(
6
,
2
,
10
,
k
);
e
(
8
,
6
,
7
,
k
);
e
(
9
,
8
,
1
,
k
);
for
(
b
=
0
;
b
<
this
.
subdivisions
;
b
++
){
h
=
new
THREE
.
Geometry
;
for
(
var
m
in
k
.
faces
){
var
n
=
f
(
k
.
faces
[
m
].
a
,
k
.
faces
[
m
].
b
),
o
=
f
(
k
.
faces
[
m
].
b
,
k
.
faces
[
m
].
c
),
p
=
f
(
k
.
faces
[
m
].
c
,
k
.
faces
[
m
].
a
);
e
(
k
.
faces
[
m
].
a
,
n
,
p
,
h
);
e
(
k
.
faces
[
m
].
b
,
o
,
n
,
h
);
e
(
k
.
faces
[
m
].
c
,
p
,
o
,
h
);
e
(
n
,
o
,
p
,
h
)}
k
.
faces
=
h
.
faces
}
g
.
faces
=
k
.
faces
;
delete
k
;
delete
h
;
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
IcosahedronGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
IcosahedronGeometry
.
prototype
.
constructor
=
THREE
.
IcosahedronGeometry
;
e
(
k
.
faces
[
m
].
c
,
p
,
o
,
h
);
e
(
n
,
o
,
p
,
h
)}
k
.
faces
=
h
.
faces
}
g
.
faces
=
k
.
faces
;
delete
k
;
delete
h
;
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
IcosahedronGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
IcosahedronGeometry
.
prototype
.
constructor
=
THREE
.
IcosahedronGeometry
;
THREE
.
LatheGeometry
=
function
(
b
,
c
,
e
){
THREE
.
Geometry
.
call
(
this
);
this
.
steps
=
c
||
12
;
this
.
angle
=
e
||
2
*
Math
.
PI
;
for
(
var
c
=
this
.
angle
/
this
.
steps
,
e
=
[],
f
=
[],
g
=
[],
k
=
[],
h
=
(
new
THREE
.
Matrix4
).
setRotationZ
(
c
),
m
=
0
;
m
<
b
.
length
;
m
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
b
[
m
])),
e
[
m
]
=
b
[
m
].
clone
(),
f
[
m
]
=
this
.
vertices
.
length
-
1
;
for
(
var
n
=
0
;
n
<=
this
.
angle
+
0.001
;
n
+=
c
){
for
(
m
=
0
;
m
<
e
.
length
;
m
++
)
n
<
this
.
angle
?(
e
[
m
]
=
h
.
multiplyVector3
(
e
[
m
].
clone
()),
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
e
[
m
])),
g
[
m
]
=
this
.
vertices
.
length
-
1
):
g
=
k
;
n
==
0
&&
(
k
=
f
);
THREE
.
LatheGeometry
=
function
(
b
,
c
,
e
){
THREE
.
Geometry
.
call
(
this
);
this
.
steps
=
c
||
12
;
this
.
angle
=
e
||
2
*
Math
.
PI
;
for
(
var
c
=
this
.
angle
/
this
.
steps
,
e
=
[],
f
=
[],
g
=
[],
k
=
[],
h
=
(
new
THREE
.
Matrix4
).
setRotationZ
(
c
),
m
=
0
;
m
<
b
.
length
;
m
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
b
[
m
])),
e
[
m
]
=
b
[
m
].
clone
(),
f
[
m
]
=
this
.
vertices
.
length
-
1
;
for
(
var
n
=
0
;
n
<=
this
.
angle
+
0.001
0
;
n
+=
c
){
for
(
m
=
0
;
m
<
e
.
length
;
m
++
)
n
<
this
.
angle
?(
e
[
m
]
=
h
.
multiplyVector3
(
e
[
m
].
clone
()),
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
e
[
m
])),
g
[
m
]
=
this
.
vertices
.
length
-
1
):
g
=
k
;
n
==
0
&&
(
k
=
f
);
for
(
m
=
0
;
m
<
f
.
length
-
1
;
m
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
g
[
m
],
g
[
m
+
1
],
f
[
m
+
1
],
f
[
m
])),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
1
-
n
/
this
.
angle
,
m
/
b
.
length
),
new
THREE
.
UV
(
1
-
n
/
this
.
angle
,(
m
+
1
)
/
b
.
length
),
new
THREE
.
UV
(
1
-
(
n
-
c
)
/
this
.
angle
,(
m
+
1
)
/
b
.
length
),
new
THREE
.
UV
(
1
-
(
n
-
c
)
/
this
.
angle
,
m
/
b
.
length
)]);
f
=
g
;
g
=
[]}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
LatheGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
LatheGeometry
.
prototype
.
constructor
=
THREE
.
LatheGeometry
;
for
(
m
=
0
;
m
<
f
.
length
-
1
;
m
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
g
[
m
],
g
[
m
+
1
],
f
[
m
+
1
],
f
[
m
])),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
1
-
n
/
this
.
angle
,
m
/
b
.
length
),
new
THREE
.
UV
(
1
-
n
/
this
.
angle
,(
m
+
1
)
/
b
.
length
),
new
THREE
.
UV
(
1
-
(
n
-
c
)
/
this
.
angle
,(
m
+
1
)
/
b
.
length
),
new
THREE
.
UV
(
1
-
(
n
-
c
)
/
this
.
angle
,
m
/
b
.
length
)]);
f
=
g
;
g
=
[]}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
LatheGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
LatheGeometry
.
prototype
.
constructor
=
THREE
.
LatheGeometry
;
THREE
.
PlaneGeometry
=
function
(
b
,
c
,
e
,
f
){
THREE
.
Geometry
.
call
(
this
);
var
g
,
k
=
b
/
2
,
h
=
c
/
2
,
e
=
e
||
1
,
f
=
f
||
1
,
m
=
e
+
1
,
n
=
f
+
1
;
b
/=
e
;
var
o
=
c
/
f
;
for
(
g
=
0
;
g
<
n
;
g
++
)
for
(
c
=
0
;
c
<
m
;
c
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
c
*
b
-
k
,
-
(
g
*
o
-
h
),
0
)));
for
(
g
=
0
;
g
<
f
;
g
++
)
for
(
c
=
0
;
c
<
e
;
c
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
c
+
m
*
g
,
c
+
m
*
(
g
+
1
),
c
+
1
+
m
*
(
g
+
1
),
c
+
1
+
m
*
g
)),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
c
/
e
,
g
/
f
),
new
THREE
.
UV
(
c
/
e
,(
g
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
e
,(
g
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
e
,
g
/
f
)]);
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
PlaneGeometry
=
function
(
b
,
c
,
e
,
f
){
THREE
.
Geometry
.
call
(
this
);
var
g
,
k
=
b
/
2
,
h
=
c
/
2
,
e
=
e
||
1
,
f
=
f
||
1
,
m
=
e
+
1
,
n
=
f
+
1
;
b
/=
e
;
var
o
=
c
/
f
;
for
(
g
=
0
;
g
<
n
;
g
++
)
for
(
c
=
0
;
c
<
m
;
c
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
c
*
b
-
k
,
-
(
g
*
o
-
h
),
0
)));
for
(
g
=
0
;
g
<
f
;
g
++
)
for
(
c
=
0
;
c
<
e
;
c
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
c
+
m
*
g
,
c
+
m
*
(
g
+
1
),
c
+
1
+
m
*
(
g
+
1
),
c
+
1
+
m
*
g
)),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
c
/
e
,
g
/
f
),
new
THREE
.
UV
(
c
/
e
,(
g
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
e
,(
g
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
e
,
g
/
f
)]);
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
PlaneGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
PlaneGeometry
.
prototype
.
constructor
=
THREE
.
PlaneGeometry
;
THREE
.
PlaneGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
PlaneGeometry
.
prototype
.
constructor
=
THREE
.
PlaneGeometry
;
...
...
build/custom/ThreeCanvas.js
浏览文件 @
57936758
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
e
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
f
*
g
+
c
*
h
-
d
*
e
;
this
.
y
=
c
*
a
+
f
*
e
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
f
*
h
+
b
*
e
-
c
*
g
;
this
.
w
=
f
*
a
-
b
*
g
-
c
*
e
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
,
g
=
this
.
x
,
e
=
this
.
y
,
h
=
this
.
z
,
i
=
this
.
w
,
l
=
i
*
c
+
e
*
f
-
h
*
d
,
m
=
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
f
=
this
.
w
,
g
=
a
.
x
,
e
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
f
*
g
+
c
*
h
-
d
*
e
;
this
.
y
=
c
*
a
+
f
*
e
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
f
*
h
+
b
*
e
-
c
*
g
;
this
.
w
=
f
*
a
-
b
*
g
-
c
*
e
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
f
=
a
.
z
,
g
=
this
.
x
,
e
=
this
.
y
,
h
=
this
.
z
,
i
=
this
.
w
,
l
=
i
*
c
+
e
*
f
-
h
*
d
,
m
=
i
*
d
+
h
*
c
-
g
*
f
,
j
=
i
*
f
+
g
*
d
-
e
*
c
,
c
=-
g
*
c
-
e
*
d
-
h
*
f
;
b
.
x
=
l
*
i
+
c
*-
g
+
m
*-
h
-
j
*-
e
;
b
.
y
=
m
*
i
+
c
*-
e
+
j
*-
g
-
l
*-
h
;
b
.
z
=
j
*
i
+
c
*-
h
+
l
*-
e
-
m
*-
g
;
return
b
}};
i
*
d
+
h
*
c
-
g
*
f
,
j
=
i
*
f
+
g
*
d
-
e
*
c
,
c
=-
g
*
c
-
e
*
d
-
h
*
f
;
b
.
x
=
l
*
i
+
c
*-
g
+
m
*-
h
-
j
*-
e
;
b
.
y
=
m
*
i
+
c
*-
e
+
j
*-
g
-
l
*-
h
;
b
.
z
=
j
*
i
+
c
*-
h
+
l
*-
e
-
m
*-
g
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
f
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
f
)
>=
1
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
f
),
e
=
Math
.
sqrt
(
1
-
f
*
f
);
if
(
Math
.
abs
(
e
)
<
0.001
)
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
f
=
Math
.
sin
((
1
-
d
)
*
g
)
/
e
;
d
=
Math
.
sin
(
d
*
g
)
/
e
;
c
.
w
=
a
.
w
*
f
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
f
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
f
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
f
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
f
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
f
)
>=
1
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
f
),
e
=
Math
.
sqrt
(
1
-
f
*
f
);
if
(
Math
.
abs
(
e
)
<
0.001
0
)
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
f
=
Math
.
sin
((
1
-
d
)
*
g
)
/
e
;
d
=
Math
.
sin
(
d
*
g
)
/
e
;
c
.
w
=
a
.
w
*
f
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
f
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
f
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
f
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
f
,
g
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
f
,
g
,
e
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
e
instanceof
Array
?
e
:[
e
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
build/custom/ThreeDOM.js
浏览文件 @
57936758
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
e
=
this
.
w
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
j
=
this
.
w
,
i
=
j
*
c
+
f
*
e
-
h
*
d
,
k
=
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
j
=
this
.
w
,
i
=
j
*
c
+
f
*
e
-
h
*
d
,
k
=
j
*
d
+
h
*
c
-
g
*
e
,
l
=
j
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
i
*
j
+
c
*-
g
+
k
*-
h
-
l
*-
f
;
b
.
y
=
k
*
j
+
c
*-
f
+
l
*-
g
-
i
*-
h
;
b
.
z
=
l
*
j
+
c
*-
h
+
i
*-
f
-
k
*-
g
;
return
b
}};
j
*
d
+
h
*
c
-
g
*
e
,
l
=
j
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
i
*
j
+
c
*-
g
+
k
*-
h
-
l
*-
f
;
b
.
y
=
k
*
j
+
c
*-
f
+
l
*-
g
-
i
*-
h
;
b
.
z
=
l
*
j
+
c
*-
h
+
i
*-
f
-
k
*-
g
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
)
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
)
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Camera
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
fov
=
a
||
50
;
this
.
aspect
=
b
||
1
;
this
.
near
=
c
||
0.1
;
this
.
far
=
d
||
2
E3
;
this
.
target
=
e
||
new
THREE
.
Object3D
;
this
.
useTarget
=!
0
;
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
null
;
this
.
updateProjectionMatrix
()};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Camera
=
function
(
a
,
b
,
c
,
d
,
e
){
THREE
.
Object3D
.
call
(
this
);
this
.
fov
=
a
||
50
;
this
.
aspect
=
b
||
1
;
this
.
near
=
c
||
0.1
;
this
.
far
=
d
||
2
E3
;
this
.
target
=
e
||
new
THREE
.
Object3D
;
this
.
useTarget
=!
0
;
this
.
matrixWorldInverse
=
new
THREE
.
Matrix4
;
this
.
projectionMatrix
=
null
;
this
.
updateProjectionMatrix
()};
THREE
.
Camera
.
prototype
=
new
THREE
.
Object3D
;
THREE
.
Camera
.
prototype
.
constructor
=
THREE
.
Camera
;
...
...
build/custom/ThreeExtras.js
浏览文件 @
57936758
...
@@ -32,7 +32,7 @@ this.getPrevKeyWith("pos",p,g.index-1).pos,this.points[1]=e,this.points[2]=h,thi
...
@@ -32,7 +32,7 @@ this.getPrevKeyWith("pos",p,g.index-1).pos,this.points[1]=e,this.points[2]=h,thi
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
a
,
c
){
var
b
=
[],
f
=
[],
e
,
h
,
g
,
k
,
j
,
m
;
e
=
(
a
.
length
-
1
)
*
c
;
h
=
Math
.
floor
(
e
);
e
-=
h
;
b
[
0
]
=
h
==
0
?
h
:
h
-
1
;
b
[
1
]
=
h
;
b
[
2
]
=
h
>
a
.
length
-
2
?
h
:
h
+
1
;
b
[
3
]
=
h
>
a
.
length
-
3
?
h
:
h
+
2
;
h
=
a
[
b
[
0
]];
k
=
a
[
b
[
1
]];
j
=
a
[
b
[
2
]];
m
=
a
[
b
[
3
]];
b
=
e
*
e
;
g
=
e
*
b
;
f
[
0
]
=
this
.
interpolate
(
h
[
0
],
k
[
0
],
j
[
0
],
m
[
0
],
e
,
b
,
g
);
f
[
1
]
=
this
.
interpolate
(
h
[
1
],
k
[
1
],
j
[
1
],
m
[
1
],
e
,
b
,
g
);
f
[
2
]
=
this
.
interpolate
(
h
[
2
],
k
[
2
],
j
[
2
],
m
[
2
],
e
,
b
,
g
);
return
f
};
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
a
,
c
){
var
b
=
[],
f
=
[],
e
,
h
,
g
,
k
,
j
,
m
;
e
=
(
a
.
length
-
1
)
*
c
;
h
=
Math
.
floor
(
e
);
e
-=
h
;
b
[
0
]
=
h
==
0
?
h
:
h
-
1
;
b
[
1
]
=
h
;
b
[
2
]
=
h
>
a
.
length
-
2
?
h
:
h
+
1
;
b
[
3
]
=
h
>
a
.
length
-
3
?
h
:
h
+
2
;
h
=
a
[
b
[
0
]];
k
=
a
[
b
[
1
]];
j
=
a
[
b
[
2
]];
m
=
a
[
b
[
3
]];
b
=
e
*
e
;
g
=
e
*
b
;
f
[
0
]
=
this
.
interpolate
(
h
[
0
],
k
[
0
],
j
[
0
],
m
[
0
],
e
,
b
,
g
);
f
[
1
]
=
this
.
interpolate
(
h
[
1
],
k
[
1
],
j
[
1
],
m
[
1
],
e
,
b
,
g
);
f
[
2
]
=
this
.
interpolate
(
h
[
2
],
k
[
2
],
j
[
2
],
m
[
2
],
e
,
b
,
g
);
return
f
};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
a
,
c
,
b
,
f
,
e
,
h
,
g
){
a
=
(
b
-
a
)
*
0.5
;
f
=
(
f
-
c
)
*
0.5
;
return
(
2
*
(
c
-
b
)
+
a
+
f
)
*
g
+
(
-
3
*
(
c
-
b
)
-
2
*
a
-
f
)
*
h
+
a
*
e
+
c
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
a
,
c
,
b
){
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
b
=
b
<
f
.
length
-
1
?
b
:
f
.
length
-
1
:
b
%=
f
.
length
;
b
<
f
.
length
;
b
++
)
if
(
f
[
b
][
a
]
!==
void
0
)
return
f
[
b
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
a
,
c
,
b
,
f
,
e
,
h
,
g
){
a
=
(
b
-
a
)
*
0.5
;
f
=
(
f
-
c
)
*
0.5
;
return
(
2
*
(
c
-
b
)
+
a
+
f
)
*
g
+
(
-
3
*
(
c
-
b
)
-
2
*
a
-
f
)
*
h
+
a
*
e
+
c
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
a
,
c
,
b
){
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
b
=
b
<
f
.
length
-
1
?
b
:
f
.
length
-
1
:
b
%=
f
.
length
;
b
<
f
.
length
;
b
++
)
if
(
f
[
b
][
a
]
!==
void
0
)
return
f
[
b
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
a
,
c
,
b
){
for
(
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
,
b
=
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
b
>
0
?
b
:
0
:
b
>=
0
?
b
:
b
+
f
.
length
;
b
>=
0
;
b
--
)
if
(
f
[
b
][
a
]
!==
void
0
)
return
f
[
b
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
f
.
length
-
1
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
a
,
c
,
b
){
for
(
var
f
=
this
.
data
.
hierarchy
[
c
].
keys
,
b
=
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
b
>
0
?
b
:
0
:
b
>=
0
?
b
:
b
+
f
.
length
;
b
>=
0
;
b
--
)
if
(
f
[
b
][
a
]
!==
void
0
)
return
f
[
b
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
f
.
length
-
1
]};
THREE
.
FirstPersonCamera
=
function
(
a
){
function
c
(
a
,
c
){
return
function
(){
c
.
apply
(
a
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
movementSpeed
=
1
;
this
.
lookSpeed
=
0.005
;
this
.
noFly
=!
1
;
this
.
lookVertical
=!
0
;
this
.
autoForward
=!
1
;
this
.
activeLook
=!
0
;
this
.
heightSpeed
=!
1
;
this
.
heightCoef
=
1
;
this
.
heightMin
=
0
;
this
.
constrainVertical
=!
1
;
this
.
verticalMin
=
0
;
this
.
verticalMax
=
3.14
;
this
.
domElement
=
document
;
this
.
lastUpdate
=
(
new
Date
).
getTime
();
this
.
tdiff
=
0
;
if
(
a
){
if
(
a
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
THREE
.
FirstPersonCamera
=
function
(
a
){
function
c
(
a
,
c
){
return
function
(){
c
.
apply
(
a
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
movementSpeed
=
1
;
this
.
lookSpeed
=
0.005
0
;
this
.
noFly
=!
1
;
this
.
lookVertical
=!
0
;
this
.
autoForward
=!
1
;
this
.
activeLook
=!
0
;
this
.
heightSpeed
=!
1
;
this
.
heightCoef
=
1
;
this
.
heightMin
=
0
;
this
.
constrainVertical
=!
1
;
this
.
verticalMin
=
0
;
this
.
verticalMax
=
3.14
;
this
.
domElement
=
document
;
this
.
lastUpdate
=
(
new
Date
).
getTime
();
this
.
tdiff
=
0
;
if
(
a
){
if
(
a
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
a
.
movementSpeed
;
if
(
a
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
a
.
lookSpeed
;
if
(
a
.
noFly
!==
void
0
)
this
.
noFly
=
a
.
noFly
;
if
(
a
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
a
.
lookVertical
;
if
(
a
.
autoForward
!==
void
0
)
this
.
autoForward
=
a
.
autoForward
;
if
(
a
.
activeLook
!==
void
0
)
this
.
activeLook
=
a
.
activeLook
;
if
(
a
.
heightSpeed
!==
void
0
)
this
.
heightSpeed
=
a
.
heightSpeed
;
if
(
a
.
heightCoef
!==
void
0
)
this
.
heightCoef
=
a
.
heightCoef
;
if
(
a
.
heightMin
!==
void
0
)
this
.
heightMin
=
a
.
heightMin
;
if
(
a
.
heightMax
!==
void
0
)
this
.
heightMax
=
a
.
heightMax
;
if
(
a
.
constrainVertical
!==
a
.
movementSpeed
;
if
(
a
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
a
.
lookSpeed
;
if
(
a
.
noFly
!==
void
0
)
this
.
noFly
=
a
.
noFly
;
if
(
a
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
a
.
lookVertical
;
if
(
a
.
autoForward
!==
void
0
)
this
.
autoForward
=
a
.
autoForward
;
if
(
a
.
activeLook
!==
void
0
)
this
.
activeLook
=
a
.
activeLook
;
if
(
a
.
heightSpeed
!==
void
0
)
this
.
heightSpeed
=
a
.
heightSpeed
;
if
(
a
.
heightCoef
!==
void
0
)
this
.
heightCoef
=
a
.
heightCoef
;
if
(
a
.
heightMin
!==
void
0
)
this
.
heightMin
=
a
.
heightMin
;
if
(
a
.
heightMax
!==
void
0
)
this
.
heightMax
=
a
.
heightMax
;
if
(
a
.
constrainVertical
!==
void
0
)
this
.
constrainVertical
=
a
.
constrainVertical
;
if
(
a
.
verticalMin
!==
void
0
)
this
.
verticalMin
=
a
.
verticalMin
;
if
(
a
.
verticalMax
!==
void
0
)
this
.
verticalMax
=
a
.
verticalMax
;
if
(
a
.
domElement
!==
void
0
)
this
.
domElement
=
a
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
this
.
autoSpeedFactor
=
0
;
this
.
mouseDragOn
=
this
.
freeze
=
this
.
moveRight
=
this
.
moveLeft
=
this
.
moveBackward
=
this
.
moveForward
=!
1
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
this
.
onMouseDown
=
function
(
a
){
a
.
preventDefault
();
void
0
)
this
.
constrainVertical
=
a
.
constrainVertical
;
if
(
a
.
verticalMin
!==
void
0
)
this
.
verticalMin
=
a
.
verticalMin
;
if
(
a
.
verticalMax
!==
void
0
)
this
.
verticalMax
=
a
.
verticalMax
;
if
(
a
.
domElement
!==
void
0
)
this
.
domElement
=
a
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
this
.
autoSpeedFactor
=
0
;
this
.
mouseDragOn
=
this
.
freeze
=
this
.
moveRight
=
this
.
moveLeft
=
this
.
moveBackward
=
this
.
moveForward
=!
1
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
this
.
onMouseDown
=
function
(
a
){
a
.
preventDefault
();
a
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
a
.
button
){
case
0
:
this
.
moveForward
=!
0
;
break
;
case
2
:
this
.
moveBackward
=!
0
}
this
.
mouseDragOn
=!
0
};
this
.
onMouseUp
=
function
(
a
){
a
.
preventDefault
();
a
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
a
.
button
){
case
0
:
this
.
moveForward
=!
1
;
break
;
case
2
:
this
.
moveBackward
=!
1
}
this
.
mouseDragOn
=!
1
};
this
.
onMouseMove
=
function
(
a
){
this
.
mouseX
=
a
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
a
.
clientY
-
this
.
windowHalfY
};
this
.
onKeyDown
=
function
(
a
){
switch
(
a
.
keyCode
){
case
38
:
case
87
:
this
.
moveForward
=
a
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
a
.
button
){
case
0
:
this
.
moveForward
=!
0
;
break
;
case
2
:
this
.
moveBackward
=!
0
}
this
.
mouseDragOn
=!
0
};
this
.
onMouseUp
=
function
(
a
){
a
.
preventDefault
();
a
.
stopPropagation
();
if
(
this
.
activeLook
)
switch
(
a
.
button
){
case
0
:
this
.
moveForward
=!
1
;
break
;
case
2
:
this
.
moveBackward
=!
1
}
this
.
mouseDragOn
=!
1
};
this
.
onMouseMove
=
function
(
a
){
this
.
mouseX
=
a
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
a
.
clientY
-
this
.
windowHalfY
};
this
.
onKeyDown
=
function
(
a
){
switch
(
a
.
keyCode
){
case
38
:
case
87
:
this
.
moveForward
=
...
@@ -44,7 +44,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
...
@@ -44,7 +44,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
THREE
.
FirstPersonCamera
.
prototype
.
translate
=
function
(
a
,
c
){
this
.
matrix
.
rotateAxis
(
c
);
if
(
this
.
noFly
)
c
.
y
=
0
;
this
.
position
.
addSelf
(
c
.
multiplyScalar
(
a
));
this
.
target
.
position
.
addSelf
(
c
.
multiplyScalar
(
a
))};
THREE
.
FirstPersonCamera
.
prototype
.
translate
=
function
(
a
,
c
){
this
.
matrix
.
rotateAxis
(
c
);
if
(
this
.
noFly
)
c
.
y
=
0
;
this
.
position
.
addSelf
(
c
.
multiplyScalar
(
a
));
this
.
target
.
position
.
addSelf
(
c
.
multiplyScalar
(
a
))};
THREE
.
PathCamera
=
function
(
a
){
function
c
(
a
,
b
,
c
,
g
){
var
f
=
{
name
:
c
,
fps
:
0.6
,
length
:
g
,
hierarchy
:[]},
h
,
e
=
b
.
getControlPointsArray
(),
k
=
b
.
getLength
(),
j
=
e
.
length
,
x
=
0
;
h
=
j
-
1
;
b
=
{
parent
:
-
1
,
keys
:[]};
b
.
keys
[
0
]
=
{
time
:
0
,
pos
:
e
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
b
.
keys
[
h
]
=
{
time
:
g
,
pos
:
e
[
h
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
h
=
1
;
h
<
j
-
1
;
h
++
)
x
=
g
*
k
.
chunks
[
h
]
/
k
.
total
,
b
.
keys
[
h
]
=
{
time
:
x
,
pos
:
e
[
h
]};
f
.
hierarchy
[
0
]
=
b
;
THREE
.
AnimationHandler
.
add
(
f
);
return
new
THREE
.
Animation
(
a
,
c
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
b
(
a
,
b
){
var
c
,
THREE
.
PathCamera
=
function
(
a
){
function
c
(
a
,
b
,
c
,
g
){
var
f
=
{
name
:
c
,
fps
:
0.6
,
length
:
g
,
hierarchy
:[]},
h
,
e
=
b
.
getControlPointsArray
(),
k
=
b
.
getLength
(),
j
=
e
.
length
,
x
=
0
;
h
=
j
-
1
;
b
=
{
parent
:
-
1
,
keys
:[]};
b
.
keys
[
0
]
=
{
time
:
0
,
pos
:
e
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
b
.
keys
[
h
]
=
{
time
:
g
,
pos
:
e
[
h
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
h
=
1
;
h
<
j
-
1
;
h
++
)
x
=
g
*
k
.
chunks
[
h
]
/
k
.
total
,
b
.
keys
[
h
]
=
{
time
:
x
,
pos
:
e
[
h
]};
f
.
hierarchy
[
0
]
=
b
;
THREE
.
AnimationHandler
.
add
(
f
);
return
new
THREE
.
Animation
(
a
,
c
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
b
(
a
,
b
){
var
c
,
g
,
f
=
new
THREE
.
Geometry
;
for
(
c
=
0
;
c
<
a
.
points
.
length
*
b
;
c
++
)
g
=
c
/
(
a
.
points
.
length
*
b
),
g
=
a
.
getPoint
(
g
),
f
.
vertices
[
c
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
g
.
x
,
g
.
y
,
g
.
z
));
return
f
}
function
f
(
a
,
c
){
var
g
=
b
(
c
,
10
),
f
=
b
(
c
,
10
),
h
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
g
,
h
);
particleObj
=
new
THREE
.
ParticleSystem
(
f
,
new
THREE
.
ParticleBasicMaterial
({
color
:
16755200
,
size
:
3
}));
lineObj
.
scale
.
set
(
1
,
1
,
1
);
a
.
addChild
(
lineObj
);
particleObj
.
scale
.
set
(
1
,
1
,
1
);
a
.
addChild
(
particleObj
);
f
=
new
THREE
.
SphereGeometry
(
1
,
g
,
f
=
new
THREE
.
Geometry
;
for
(
c
=
0
;
c
<
a
.
points
.
length
*
b
;
c
++
)
g
=
c
/
(
a
.
points
.
length
*
b
),
g
=
a
.
getPoint
(
g
),
f
.
vertices
[
c
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
g
.
x
,
g
.
y
,
g
.
z
));
return
f
}
function
f
(
a
,
c
){
var
g
=
b
(
c
,
10
),
f
=
b
(
c
,
10
),
h
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
g
,
h
);
particleObj
=
new
THREE
.
ParticleSystem
(
f
,
new
THREE
.
ParticleBasicMaterial
({
color
:
16755200
,
size
:
3
}));
lineObj
.
scale
.
set
(
1
,
1
,
1
);
a
.
addChild
(
lineObj
);
particleObj
.
scale
.
set
(
1
,
1
,
1
);
a
.
addChild
(
particleObj
);
f
=
new
THREE
.
SphereGeometry
(
1
,
16
,
8
);
h
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
c
.
points
.
length
;
i
++
)
g
=
new
THREE
.
Mesh
(
f
,
h
),
g
.
position
.
copy
(
c
.
points
[
i
]),
g
.
updateMatrix
(),
a
.
addChild
(
g
)}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
id
=
"
PathCamera
"
+
THREE
.
PathCameraIdCounter
++
;
this
.
duration
=
1
E4
;
this
.
waypoints
=
[];
this
.
useConstantSpeed
=!
0
;
this
.
resamplingCoef
=
50
;
this
.
debugPath
=
new
THREE
.
Object3D
;
this
.
debugDummy
=
new
THREE
.
Object3D
;
this
.
animationParent
=
new
THREE
.
Object3D
;
this
.
lookSpeed
=
0.005
;
this
.
lookHorizontal
=
16
,
8
);
h
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
c
.
points
.
length
;
i
++
)
g
=
new
THREE
.
Mesh
(
f
,
h
),
g
.
position
.
copy
(
c
.
points
[
i
]),
g
.
updateMatrix
(),
a
.
addChild
(
g
)}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
id
=
"
PathCamera
"
+
THREE
.
PathCameraIdCounter
++
;
this
.
duration
=
1
E4
;
this
.
waypoints
=
[];
this
.
useConstantSpeed
=!
0
;
this
.
resamplingCoef
=
50
;
this
.
debugPath
=
new
THREE
.
Object3D
;
this
.
debugDummy
=
new
THREE
.
Object3D
;
this
.
animationParent
=
new
THREE
.
Object3D
;
this
.
lookSpeed
=
0.005
0
;
this
.
lookHorizontal
=
this
.
lookVertical
=!
0
;
this
.
verticalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
horizontalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
duration
!==
void
0
)
this
.
duration
=
a
.
duration
*
1
E3
;
if
(
a
.
waypoints
!==
void
0
)
this
.
waypoints
=
a
.
waypoints
;
if
(
a
.
useConstantSpeed
!==
void
0
)
this
.
useConstantSpeed
=
a
.
useConstantSpeed
;
if
(
a
.
resamplingCoef
!==
void
0
)
this
.
resamplingCoef
=
a
.
resamplingCoef
;
if
(
a
.
createDebugPath
!==
void
0
)
this
.
createDebugPath
=
a
.
createDebugPath
;
if
(
a
.
createDebugDummy
!==
this
.
lookVertical
=!
0
;
this
.
verticalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
horizontalAngleMap
=
{
srcRange
:[
0
,
6.28
],
dstRange
:[
0
,
6.28
]};
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
duration
!==
void
0
)
this
.
duration
=
a
.
duration
*
1
E3
;
if
(
a
.
waypoints
!==
void
0
)
this
.
waypoints
=
a
.
waypoints
;
if
(
a
.
useConstantSpeed
!==
void
0
)
this
.
useConstantSpeed
=
a
.
useConstantSpeed
;
if
(
a
.
resamplingCoef
!==
void
0
)
this
.
resamplingCoef
=
a
.
resamplingCoef
;
if
(
a
.
createDebugPath
!==
void
0
)
this
.
createDebugPath
=
a
.
createDebugPath
;
if
(
a
.
createDebugDummy
!==
void
0
)
this
.
createDebugDummy
=
a
.
createDebugDummy
;
if
(
a
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
a
.
lookSpeed
;
if
(
a
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
a
.
lookVertical
;
if
(
a
.
lookHorizontal
!==
void
0
)
this
.
lookHorizontal
=
a
.
lookHorizontal
;
if
(
a
.
verticalAngleMap
!==
void
0
)
this
.
verticalAngleMap
=
a
.
verticalAngleMap
;
if
(
a
.
horizontalAngleMap
!==
void
0
)
this
.
horizontalAngleMap
=
a
.
horizontalAngleMap
;
if
(
a
.
domElement
!==
void
0
)
this
.
domElement
=
a
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
0
;
this
.
windowHalfX
=
void
0
)
this
.
createDebugDummy
=
a
.
createDebugDummy
;
if
(
a
.
lookSpeed
!==
void
0
)
this
.
lookSpeed
=
a
.
lookSpeed
;
if
(
a
.
lookVertical
!==
void
0
)
this
.
lookVertical
=
a
.
lookVertical
;
if
(
a
.
lookHorizontal
!==
void
0
)
this
.
lookHorizontal
=
a
.
lookHorizontal
;
if
(
a
.
verticalAngleMap
!==
void
0
)
this
.
verticalAngleMap
=
a
.
verticalAngleMap
;
if
(
a
.
horizontalAngleMap
!==
void
0
)
this
.
horizontalAngleMap
=
a
.
horizontalAngleMap
;
if
(
a
.
domElement
!==
void
0
)
this
.
domElement
=
a
.
domElement
}
this
.
theta
=
this
.
phi
=
this
.
lon
=
this
.
lat
=
this
.
mouseY
=
this
.
mouseX
=
0
;
this
.
windowHalfX
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
var
e
=
Math
.
PI
*
2
,
h
=
Math
.
PI
/
180
;
this
.
update
=
function
(
a
,
b
,
c
){
var
g
,
f
;
this
.
lookHorizontal
&&
(
this
.
lon
+=
this
.
mouseX
*
this
.
lookSpeed
);
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
this
.
lookSpeed
);
this
.
lon
=
Math
.
max
(
0
,
Math
.
min
(
360
,
this
.
lon
));
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
h
;
this
.
theta
=
this
.
lon
*
h
;
g
=
this
.
phi
%
e
;
this
.
phi
=
g
>=
0
?
g
:
g
+
e
;
g
=
this
.
verticalAngleMap
.
srcRange
;
f
=
this
.
verticalAngleMap
.
dstRange
;
var
k
=
f
[
1
]
-
f
[
0
];
this
.
phi
=
window
.
innerWidth
/
2
;
this
.
windowHalfY
=
window
.
innerHeight
/
2
;
var
e
=
Math
.
PI
*
2
,
h
=
Math
.
PI
/
180
;
this
.
update
=
function
(
a
,
b
,
c
){
var
g
,
f
;
this
.
lookHorizontal
&&
(
this
.
lon
+=
this
.
mouseX
*
this
.
lookSpeed
);
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
this
.
lookSpeed
);
this
.
lon
=
Math
.
max
(
0
,
Math
.
min
(
360
,
this
.
lon
));
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
h
;
this
.
theta
=
this
.
lon
*
h
;
g
=
this
.
phi
%
e
;
this
.
phi
=
g
>=
0
?
g
:
g
+
e
;
g
=
this
.
verticalAngleMap
.
srcRange
;
f
=
this
.
verticalAngleMap
.
dstRange
;
var
k
=
f
[
1
]
-
f
[
0
];
this
.
phi
=
...
@@ -52,7 +52,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-g[0])*(f[1]-f[0])/(g[1]-g[0])+f[0]-f
...
@@ -52,7 +52,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-g[0])*(f[1]-f[0])/(g[1]-g[0])+f[0]-f
a
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
a
.
clientY
-
this
.
windowHalfY
};
this
.
spline
=
new
THREE
.
Spline
;
this
.
spline
.
initFromArray
(
this
.
waypoints
);
this
.
useConstantSpeed
&&
this
.
spline
.
reparametrizeByArcLength
(
this
.
resamplingCoef
);
if
(
this
.
createDebugDummy
){
var
a
=
new
THREE
.
MeshLambertMaterial
({
color
:
30719
}),
g
=
new
THREE
.
MeshLambertMaterial
({
color
:
65280
}),
k
=
new
THREE
.
CubeGeometry
(
10
,
10
,
20
),
j
=
new
THREE
.
CubeGeometry
(
2
,
2
,
10
);
this
.
animationParent
=
new
THREE
.
Mesh
(
k
,
a
);
a
=
new
THREE
.
Mesh
(
j
,
g
);
a
.
position
.
set
(
0
,
10
,
0
);
this
.
animation
=
a
.
clientX
-
this
.
windowHalfX
;
this
.
mouseY
=
a
.
clientY
-
this
.
windowHalfY
};
this
.
spline
=
new
THREE
.
Spline
;
this
.
spline
.
initFromArray
(
this
.
waypoints
);
this
.
useConstantSpeed
&&
this
.
spline
.
reparametrizeByArcLength
(
this
.
resamplingCoef
);
if
(
this
.
createDebugDummy
){
var
a
=
new
THREE
.
MeshLambertMaterial
({
color
:
30719
}),
g
=
new
THREE
.
MeshLambertMaterial
({
color
:
65280
}),
k
=
new
THREE
.
CubeGeometry
(
10
,
10
,
20
),
j
=
new
THREE
.
CubeGeometry
(
2
,
2
,
10
);
this
.
animationParent
=
new
THREE
.
Mesh
(
k
,
a
);
a
=
new
THREE
.
Mesh
(
j
,
g
);
a
.
position
.
set
(
0
,
10
,
0
);
this
.
animation
=
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
);
this
.
animationParent
.
addChild
(
this
);
this
.
animationParent
.
addChild
(
this
.
target
);
this
.
animationParent
.
addChild
(
a
)}
else
this
.
animation
=
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
),
this
.
animationParent
.
addChild
(
this
.
target
),
this
.
animationParent
.
addChild
(
this
);
this
.
createDebugPath
&&
f
(
this
.
debugPath
,
this
.
spline
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
function
(
a
,
b
){
return
function
(){
b
.
apply
(
a
,
arguments
)}}(
this
,
this
.
onMouseMove
),
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
);
this
.
animationParent
.
addChild
(
this
);
this
.
animationParent
.
addChild
(
this
.
target
);
this
.
animationParent
.
addChild
(
a
)}
else
this
.
animation
=
c
(
this
.
animationParent
,
this
.
spline
,
this
.
id
,
this
.
duration
),
this
.
animationParent
.
addChild
(
this
.
target
),
this
.
animationParent
.
addChild
(
this
);
this
.
createDebugPath
&&
f
(
this
.
debugPath
,
this
.
spline
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
function
(
a
,
b
){
return
function
(){
b
.
apply
(
a
,
arguments
)}}(
this
,
this
.
onMouseMove
),
!
1
)};
THREE
.
PathCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PathCamera
.
prototype
.
constructor
=
THREE
.
PathCamera
;
THREE
.
PathCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
PathCameraIdCounter
=
0
;
!
1
)};
THREE
.
PathCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
PathCamera
.
prototype
.
constructor
=
THREE
.
PathCamera
;
THREE
.
PathCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
PathCameraIdCounter
=
0
;
THREE
.
FlyCamera
=
function
(
a
){
function
c
(
a
,
c
){
return
function
(){
c
.
apply
(
a
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
tmpQuaternion
=
new
THREE
.
Quaternion
;
this
.
movementSpeed
=
1
;
this
.
rollSpeed
=
0.005
;
this
.
autoForward
=
this
.
dragToLook
=!
1
;
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
a
.
movementSpeed
;
if
(
a
.
rollSpeed
!==
void
0
)
this
.
rollSpeed
=
a
.
rollSpeed
;
if
(
a
.
dragToLook
!==
void
0
)
this
.
dragToLook
=
a
.
dragToLook
;
if
(
a
.
autoForward
!==
void
0
)
this
.
autoForward
=
THREE
.
FlyCamera
=
function
(
a
){
function
c
(
a
,
c
){
return
function
(){
c
.
apply
(
a
,
arguments
)}}
THREE
.
Camera
.
call
(
this
,
a
.
fov
,
a
.
aspect
,
a
.
near
,
a
.
far
,
a
.
target
);
this
.
tmpQuaternion
=
new
THREE
.
Quaternion
;
this
.
movementSpeed
=
1
;
this
.
rollSpeed
=
0.005
0
;
this
.
autoForward
=
this
.
dragToLook
=!
1
;
this
.
domElement
=
document
;
if
(
a
){
if
(
a
.
movementSpeed
!==
void
0
)
this
.
movementSpeed
=
a
.
movementSpeed
;
if
(
a
.
rollSpeed
!==
void
0
)
this
.
rollSpeed
=
a
.
rollSpeed
;
if
(
a
.
dragToLook
!==
void
0
)
this
.
dragToLook
=
a
.
dragToLook
;
if
(
a
.
autoForward
!==
void
0
)
this
.
autoForward
=
a
.
autoForward
;
if
(
a
.
domElement
!==
void
0
)
this
.
domElement
=
a
.
domElement
}
this
.
useTarget
=!
1
;
this
.
useQuaternion
=!
0
;
this
.
mouseStatus
=
0
;
this
.
moveState
=
{
up
:
0
,
down
:
0
,
left
:
0
,
right
:
0
,
forward
:
0
,
back
:
0
,
pitchUp
:
0
,
pitchDown
:
0
,
yawLeft
:
0
,
yawRight
:
0
,
rollLeft
:
0
,
rollRight
:
0
};
this
.
moveVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
rotationVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
lastUpdate
=-
1
;
this
.
tdiff
=
0
;
this
.
handleEvent
=
function
(
a
){
if
(
typeof
this
[
a
.
type
]
==
"
function
"
)
this
[
a
.
type
](
a
)};
this
.
keydown
=
function
(
a
){
if
(
!
a
.
altKey
){
switch
(
a
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
a
.
autoForward
;
if
(
a
.
domElement
!==
void
0
)
this
.
domElement
=
a
.
domElement
}
this
.
useTarget
=!
1
;
this
.
useQuaternion
=!
0
;
this
.
mouseStatus
=
0
;
this
.
moveState
=
{
up
:
0
,
down
:
0
,
left
:
0
,
right
:
0
,
forward
:
0
,
back
:
0
,
pitchUp
:
0
,
pitchDown
:
0
,
yawLeft
:
0
,
yawRight
:
0
,
rollLeft
:
0
,
rollRight
:
0
};
this
.
moveVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
rotationVector
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
this
.
lastUpdate
=-
1
;
this
.
tdiff
=
0
;
this
.
handleEvent
=
function
(
a
){
if
(
typeof
this
[
a
.
type
]
==
"
function
"
)
this
[
a
.
type
](
a
)};
this
.
keydown
=
function
(
a
){
if
(
!
a
.
altKey
){
switch
(
a
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
0.1
;
break
;
case
87
:
this
.
moveState
.
forward
=
1
;
break
;
case
83
:
this
.
moveState
.
back
=
1
;
break
;
case
65
:
this
.
moveState
.
left
=
1
;
break
;
case
68
:
this
.
moveState
.
right
=
1
;
break
;
case
82
:
this
.
moveState
.
up
=
1
;
break
;
case
70
:
this
.
moveState
.
down
=
1
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
1
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
1
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
1
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
1
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
1
;
break
;
case
69
:
this
.
moveState
.
rollRight
=
1
}
this
.
updateMovementVector
();
this
.
updateRotationVector
()}};
0.1
;
break
;
case
87
:
this
.
moveState
.
forward
=
1
;
break
;
case
83
:
this
.
moveState
.
back
=
1
;
break
;
case
65
:
this
.
moveState
.
left
=
1
;
break
;
case
68
:
this
.
moveState
.
right
=
1
;
break
;
case
82
:
this
.
moveState
.
up
=
1
;
break
;
case
70
:
this
.
moveState
.
down
=
1
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
1
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
1
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
1
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
1
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
1
;
break
;
case
69
:
this
.
moveState
.
rollRight
=
1
}
this
.
updateMovementVector
();
this
.
updateRotationVector
()}};
this
.
keyup
=
function
(
a
){
switch
(
a
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
1
;
break
;
case
87
:
this
.
moveState
.
forward
=
0
;
break
;
case
83
:
this
.
moveState
.
back
=
0
;
break
;
case
65
:
this
.
moveState
.
left
=
0
;
break
;
case
68
:
this
.
moveState
.
right
=
0
;
break
;
case
82
:
this
.
moveState
.
up
=
0
;
break
;
case
70
:
this
.
moveState
.
down
=
0
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
0
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
0
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
0
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
0
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
0
;
break
;
this
.
keyup
=
function
(
a
){
switch
(
a
.
keyCode
){
case
16
:
this
.
movementSpeedMultiplier
=
1
;
break
;
case
87
:
this
.
moveState
.
forward
=
0
;
break
;
case
83
:
this
.
moveState
.
back
=
0
;
break
;
case
65
:
this
.
moveState
.
left
=
0
;
break
;
case
68
:
this
.
moveState
.
right
=
0
;
break
;
case
82
:
this
.
moveState
.
up
=
0
;
break
;
case
70
:
this
.
moveState
.
down
=
0
;
break
;
case
38
:
this
.
moveState
.
pitchUp
=
0
;
break
;
case
40
:
this
.
moveState
.
pitchDown
=
0
;
break
;
case
37
:
this
.
moveState
.
yawLeft
=
0
;
break
;
case
39
:
this
.
moveState
.
yawRight
=
0
;
break
;
case
81
:
this
.
moveState
.
rollLeft
=
0
;
break
;
...
@@ -90,7 +90,7 @@ f));b instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(n.position.x,n.
...
@@ -90,7 +90,7 @@ f));b instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(n.position.x,n.
THREE
.
IcosahedronGeometry
=
function
(
a
){
function
c
(
a
,
b
,
c
){
var
g
=
Math
.
sqrt
(
a
*
a
+
b
*
b
+
c
*
c
);
return
e
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
a
/
g
,
b
/
g
,
c
/
g
)))
-
1
}
function
b
(
a
,
b
,
c
,
g
){
g
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
))}
function
f
(
a
,
b
){
var
g
=
e
.
vertices
[
a
].
position
,
f
=
e
.
vertices
[
b
].
position
;
return
c
((
g
.
x
+
f
.
x
)
/
2
,(
g
.
y
+
f
.
y
)
/
2
,(
g
.
z
+
f
.
z
)
/
2
)}
var
e
=
this
,
h
=
new
THREE
.
Geometry
,
g
;
this
.
subdivisions
=
a
||
0
;
THREE
.
Geometry
.
call
(
this
);
a
=
(
1
+
Math
.
sqrt
(
5
))
/
2
;
c
(
-
1
,
a
,
0
);
c
(
1
,
a
,
0
);
c
(
-
1
,
-
a
,
0
);
c
(
1
,
-
a
,
0
);
c
(
0
,
-
1
,
a
);
c
(
0
,
1
,
a
);
c
(
0
,
-
1
,
THREE
.
IcosahedronGeometry
=
function
(
a
){
function
c
(
a
,
b
,
c
){
var
g
=
Math
.
sqrt
(
a
*
a
+
b
*
b
+
c
*
c
);
return
e
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
a
/
g
,
b
/
g
,
c
/
g
)))
-
1
}
function
b
(
a
,
b
,
c
,
g
){
g
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
))}
function
f
(
a
,
b
){
var
g
=
e
.
vertices
[
a
].
position
,
f
=
e
.
vertices
[
b
].
position
;
return
c
((
g
.
x
+
f
.
x
)
/
2
,(
g
.
y
+
f
.
y
)
/
2
,(
g
.
z
+
f
.
z
)
/
2
)}
var
e
=
this
,
h
=
new
THREE
.
Geometry
,
g
;
this
.
subdivisions
=
a
||
0
;
THREE
.
Geometry
.
call
(
this
);
a
=
(
1
+
Math
.
sqrt
(
5
))
/
2
;
c
(
-
1
,
a
,
0
);
c
(
1
,
a
,
0
);
c
(
-
1
,
-
a
,
0
);
c
(
1
,
-
a
,
0
);
c
(
0
,
-
1
,
a
);
c
(
0
,
1
,
a
);
c
(
0
,
-
1
,
-
a
);
c
(
0
,
1
,
-
a
);
c
(
a
,
0
,
-
1
);
c
(
a
,
0
,
1
);
c
(
-
a
,
0
,
-
1
);
c
(
-
a
,
0
,
1
);
b
(
0
,
11
,
5
,
h
);
b
(
0
,
5
,
1
,
h
);
b
(
0
,
1
,
7
,
h
);
b
(
0
,
7
,
10
,
h
);
b
(
0
,
10
,
11
,
h
);
b
(
1
,
5
,
9
,
h
);
b
(
5
,
11
,
4
,
h
);
b
(
11
,
10
,
2
,
h
);
b
(
10
,
7
,
6
,
h
);
b
(
7
,
1
,
8
,
h
);
b
(
3
,
9
,
4
,
h
);
b
(
3
,
4
,
2
,
h
);
b
(
3
,
2
,
6
,
h
);
b
(
3
,
6
,
8
,
h
);
b
(
3
,
8
,
9
,
h
);
b
(
4
,
9
,
5
,
h
);
b
(
2
,
4
,
11
,
h
);
b
(
6
,
2
,
10
,
h
);
b
(
8
,
6
,
7
,
h
);
b
(
9
,
8
,
1
,
h
);
for
(
a
=
0
;
a
<
this
.
subdivisions
;
a
++
){
g
=
new
THREE
.
Geometry
;
for
(
var
k
in
h
.
faces
){
var
j
=
f
(
h
.
faces
[
k
].
a
,
h
.
faces
[
k
].
b
),
m
=
f
(
h
.
faces
[
k
].
b
,
h
.
faces
[
k
].
c
),
l
=
f
(
h
.
faces
[
k
].
c
,
h
.
faces
[
k
].
a
);
b
(
h
.
faces
[
k
].
a
,
j
,
l
,
g
);
b
(
h
.
faces
[
k
].
b
,
m
,
j
,
g
);
-
a
);
c
(
0
,
1
,
-
a
);
c
(
a
,
0
,
-
1
);
c
(
a
,
0
,
1
);
c
(
-
a
,
0
,
-
1
);
c
(
-
a
,
0
,
1
);
b
(
0
,
11
,
5
,
h
);
b
(
0
,
5
,
1
,
h
);
b
(
0
,
1
,
7
,
h
);
b
(
0
,
7
,
10
,
h
);
b
(
0
,
10
,
11
,
h
);
b
(
1
,
5
,
9
,
h
);
b
(
5
,
11
,
4
,
h
);
b
(
11
,
10
,
2
,
h
);
b
(
10
,
7
,
6
,
h
);
b
(
7
,
1
,
8
,
h
);
b
(
3
,
9
,
4
,
h
);
b
(
3
,
4
,
2
,
h
);
b
(
3
,
2
,
6
,
h
);
b
(
3
,
6
,
8
,
h
);
b
(
3
,
8
,
9
,
h
);
b
(
4
,
9
,
5
,
h
);
b
(
2
,
4
,
11
,
h
);
b
(
6
,
2
,
10
,
h
);
b
(
8
,
6
,
7
,
h
);
b
(
9
,
8
,
1
,
h
);
for
(
a
=
0
;
a
<
this
.
subdivisions
;
a
++
){
g
=
new
THREE
.
Geometry
;
for
(
var
k
in
h
.
faces
){
var
j
=
f
(
h
.
faces
[
k
].
a
,
h
.
faces
[
k
].
b
),
m
=
f
(
h
.
faces
[
k
].
b
,
h
.
faces
[
k
].
c
),
l
=
f
(
h
.
faces
[
k
].
c
,
h
.
faces
[
k
].
a
);
b
(
h
.
faces
[
k
].
a
,
j
,
l
,
g
);
b
(
h
.
faces
[
k
].
b
,
m
,
j
,
g
);
b
(
h
.
faces
[
k
].
c
,
l
,
m
,
g
);
b
(
j
,
m
,
l
,
g
)}
h
.
faces
=
g
.
faces
}
e
.
faces
=
h
.
faces
;
delete
h
;
delete
g
;
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
IcosahedronGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
IcosahedronGeometry
.
prototype
.
constructor
=
THREE
.
IcosahedronGeometry
;
b
(
h
.
faces
[
k
].
c
,
l
,
m
,
g
);
b
(
j
,
m
,
l
,
g
)}
h
.
faces
=
g
.
faces
}
e
.
faces
=
h
.
faces
;
delete
h
;
delete
g
;
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
IcosahedronGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
IcosahedronGeometry
.
prototype
.
constructor
=
THREE
.
IcosahedronGeometry
;
THREE
.
LatheGeometry
=
function
(
a
,
c
,
b
){
THREE
.
Geometry
.
call
(
this
);
this
.
steps
=
c
||
12
;
this
.
angle
=
b
||
2
*
Math
.
PI
;
for
(
var
c
=
this
.
angle
/
this
.
steps
,
b
=
[],
f
=
[],
e
=
[],
h
=
[],
g
=
(
new
THREE
.
Matrix4
).
setRotationZ
(
c
),
k
=
0
;
k
<
a
.
length
;
k
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
a
[
k
])),
b
[
k
]
=
a
[
k
].
clone
(),
f
[
k
]
=
this
.
vertices
.
length
-
1
;
for
(
var
j
=
0
;
j
<=
this
.
angle
+
0.001
;
j
+=
c
){
for
(
k
=
0
;
k
<
b
.
length
;
k
++
)
j
<
this
.
angle
?(
b
[
k
]
=
g
.
multiplyVector3
(
b
[
k
].
clone
()),
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
b
[
k
])),
e
[
k
]
=
this
.
vertices
.
length
-
1
):
e
=
h
;
j
==
0
&&
(
h
=
f
);
THREE
.
LatheGeometry
=
function
(
a
,
c
,
b
){
THREE
.
Geometry
.
call
(
this
);
this
.
steps
=
c
||
12
;
this
.
angle
=
b
||
2
*
Math
.
PI
;
for
(
var
c
=
this
.
angle
/
this
.
steps
,
b
=
[],
f
=
[],
e
=
[],
h
=
[],
g
=
(
new
THREE
.
Matrix4
).
setRotationZ
(
c
),
k
=
0
;
k
<
a
.
length
;
k
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
a
[
k
])),
b
[
k
]
=
a
[
k
].
clone
(),
f
[
k
]
=
this
.
vertices
.
length
-
1
;
for
(
var
j
=
0
;
j
<=
this
.
angle
+
0.001
0
;
j
+=
c
){
for
(
k
=
0
;
k
<
b
.
length
;
k
++
)
j
<
this
.
angle
?(
b
[
k
]
=
g
.
multiplyVector3
(
b
[
k
].
clone
()),
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
b
[
k
])),
e
[
k
]
=
this
.
vertices
.
length
-
1
):
e
=
h
;
j
==
0
&&
(
h
=
f
);
for
(
k
=
0
;
k
<
f
.
length
-
1
;
k
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
e
[
k
],
e
[
k
+
1
],
f
[
k
+
1
],
f
[
k
])),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
1
-
j
/
this
.
angle
,
k
/
a
.
length
),
new
THREE
.
UV
(
1
-
j
/
this
.
angle
,(
k
+
1
)
/
a
.
length
),
new
THREE
.
UV
(
1
-
(
j
-
c
)
/
this
.
angle
,(
k
+
1
)
/
a
.
length
),
new
THREE
.
UV
(
1
-
(
j
-
c
)
/
this
.
angle
,
k
/
a
.
length
)]);
f
=
e
;
e
=
[]}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
LatheGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
LatheGeometry
.
prototype
.
constructor
=
THREE
.
LatheGeometry
;
for
(
k
=
0
;
k
<
f
.
length
-
1
;
k
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
e
[
k
],
e
[
k
+
1
],
f
[
k
+
1
],
f
[
k
])),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
1
-
j
/
this
.
angle
,
k
/
a
.
length
),
new
THREE
.
UV
(
1
-
j
/
this
.
angle
,(
k
+
1
)
/
a
.
length
),
new
THREE
.
UV
(
1
-
(
j
-
c
)
/
this
.
angle
,(
k
+
1
)
/
a
.
length
),
new
THREE
.
UV
(
1
-
(
j
-
c
)
/
this
.
angle
,
k
/
a
.
length
)]);
f
=
e
;
e
=
[]}
this
.
computeCentroids
();
this
.
computeFaceNormals
();
this
.
computeVertexNormals
()};
THREE
.
LatheGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
LatheGeometry
.
prototype
.
constructor
=
THREE
.
LatheGeometry
;
THREE
.
PlaneGeometry
=
function
(
a
,
c
,
b
,
f
){
THREE
.
Geometry
.
call
(
this
);
var
e
,
h
=
a
/
2
,
g
=
c
/
2
,
b
=
b
||
1
,
f
=
f
||
1
,
k
=
b
+
1
,
j
=
f
+
1
;
a
/=
b
;
var
m
=
c
/
f
;
for
(
e
=
0
;
e
<
j
;
e
++
)
for
(
c
=
0
;
c
<
k
;
c
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
c
*
a
-
h
,
-
(
e
*
m
-
g
),
0
)));
for
(
e
=
0
;
e
<
f
;
e
++
)
for
(
c
=
0
;
c
<
b
;
c
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
c
+
k
*
e
,
c
+
k
*
(
e
+
1
),
c
+
1
+
k
*
(
e
+
1
),
c
+
1
+
k
*
e
)),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
c
/
b
,
e
/
f
),
new
THREE
.
UV
(
c
/
b
,(
e
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
b
,(
e
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
b
,
e
/
f
)]);
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
PlaneGeometry
=
function
(
a
,
c
,
b
,
f
){
THREE
.
Geometry
.
call
(
this
);
var
e
,
h
=
a
/
2
,
g
=
c
/
2
,
b
=
b
||
1
,
f
=
f
||
1
,
k
=
b
+
1
,
j
=
f
+
1
;
a
/=
b
;
var
m
=
c
/
f
;
for
(
e
=
0
;
e
<
j
;
e
++
)
for
(
c
=
0
;
c
<
k
;
c
++
)
this
.
vertices
.
push
(
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
c
*
a
-
h
,
-
(
e
*
m
-
g
),
0
)));
for
(
e
=
0
;
e
<
f
;
e
++
)
for
(
c
=
0
;
c
<
b
;
c
++
)
this
.
faces
.
push
(
new
THREE
.
Face4
(
c
+
k
*
e
,
c
+
k
*
(
e
+
1
),
c
+
1
+
k
*
(
e
+
1
),
c
+
1
+
k
*
e
)),
this
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
c
/
b
,
e
/
f
),
new
THREE
.
UV
(
c
/
b
,(
e
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
b
,(
e
+
1
)
/
f
),
new
THREE
.
UV
((
c
+
1
)
/
b
,
e
/
f
)]);
this
.
computeCentroids
();
this
.
computeFaceNormals
()};
THREE
.
PlaneGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
PlaneGeometry
.
prototype
.
constructor
=
THREE
.
PlaneGeometry
;
THREE
.
PlaneGeometry
.
prototype
=
new
THREE
.
Geometry
;
THREE
.
PlaneGeometry
.
prototype
.
constructor
=
THREE
.
PlaneGeometry
;
...
...
build/custom/ThreeSVG.js
浏览文件 @
57936758
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
a
=
1
/
a
,
this
.
x
*=
a
,
this
.
y
*=
a
,
this
.
z
*=
a
,
this
.
w
*=
a
);
return
this
},
d
;
this
.
z
=
a
.
z
*
d
;
this
.
w
=
Math
.
cos
(
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
);
a
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
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
,
e
=
this
.
w
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
k
=
this
.
w
,
l
=
k
*
c
+
f
*
e
-
h
*
d
,
i
=
multiplySelf
:
function
(
a
){
var
b
=
this
.
x
,
c
=
this
.
y
,
d
=
this
.
z
,
e
=
this
.
w
,
g
=
a
.
x
,
f
=
a
.
y
,
h
=
a
.
z
,
a
=
a
.
w
;
this
.
x
=
b
*
a
+
e
*
g
+
c
*
h
-
d
*
f
;
this
.
y
=
c
*
a
+
e
*
f
+
d
*
g
-
b
*
h
;
this
.
z
=
d
*
a
+
e
*
h
+
b
*
f
-
c
*
g
;
this
.
w
=
e
*
a
-
b
*
g
-
c
*
f
-
d
*
h
;
return
this
},
multiply
:
function
(
a
,
b
){
this
.
x
=
a
.
x
*
b
.
w
+
a
.
y
*
b
.
z
-
a
.
z
*
b
.
y
+
a
.
w
*
b
.
x
;
this
.
y
=-
a
.
x
*
b
.
z
+
a
.
y
*
b
.
w
+
a
.
z
*
b
.
x
+
a
.
w
*
b
.
y
;
this
.
z
=
a
.
x
*
b
.
y
-
a
.
y
*
b
.
x
+
a
.
z
*
b
.
w
+
a
.
w
*
b
.
z
;
this
.
w
=-
a
.
x
*
b
.
x
-
a
.
y
*
b
.
y
-
a
.
z
*
b
.
z
+
a
.
w
*
b
.
w
;
return
this
},
multiplyVector3
:
function
(
a
,
b
){
b
||
(
b
=
a
);
var
c
=
a
.
x
,
d
=
a
.
y
,
e
=
a
.
z
,
g
=
this
.
x
,
f
=
this
.
y
,
h
=
this
.
z
,
k
=
this
.
w
,
l
=
k
*
c
+
f
*
e
-
h
*
d
,
i
=
k
*
d
+
h
*
c
-
g
*
e
,
j
=
k
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
l
*
k
+
c
*-
g
+
i
*-
h
-
j
*-
f
;
b
.
y
=
i
*
k
+
c
*-
f
+
j
*-
g
-
l
*-
h
;
b
.
z
=
j
*
k
+
c
*-
h
+
l
*-
f
-
i
*-
g
;
return
b
}};
k
*
d
+
h
*
c
-
g
*
e
,
j
=
k
*
e
+
g
*
d
-
f
*
c
,
c
=-
g
*
c
-
f
*
d
-
h
*
e
;
b
.
x
=
l
*
k
+
c
*-
g
+
i
*-
h
-
j
*-
f
;
b
.
y
=
i
*
k
+
c
*-
f
+
j
*-
g
-
l
*-
h
;
b
.
z
=
j
*
k
+
c
*-
h
+
l
*-
f
-
i
*-
g
;
return
b
}};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
)
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
a
,
b
,
c
,
d
){
var
e
=
a
.
w
*
b
.
w
+
a
.
x
*
b
.
x
+
a
.
y
*
b
.
y
+
a
.
z
*
b
.
z
;
if
(
Math
.
abs
(
e
)
>=
1
)
return
c
.
w
=
a
.
w
,
c
.
x
=
a
.
x
,
c
.
y
=
a
.
y
,
c
.
z
=
a
.
z
,
c
;
var
g
=
Math
.
acos
(
e
),
f
=
Math
.
sqrt
(
1
-
e
*
e
);
if
(
Math
.
abs
(
f
)
<
0.001
0
)
return
c
.
w
=
0.5
*
(
a
.
w
+
b
.
w
),
c
.
x
=
0.5
*
(
a
.
x
+
b
.
x
),
c
.
y
=
0.5
*
(
a
.
y
+
b
.
y
),
c
.
z
=
0.5
*
(
a
.
z
+
b
.
z
),
c
;
e
=
Math
.
sin
((
1
-
d
)
*
g
)
/
f
;
d
=
Math
.
sin
(
d
*
g
)
/
f
;
c
.
w
=
a
.
w
*
e
+
b
.
w
*
d
;
c
.
x
=
a
.
x
*
e
+
b
.
x
*
d
;
c
.
y
=
a
.
y
*
e
+
b
.
y
*
d
;
c
.
z
=
a
.
z
*
e
+
b
.
z
*
d
;
return
c
};
THREE
.
Vertex
=
function
(
a
){
this
.
position
=
a
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
a
,
b
,
c
,
d
,
e
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
normal
=
d
instanceof
THREE
.
Vector3
?
d
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
d
instanceof
Array
?
d
:[];
this
.
color
=
e
instanceof
THREE
.
Color
?
e
:
new
THREE
.
Color
;
this
.
vertexColors
=
e
instanceof
Array
?
e
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
g
instanceof
Array
?
g
:[
g
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
g
,
f
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
f
instanceof
Array
?
f
:[
f
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
a
,
b
){
this
.
set
(
a
||
0
,
b
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
.
prototype
=
{
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
set
(
a
.
u
,
a
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
57936758
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(b,d,e,f){this.x=b;this.y=d;this.z=e;thi
...
@@ -53,7 +53,7 @@ THREE.Quaternion.prototype={set:function(b,d,e,f){this.x=b;this.y=d;this.z=e;thi
f
;
this
.
z
=
b
.
z
*
f
;
this
.
w
=
Math
.
cos
(
e
);
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
b
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
b
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
b
=
1
/
b
,
this
.
x
*=
b
,
this
.
y
*=
b
,
this
.
z
*=
b
,
this
.
w
*=
b
);
return
this
},
f
;
this
.
z
=
b
.
z
*
f
;
this
.
w
=
Math
.
cos
(
e
);
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
b
=
Math
.
sqrt
(
this
.
x
*
this
.
x
+
this
.
y
*
this
.
y
+
this
.
z
*
this
.
z
+
this
.
w
*
this
.
w
);
b
==
0
?
this
.
w
=
this
.
z
=
this
.
y
=
this
.
x
=
0
:(
b
=
1
/
b
,
this
.
x
*=
b
,
this
.
y
*=
b
,
this
.
z
*=
b
,
this
.
w
*=
b
);
return
this
},
multiplySelf
:
function
(
b
){
var
d
=
this
.
x
,
e
=
this
.
y
,
f
=
this
.
z
,
g
=
this
.
w
,
i
=
b
.
x
,
h
=
b
.
y
,
j
=
b
.
z
,
b
=
b
.
w
;
this
.
x
=
d
*
b
+
g
*
i
+
e
*
j
-
f
*
h
;
this
.
y
=
e
*
b
+
g
*
h
+
f
*
i
-
d
*
j
;
this
.
z
=
f
*
b
+
g
*
j
+
d
*
h
-
e
*
i
;
this
.
w
=
g
*
b
-
d
*
i
-
e
*
h
-
f
*
j
;
return
this
},
multiply
:
function
(
b
,
d
){
this
.
x
=
b
.
x
*
d
.
w
+
b
.
y
*
d
.
z
-
b
.
z
*
d
.
y
+
b
.
w
*
d
.
x
;
this
.
y
=-
b
.
x
*
d
.
z
+
b
.
y
*
d
.
w
+
b
.
z
*
d
.
x
+
b
.
w
*
d
.
y
;
this
.
z
=
b
.
x
*
d
.
y
-
b
.
y
*
d
.
x
+
b
.
z
*
d
.
w
+
b
.
w
*
d
.
z
;
this
.
w
=-
b
.
x
*
d
.
x
-
b
.
y
*
d
.
y
-
b
.
z
*
d
.
z
+
b
.
w
*
d
.
w
;
return
this
},
multiplyVector3
:
function
(
b
,
d
){
d
||
(
d
=
b
);
var
e
=
b
.
x
,
f
=
b
.
y
,
g
=
b
.
z
,
i
=
this
.
x
,
h
=
this
.
y
,
j
=
this
.
z
,
k
=
this
.
w
,
o
=
k
*
e
+
h
*
g
-
j
*
f
,
q
=
multiplySelf
:
function
(
b
){
var
d
=
this
.
x
,
e
=
this
.
y
,
f
=
this
.
z
,
g
=
this
.
w
,
i
=
b
.
x
,
h
=
b
.
y
,
j
=
b
.
z
,
b
=
b
.
w
;
this
.
x
=
d
*
b
+
g
*
i
+
e
*
j
-
f
*
h
;
this
.
y
=
e
*
b
+
g
*
h
+
f
*
i
-
d
*
j
;
this
.
z
=
f
*
b
+
g
*
j
+
d
*
h
-
e
*
i
;
this
.
w
=
g
*
b
-
d
*
i
-
e
*
h
-
f
*
j
;
return
this
},
multiply
:
function
(
b
,
d
){
this
.
x
=
b
.
x
*
d
.
w
+
b
.
y
*
d
.
z
-
b
.
z
*
d
.
y
+
b
.
w
*
d
.
x
;
this
.
y
=-
b
.
x
*
d
.
z
+
b
.
y
*
d
.
w
+
b
.
z
*
d
.
x
+
b
.
w
*
d
.
y
;
this
.
z
=
b
.
x
*
d
.
y
-
b
.
y
*
d
.
x
+
b
.
z
*
d
.
w
+
b
.
w
*
d
.
z
;
this
.
w
=-
b
.
x
*
d
.
x
-
b
.
y
*
d
.
y
-
b
.
z
*
d
.
z
+
b
.
w
*
d
.
w
;
return
this
},
multiplyVector3
:
function
(
b
,
d
){
d
||
(
d
=
b
);
var
e
=
b
.
x
,
f
=
b
.
y
,
g
=
b
.
z
,
i
=
this
.
x
,
h
=
this
.
y
,
j
=
this
.
z
,
k
=
this
.
w
,
o
=
k
*
e
+
h
*
g
-
j
*
f
,
q
=
k
*
f
+
j
*
e
-
i
*
g
,
n
=
k
*
g
+
i
*
f
-
h
*
e
,
e
=-
i
*
e
-
h
*
f
-
j
*
g
;
d
.
x
=
o
*
k
+
e
*-
i
+
q
*-
j
-
n
*-
h
;
d
.
y
=
q
*
k
+
e
*-
h
+
n
*-
i
-
o
*-
j
;
d
.
z
=
n
*
k
+
e
*-
j
+
o
*-
h
-
q
*-
i
;
return
d
}};
k
*
f
+
j
*
e
-
i
*
g
,
n
=
k
*
g
+
i
*
f
-
h
*
e
,
e
=-
i
*
e
-
h
*
f
-
j
*
g
;
d
.
x
=
o
*
k
+
e
*-
i
+
q
*-
j
-
n
*-
h
;
d
.
y
=
q
*
k
+
e
*-
h
+
n
*-
i
-
o
*-
j
;
d
.
z
=
n
*
k
+
e
*-
j
+
o
*-
h
-
q
*-
i
;
return
d
}};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
d
,
e
,
f
){
var
g
=
b
.
w
*
d
.
w
+
b
.
x
*
d
.
x
+
b
.
y
*
d
.
y
+
b
.
z
*
d
.
z
;
if
(
Math
.
abs
(
g
)
>=
1
)
return
e
.
w
=
b
.
w
,
e
.
x
=
b
.
x
,
e
.
y
=
b
.
y
,
e
.
z
=
b
.
z
,
e
;
var
i
=
Math
.
acos
(
g
),
h
=
Math
.
sqrt
(
1
-
g
*
g
);
if
(
Math
.
abs
(
h
)
<
0.001
)
return
e
.
w
=
0.5
*
(
b
.
w
+
d
.
w
),
e
.
x
=
0.5
*
(
b
.
x
+
d
.
x
),
e
.
y
=
0.5
*
(
b
.
y
+
d
.
y
),
e
.
z
=
0.5
*
(
b
.
z
+
d
.
z
),
e
;
g
=
Math
.
sin
((
1
-
f
)
*
i
)
/
h
;
f
=
Math
.
sin
(
f
*
i
)
/
h
;
e
.
w
=
b
.
w
*
g
+
d
.
w
*
f
;
e
.
x
=
b
.
x
*
g
+
d
.
x
*
f
;
e
.
y
=
b
.
y
*
g
+
d
.
y
*
f
;
e
.
z
=
b
.
z
*
g
+
d
.
z
*
f
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Quaternion
.
slerp
=
function
(
b
,
d
,
e
,
f
){
var
g
=
b
.
w
*
d
.
w
+
b
.
x
*
d
.
x
+
b
.
y
*
d
.
y
+
b
.
z
*
d
.
z
;
if
(
Math
.
abs
(
g
)
>=
1
)
return
e
.
w
=
b
.
w
,
e
.
x
=
b
.
x
,
e
.
y
=
b
.
y
,
e
.
z
=
b
.
z
,
e
;
var
i
=
Math
.
acos
(
g
),
h
=
Math
.
sqrt
(
1
-
g
*
g
);
if
(
Math
.
abs
(
h
)
<
0.001
0
)
return
e
.
w
=
0.5
*
(
b
.
w
+
d
.
w
),
e
.
x
=
0.5
*
(
b
.
x
+
d
.
x
),
e
.
y
=
0.5
*
(
b
.
y
+
d
.
y
),
e
.
z
=
0.5
*
(
b
.
z
+
d
.
z
),
e
;
g
=
Math
.
sin
((
1
-
f
)
*
i
)
/
h
;
f
=
Math
.
sin
(
f
*
i
)
/
h
;
e
.
w
=
b
.
w
*
g
+
d
.
w
*
f
;
e
.
x
=
b
.
x
*
g
+
d
.
x
*
f
;
e
.
y
=
b
.
y
*
g
+
d
.
y
*
f
;
e
.
z
=
b
.
z
*
g
+
d
.
z
*
f
;
return
e
};
THREE
.
Vertex
=
function
(
b
){
this
.
position
=
b
||
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
b
,
d
,
e
,
f
,
g
,
i
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
i
instanceof
Array
?
i
:[
i
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face3
=
function
(
b
,
d
,
e
,
f
,
g
,
i
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
normal
=
f
instanceof
THREE
.
Vector3
?
f
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
f
instanceof
Array
?
f
:[];
this
.
color
=
g
instanceof
THREE
.
Color
?
g
:
new
THREE
.
Color
;
this
.
vertexColors
=
g
instanceof
Array
?
g
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
i
instanceof
Array
?
i
:[
i
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
=
function
(
b
,
d
,
e
,
f
,
g
,
i
,
h
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
d
=
f
;
this
.
normal
=
g
instanceof
THREE
.
Vector3
?
g
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
g
instanceof
Array
?
g
:[];
this
.
color
=
i
instanceof
THREE
.
Color
?
i
:
new
THREE
.
Color
;
this
.
vertexColors
=
i
instanceof
Array
?
i
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
b
,
d
){
this
.
set
(
b
||
0
,
d
||
0
)};
THREE
.
Face4
=
function
(
b
,
d
,
e
,
f
,
g
,
i
,
h
){
this
.
a
=
b
;
this
.
b
=
d
;
this
.
c
=
e
;
this
.
d
=
f
;
this
.
normal
=
g
instanceof
THREE
.
Vector3
?
g
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
g
instanceof
Array
?
g
:[];
this
.
color
=
i
instanceof
THREE
.
Color
?
i
:
new
THREE
.
Color
;
this
.
vertexColors
=
i
instanceof
Array
?
i
:[];
this
.
vertexTangents
=
[];
this
.
materials
=
h
instanceof
Array
?
h
:[
h
];
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
UV
=
function
(
b
,
d
){
this
.
set
(
b
||
0
,
d
||
0
)};
THREE
.
UV
.
prototype
=
{
set
:
function
(
b
,
d
){
this
.
u
=
b
;
this
.
v
=
d
;
return
this
},
copy
:
function
(
b
){
this
.
set
(
b
.
u
,
b
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
THREE
.
UV
.
prototype
=
{
set
:
function
(
b
,
d
){
this
.
u
=
b
;
this
.
v
=
d
;
return
this
},
copy
:
function
(
b
){
this
.
set
(
b
.
u
,
b
.
v
);
return
this
}};
THREE
.
Geometry
=
function
(){
this
.
id
=
"
Geometry
"
+
THREE
.
GeometryIdCounter
++
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
faces
=
[];
this
.
edges
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
};
...
@@ -211,9 +211,9 @@ h.uvScale.y),c.uniform2f(g.uvOffset,h.uvOffset.x,h.uvOffset.y),c.uniform2f(g.ali
...
@@ -211,9 +211,9 @@ h.uvScale.y),c.uniform2f(g.uvOffset,h.uvOffset.x,h.uvOffset.y),c.uniform2f(g.ali
k
=
new
THREE
.
Vector3
,
o
=
qa
/
va
,
p
=
va
*
0.5
,
n
=
qa
*
0.5
,
q
=
16
/
qa
,
t
=
[
q
*
o
,
q
],
u
=
[
1
,
1
,
0
],
r
=
[
1
,
1
],
z
=
v
.
uniforms
;
d
=
v
.
attributes
;
c
.
useProgram
(
v
.
program
);
la
=
v
.
program
;
F
=-
1
;
Ia
||
(
c
.
enableVertexAttribArray
(
v
.
attributes
.
vertex
),
c
.
enableVertexAttribArray
(
v
.
attributes
.
uv
),
Ia
=!
0
);
c
.
uniform1i
(
z
.
occlusionMap
,
0
);
c
.
uniform1i
(
z
.
map
,
1
);
c
.
bindBuffer
(
c
.
ARRAY_BUFFER
,
v
.
vertexBuffer
);
c
.
vertexAttribPointer
(
d
.
vertex
,
2
,
c
.
FLOAT
,
!
1
,
16
,
0
);
c
.
vertexAttribPointer
(
d
.
uv
,
2
,
c
.
FLOAT
,
!
1
,
16
,
8
);
c
.
bindBuffer
(
c
.
ELEMENT_ARRAY_BUFFER
,
v
.
elementBuffer
);
c
.
disable
(
c
.
CULL_FACE
);
k
=
new
THREE
.
Vector3
,
o
=
qa
/
va
,
p
=
va
*
0.5
,
n
=
qa
*
0.5
,
q
=
16
/
qa
,
t
=
[
q
*
o
,
q
],
u
=
[
1
,
1
,
0
],
r
=
[
1
,
1
],
z
=
v
.
uniforms
;
d
=
v
.
attributes
;
c
.
useProgram
(
v
.
program
);
la
=
v
.
program
;
F
=-
1
;
Ia
||
(
c
.
enableVertexAttribArray
(
v
.
attributes
.
vertex
),
c
.
enableVertexAttribArray
(
v
.
attributes
.
uv
),
Ia
=!
0
);
c
.
uniform1i
(
z
.
occlusionMap
,
0
);
c
.
uniform1i
(
z
.
map
,
1
);
c
.
bindBuffer
(
c
.
ARRAY_BUFFER
,
v
.
vertexBuffer
);
c
.
vertexAttribPointer
(
d
.
vertex
,
2
,
c
.
FLOAT
,
!
1
,
16
,
0
);
c
.
vertexAttribPointer
(
d
.
uv
,
2
,
c
.
FLOAT
,
!
1
,
16
,
8
);
c
.
bindBuffer
(
c
.
ELEMENT_ARRAY_BUFFER
,
v
.
elementBuffer
);
c
.
disable
(
c
.
CULL_FACE
);
c
.
depthMask
(
!
1
);
c
.
activeTexture
(
c
.
TEXTURE0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
occlusionTexture
);
c
.
activeTexture
(
c
.
TEXTURE1
);
for
(
f
=
0
;
f
<
h
;
f
++
)
if
(
d
=
b
.
__webglLensFlares
[
f
].
object
,
k
.
set
(
d
.
matrixWorld
.
n14
,
d
.
matrixWorld
.
n24
,
d
.
matrixWorld
.
n34
),
e
.
matrixWorldInverse
.
multiplyVector3
(
k
),
e
.
projectionMatrix
.
multiplyVector3
(
k
),
u
[
0
]
=
k
.
x
,
u
[
1
]
=
k
.
y
,
u
[
2
]
=
k
.
z
,
r
[
0
]
=
u
[
0
]
*
p
+
p
,
r
[
1
]
=
u
[
1
]
*
n
+
n
,
v
.
hasVertexTexture
||
r
[
0
]
>
0
&&
r
[
0
]
<
va
&&
r
[
1
]
>
0
&&
r
[
1
]
<
qa
){
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
tempTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGB
,
r
[
0
]
-
c
.
depthMask
(
!
1
);
c
.
activeTexture
(
c
.
TEXTURE0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
occlusionTexture
);
c
.
activeTexture
(
c
.
TEXTURE1
);
for
(
f
=
0
;
f
<
h
;
f
++
)
if
(
d
=
b
.
__webglLensFlares
[
f
].
object
,
k
.
set
(
d
.
matrixWorld
.
n14
,
d
.
matrixWorld
.
n24
,
d
.
matrixWorld
.
n34
),
e
.
matrixWorldInverse
.
multiplyVector3
(
k
),
e
.
projectionMatrix
.
multiplyVector3
(
k
),
u
[
0
]
=
k
.
x
,
u
[
1
]
=
k
.
y
,
u
[
2
]
=
k
.
z
,
r
[
0
]
=
u
[
0
]
*
p
+
p
,
r
[
1
]
=
u
[
1
]
*
n
+
n
,
v
.
hasVertexTexture
||
r
[
0
]
>
0
&&
r
[
0
]
<
va
&&
r
[
1
]
>
0
&&
r
[
1
]
<
qa
){
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
tempTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGB
,
r
[
0
]
-
8
,
r
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
z
.
renderType
,
0
);
c
.
uniform2fv
(
z
.
scale
,
t
);
c
.
uniform3fv
(
z
.
screenPosition
,
u
);
c
.
disable
(
c
.
BLEND
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
occlusionTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGBA
,
r
[
0
]
-
8
,
r
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
z
.
renderType
,
1
);
c
.
disable
(
c
.
DEPTH_TEST
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
tempTexture
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
d
.
positionScreen
.
x
=
u
[
0
];
d
.
positionScreen
.
y
=
u
[
1
];
d
.
positionScreen
.
z
=
8
,
r
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
z
.
renderType
,
0
);
c
.
uniform2fv
(
z
.
scale
,
t
);
c
.
uniform3fv
(
z
.
screenPosition
,
u
);
c
.
disable
(
c
.
BLEND
);
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
occlusionTexture
);
c
.
copyTexImage2D
(
c
.
TEXTURE_2D
,
0
,
c
.
RGBA
,
r
[
0
]
-
8
,
r
[
1
]
-
8
,
16
,
16
,
0
);
c
.
uniform1i
(
z
.
renderType
,
1
);
c
.
disable
(
c
.
DEPTH_TEST
);
c
.
bindTexture
(
c
.
TEXTURE_2D
,
v
.
tempTexture
);
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
);
d
.
positionScreen
.
x
=
u
[
0
];
d
.
positionScreen
.
y
=
u
[
1
];
d
.
positionScreen
.
z
=
u
[
2
];
d
.
customUpdateCallback
?
d
.
customUpdateCallback
(
d
):
d
.
updateLensFlares
();
c
.
uniform1i
(
z
.
renderType
,
2
);
c
.
enable
(
c
.
BLEND
);
g
=
0
;
for
(
i
=
d
.
lensFlares
.
length
;
g
<
i
;
g
++
)
if
(
j
=
d
.
lensFlares
[
g
],
j
.
opacity
>
0.001
&&
j
.
scale
>
0.001
)
u
[
0
]
=
j
.
x
,
u
[
1
]
=
j
.
y
,
u
[
2
]
=
j
.
z
,
q
=
j
.
size
*
j
.
scale
/
qa
,
t
[
0
]
=
q
*
o
,
t
[
1
]
=
q
,
c
.
uniform3fv
(
z
.
screenPosition
,
u
),
c
.
uniform2fv
(
z
.
scale
,
t
),
c
.
uniform1f
(
z
.
rotation
,
j
.
rotation
),
c
.
uniform1f
(
z
.
opacity
,
j
.
opacity
),
y
(
j
.
blending
),
P
(
j
.
texture
,
1
),
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
)}
c
.
enable
(
c
.
CULL_FACE
);
c
.
enable
(
c
.
DEPTH_TEST
);
u
[
2
];
d
.
customUpdateCallback
?
d
.
customUpdateCallback
(
d
):
d
.
updateLensFlares
();
c
.
uniform1i
(
z
.
renderType
,
2
);
c
.
enable
(
c
.
BLEND
);
g
=
0
;
for
(
i
=
d
.
lensFlares
.
length
;
g
<
i
;
g
++
)
if
(
j
=
d
.
lensFlares
[
g
],
j
.
opacity
>
0.001
0
&&
j
.
scale
>
0.0010
)
u
[
0
]
=
j
.
x
,
u
[
1
]
=
j
.
y
,
u
[
2
]
=
j
.
z
,
q
=
j
.
size
*
j
.
scale
/
qa
,
t
[
0
]
=
q
*
o
,
t
[
1
]
=
q
,
c
.
uniform3fv
(
z
.
screenPosition
,
u
),
c
.
uniform2fv
(
z
.
scale
,
t
),
c
.
uniform1f
(
z
.
rotation
,
j
.
rotation
),
c
.
uniform1f
(
z
.
opacity
,
j
.
opacity
),
y
(
j
.
blending
),
P
(
j
.
texture
,
1
),
c
.
drawElements
(
c
.
TRIANGLES
,
6
,
c
.
UNSIGNED_SHORT
,
0
)}
c
.
enable
(
c
.
CULL_FACE
);
c
.
depthMask
(
ma
)}
function
C
(
b
,
c
){
b
.
_modelViewMatrix
.
multiplyToArray
(
c
.
matrixWorldInverse
,
b
.
matrixWorld
,
b
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
b
.
_modelViewMatrix
).
transposeIntoArray
(
b
.
_normalMatrixArray
)}
function
N
(
b
){
var
e
,
f
,
h
,
g
;
if
(
b
instanceof
THREE
.
Mesh
){
f
=
b
.
geometry
;
for
(
e
in
f
.
geometryGroups
){
h
=
f
.
geometryGroups
[
e
];
a
:{
for
(
var
i
=
g
=
void
0
,
j
=
void
0
,
k
=
void
0
,
o
=
void
0
,
o
=
h
.
__materials
,
i
=
0
,
j
=
o
.
length
;
i
<
j
;
i
++
)
if
(
k
=
o
[
i
],
k
.
attributes
)
for
(
g
in
k
.
attributes
)
if
(
k
.
attributes
[
g
].
needsUpdate
){
g
=!
0
;
c
.
enable
(
c
.
DEPTH_TEST
);
c
.
depthMask
(
ma
)}
function
C
(
b
,
c
){
b
.
_modelViewMatrix
.
multiplyToArray
(
c
.
matrixWorldInverse
,
b
.
matrixWorld
,
b
.
_modelViewMatrixArray
);
THREE
.
Matrix4
.
makeInvert3x3
(
b
.
_modelViewMatrix
).
transposeIntoArray
(
b
.
_normalMatrixArray
)}
function
N
(
b
){
var
e
,
f
,
h
,
g
;
if
(
b
instanceof
THREE
.
Mesh
){
f
=
b
.
geometry
;
for
(
e
in
f
.
geometryGroups
){
h
=
f
.
geometryGroups
[
e
];
a
:{
for
(
var
i
=
g
=
void
0
,
j
=
void
0
,
k
=
void
0
,
o
=
void
0
,
o
=
h
.
__materials
,
i
=
0
,
j
=
o
.
length
;
i
<
j
;
i
++
)
if
(
k
=
o
[
i
],
k
.
attributes
)
for
(
g
in
k
.
attributes
)
if
(
k
.
attributes
[
g
].
needsUpdate
){
g
=
break
a
}
g
=!
1
}
if
(
f
.
__dirtyVertices
||
f
.
__dirtyMorphTargets
||
f
.
__dirtyElements
||
f
.
__dirtyUvs
||
f
.
__dirtyNormals
||
f
.
__dirtyColors
||
f
.
__dirtyTangents
||
g
)
if
(
g
=
h
,
i
=
b
,
j
=
c
.
DYNAMIC_DRAW
,
g
.
__inittedArrays
){
var
n
=
o
=
k
=
void
0
,
p
=
void
0
,
q
=
n
=
void
0
,
t
=
void
0
,
u
=
void
0
,
r
=
void
0
,
y
=
void
0
,
v
=
void
0
,
z
=
void
0
,
C
=
void
0
,
D
=
void
0
,
x
=
void
0
,
J
=
void
0
,
I
=
void
0
,
E
=
void
0
,
s
=
p
=
r
=
p
=
u
=
t
=
void
0
,
A
=
void
0
,
m
=
A
=
s
=
t
=
void
0
,
F
=
void
0
,
H
=
m
=
A
=
s
=
n
=
n
=
q
=
r
=
p
=
m
=
A
=
s
=
F
=
m
=
A
=
s
=
F
=
m
=
A
=
s
=
void
0
,
B
=
0
,
G
=
0
,
P
=
0
,
T
=
0
,
L
=
0
,
K
=
0
,
U
=
0
,
M
=
0
,
ca
=
0
,
w
=
0
,
da
=
0
,
A
=
s
=
0
,
fa
=
g
.
__vertexArray
,
!
0
;
break
a
}
g
=!
1
}
if
(
f
.
__dirtyVertices
||
f
.
__dirtyMorphTargets
||
f
.
__dirtyElements
||
f
.
__dirtyUvs
||
f
.
__dirtyNormals
||
f
.
__dirtyColors
||
f
.
__dirtyTangents
||
g
)
if
(
g
=
h
,
i
=
b
,
j
=
c
.
DYNAMIC_DRAW
,
g
.
__inittedArrays
){
var
n
=
o
=
k
=
void
0
,
p
=
void
0
,
q
=
n
=
void
0
,
t
=
void
0
,
u
=
void
0
,
r
=
void
0
,
y
=
void
0
,
v
=
void
0
,
z
=
void
0
,
C
=
void
0
,
D
=
void
0
,
x
=
void
0
,
J
=
void
0
,
I
=
void
0
,
E
=
void
0
,
s
=
p
=
r
=
p
=
u
=
t
=
void
0
,
A
=
void
0
,
m
=
A
=
s
=
t
=
void
0
,
F
=
void
0
,
H
=
m
=
A
=
s
=
n
=
n
=
q
=
r
=
p
=
m
=
A
=
s
=
F
=
m
=
A
=
s
=
F
=
m
=
A
=
s
=
void
0
,
B
=
0
,
G
=
0
,
P
=
0
,
T
=
0
,
L
=
0
,
K
=
0
,
U
=
0
,
M
=
0
,
ca
=
0
,
w
=
0
,
da
=
0
,
A
=
s
=
0
,
fa
=
g
.
__vertexArray
,
$
=
g
.
__uvArray
,
aa
=
g
.
__uv2Array
,
Q
=
g
.
__normalArray
,
V
=
g
.
__tangentArray
,
ga
=
g
.
__colorArray
,
W
=
g
.
__skinVertexAArray
,
X
=
g
.
__skinVertexBArray
,
Y
=
g
.
__skinIndexArray
,
Z
=
g
.
__skinWeightArray
,
ea
=
g
.
__morphTargetsArrays
,
S
=
g
.
__webglCustomAttributes
,
m
=
void
0
,
N
=
g
.
__faceArray
,
R
=
g
.
__lineArray
,
la
=
g
.
__needsSmoothNormals
,
v
=
g
.
__vertexColorType
,
y
=
g
.
__uvType
,
z
=
g
.
__normalType
,
ja
=
i
.
geometry
,
ma
=
ja
.
__dirtyVertices
,
na
=
ja
.
__dirtyElements
,
ha
=
ja
.
__dirtyUvs
,
pa
=
ja
.
__dirtyNormals
,
qa
=
ja
.
__dirtyTangents
,
ra
=
ja
.
__dirtyColors
,
sa
=
ja
.
__dirtyMorphTargets
,
$
=
g
.
__uvArray
,
aa
=
g
.
__uv2Array
,
Q
=
g
.
__normalArray
,
V
=
g
.
__tangentArray
,
ga
=
g
.
__colorArray
,
W
=
g
.
__skinVertexAArray
,
X
=
g
.
__skinVertexBArray
,
Y
=
g
.
__skinIndexArray
,
Z
=
g
.
__skinWeightArray
,
ea
=
g
.
__morphTargetsArrays
,
S
=
g
.
__webglCustomAttributes
,
m
=
void
0
,
N
=
g
.
__faceArray
,
R
=
g
.
__lineArray
,
la
=
g
.
__needsSmoothNormals
,
v
=
g
.
__vertexColorType
,
y
=
g
.
__uvType
,
z
=
g
.
__normalType
,
ja
=
i
.
geometry
,
ma
=
ja
.
__dirtyVertices
,
na
=
ja
.
__dirtyElements
,
ha
=
ja
.
__dirtyUvs
,
pa
=
ja
.
__dirtyNormals
,
qa
=
ja
.
__dirtyTangents
,
ra
=
ja
.
__dirtyColors
,
sa
=
ja
.
__dirtyMorphTargets
,
ia
=
ja
.
vertices
,
ua
=
g
.
faces
,
xa
=
ja
.
faces
,
va
=
ja
.
faceVertexUvs
[
0
],
ya
=
ja
.
faceVertexUvs
[
1
],
oa
=
ja
.
skinVerticesA
,
ta
=
ja
.
skinVerticesB
,
wa
=
ja
.
skinIndices
,
Ba
=
ja
.
skinWeights
,
Ca
=
i
instanceof
THREE
.
ShadowVolume
?
ja
.
edgeFaces
:
void
0
,
Aa
=
ja
.
morphTargets
;
if
(
S
)
for
(
H
in
S
)
S
[
H
].
offset
=
0
,
S
[
H
].
offsetSrc
=
0
;
k
=
0
;
for
(
o
=
ua
.
length
;
k
<
o
;
k
++
)
if
(
n
=
ua
[
k
],
p
=
xa
[
n
],
va
&&
(
C
=
va
[
n
]),
ya
&&
(
D
=
ya
[
n
]),
n
=
p
.
vertexNormals
,
q
=
p
.
normal
,
t
=
p
.
vertexColors
,
u
=
p
.
color
,
r
=
p
.
vertexTangents
,
p
instanceof
THREE
.
Face3
){
if
(
ma
)
x
=
ia
[
p
.
a
].
position
,
J
=
ia
[
p
.
b
].
position
,
ia
=
ja
.
vertices
,
ua
=
g
.
faces
,
xa
=
ja
.
faces
,
va
=
ja
.
faceVertexUvs
[
0
],
ya
=
ja
.
faceVertexUvs
[
1
],
oa
=
ja
.
skinVerticesA
,
ta
=
ja
.
skinVerticesB
,
wa
=
ja
.
skinIndices
,
Ba
=
ja
.
skinWeights
,
Ca
=
i
instanceof
THREE
.
ShadowVolume
?
ja
.
edgeFaces
:
void
0
,
Aa
=
ja
.
morphTargets
;
if
(
S
)
for
(
H
in
S
)
S
[
H
].
offset
=
0
,
S
[
H
].
offsetSrc
=
0
;
k
=
0
;
for
(
o
=
ua
.
length
;
k
<
o
;
k
++
)
if
(
n
=
ua
[
k
],
p
=
xa
[
n
],
va
&&
(
C
=
va
[
n
]),
ya
&&
(
D
=
ya
[
n
]),
n
=
p
.
vertexNormals
,
q
=
p
.
normal
,
t
=
p
.
vertexColors
,
u
=
p
.
color
,
r
=
p
.
vertexTangents
,
p
instanceof
THREE
.
Face3
){
if
(
ma
)
x
=
ia
[
p
.
a
].
position
,
J
=
ia
[
p
.
b
].
position
,
I
=
ia
[
p
.
c
].
position
,
fa
[
G
]
=
x
.
x
,
fa
[
G
+
1
]
=
x
.
y
,
fa
[
G
+
2
]
=
x
.
z
,
fa
[
G
+
3
]
=
J
.
x
,
fa
[
G
+
4
]
=
J
.
y
,
fa
[
G
+
5
]
=
J
.
z
,
fa
[
G
+
6
]
=
I
.
x
,
fa
[
G
+
7
]
=
I
.
y
,
fa
[
G
+
8
]
=
I
.
z
,
G
+=
9
;
if
(
S
)
for
(
H
in
S
)
if
(
m
=
S
[
H
],
m
.
__original
.
needsUpdate
)
s
=
m
.
offset
,
A
=
m
.
offsetSrc
,
m
.
size
===
1
?(
m
.
boundTo
===
void
0
||
m
.
boundTo
===
"
vertices
"
?(
m
.
array
[
s
+
0
]
=
m
.
value
[
p
.
a
],
m
.
array
[
s
+
1
]
=
m
.
value
[
p
.
b
],
m
.
array
[
s
+
2
]
=
m
.
value
[
p
.
c
]):
m
.
boundTo
===
"
faces
"
?(
m
.
array
[
s
+
0
]
=
m
.
value
[
A
],
m
.
array
[
s
+
1
]
=
m
.
value
[
A
],
m
.
array
[
s
+
2
]
=
m
.
value
[
A
],
m
.
offsetSrc
++
):
m
.
boundTo
===
"
faceVertices
"
&&
(
m
.
array
[
s
+
0
]
=
m
.
value
[
A
+
I
=
ia
[
p
.
c
].
position
,
fa
[
G
]
=
x
.
x
,
fa
[
G
+
1
]
=
x
.
y
,
fa
[
G
+
2
]
=
x
.
z
,
fa
[
G
+
3
]
=
J
.
x
,
fa
[
G
+
4
]
=
J
.
y
,
fa
[
G
+
5
]
=
J
.
z
,
fa
[
G
+
6
]
=
I
.
x
,
fa
[
G
+
7
]
=
I
.
y
,
fa
[
G
+
8
]
=
I
.
z
,
G
+=
9
;
if
(
S
)
for
(
H
in
S
)
if
(
m
=
S
[
H
],
m
.
__original
.
needsUpdate
)
s
=
m
.
offset
,
A
=
m
.
offsetSrc
,
m
.
size
===
1
?(
m
.
boundTo
===
void
0
||
m
.
boundTo
===
"
vertices
"
?(
m
.
array
[
s
+
0
]
=
m
.
value
[
p
.
a
],
m
.
array
[
s
+
1
]
=
m
.
value
[
p
.
b
],
m
.
array
[
s
+
2
]
=
m
.
value
[
p
.
c
]):
m
.
boundTo
===
"
faces
"
?(
m
.
array
[
s
+
0
]
=
m
.
value
[
A
],
m
.
array
[
s
+
1
]
=
m
.
value
[
A
],
m
.
array
[
s
+
2
]
=
m
.
value
[
A
],
m
.
offsetSrc
++
):
m
.
boundTo
===
"
faceVertices
"
&&
(
m
.
array
[
s
+
0
]
=
m
.
value
[
A
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录