Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
28c165f8
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,发现更多精彩内容 >>
提交
28c165f8
编写于
6月 30, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
2c502ae5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
8 deletion
+6
-8
build/Three.js
build/Three.js
+3
-4
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+3
-4
未找到文件。
build/Three.js
浏览文件 @
28c165f8
...
...
@@ -384,7 +384,7 @@ this.getPrevKeyWith("pos",u,j.index-1).pos,this.points[1]=f,this.points[2]=g,thi
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
b
,
c
){
var
d
=
[],
e
=
[],
f
,
g
,
j
,
k
,
m
,
o
;
f
=
(
b
.
length
-
1
)
*
c
;
g
=
Math
.
floor
(
f
);
f
-=
g
;
d
[
0
]
=
g
==
0
?
g
:
g
-
1
;
d
[
1
]
=
g
;
d
[
2
]
=
g
>
b
.
length
-
2
?
g
:
g
+
1
;
d
[
3
]
=
g
>
b
.
length
-
3
?
g
:
g
+
2
;
g
=
b
[
d
[
0
]];
k
=
b
[
d
[
1
]];
m
=
b
[
d
[
2
]];
o
=
b
[
d
[
3
]];
d
=
f
*
f
;
j
=
f
*
d
;
e
[
0
]
=
this
.
interpolate
(
g
[
0
],
k
[
0
],
m
[
0
],
o
[
0
],
f
,
d
,
j
);
e
[
1
]
=
this
.
interpolate
(
g
[
1
],
k
[
1
],
m
[
1
],
o
[
1
],
f
,
d
,
j
);
e
[
2
]
=
this
.
interpolate
(
g
[
2
],
k
[
2
],
m
[
2
],
o
[
2
],
f
,
d
,
j
);
return
e
};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
b
,
c
,
d
,
e
,
f
,
g
,
j
){
b
=
(
d
-
b
)
*
0.5
;
e
=
(
e
-
c
)
*
0.5
;
return
(
2
*
(
c
-
d
)
+
b
+
e
)
*
j
+
(
-
3
*
(
c
-
d
)
-
2
*
b
-
e
)
*
g
+
b
*
f
+
c
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
b
,
c
,
d
){
var
e
=
this
.
data
.
hierarchy
[
c
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
d
=
d
<
e
.
length
-
1
?
d
:
e
.
length
-
1
:
d
%=
e
.
length
;
d
<
e
.
length
;
d
++
)
if
(
e
[
d
][
b
]
!==
void
0
)
return
e
[
d
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
b
,
c
,
d
){
for
(
var
e
=
this
.
data
.
hierarchy
[
c
].
keys
,
d
=
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
d
>
0
?
d
:
0
:
d
>=
0
?
d
:
d
+
e
.
length
;
d
>=
0
;
d
--
)
if
(
e
[
d
][
b
]
!==
void
0
)
return
e
[
d
];
return
this
.
data
.
hierarchy
[
c
].
keys
[
e
.
length
-
1
]};
THREE
.
Quake
Camera
=
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
.
FP
Camera
=
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
=
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
();
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
=
...
...
@@ -392,8 +392,7 @@ b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=
this
.
heightSpeed
?
this
.
tdiff
*
((
this
.
position
.
y
<
this
.
heightMin
?
this
.
heightMin
:
this
.
position
.
y
>
this
.
heightMax
?
this
.
heightMax
:
this
.
position
.
y
)
-
this
.
heightMin
)
*
this
.
heightCoef
:
0
;
var
c
=
this
.
tdiff
*
this
.
movementSpeed
;(
this
.
moveForward
||
this
.
autoForward
&&!
this
.
moveBackward
)
&&
this
.
translateZ
(
-
(
c
+
this
.
autoSpeedFactor
));
this
.
moveBackward
&&
this
.
translateZ
(
c
);
this
.
moveLeft
&&
this
.
translateX
(
-
c
);
this
.
moveRight
&&
this
.
translateX
(
c
);
c
=
this
.
tdiff
*
this
.
lookSpeed
;
this
.
activeLook
||
(
c
=
0
);
this
.
lon
+=
this
.
mouseX
*
c
;
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
c
);
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
Math
.
PI
/
180
;
this
.
theta
=
this
.
lon
*
Math
.
PI
/
180
;
var
b
=
this
.
target
.
position
,
f
=
this
.
position
;
b
.
x
=
f
.
x
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
b
.
y
=
f
.
y
+
100
*
Math
.
cos
(
this
.
phi
);
b
.
z
=
f
.
z
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
sin
(
this
.
theta
)}
this
.
lon
+=
this
.
mouseX
*
c
;
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
c
);
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
Math
.
PI
/
180
;
this
.
theta
=
this
.
lon
*
Math
.
PI
/
180
;
if
(
this
.
constrainVertical
)
this
.
phi
=
(
this
.
phi
-
0
)
*
(
this
.
verticalMax
-
this
.
verticalMin
)
/
3.14
+
this
.
verticalMin
;
b
=
this
.
target
.
position
;
f
=
this
.
position
;
b
.
x
=
f
.
x
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
b
.
y
=
f
.
y
+
100
*
Math
.
cos
(
this
.
phi
);
b
.
z
=
f
.
z
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
sin
(
this
.
theta
);
this
.
supr
.
update
.
call
(
this
)};
this
.
domElement
.
addEventListener
(
"
contextmenu
"
,
function
(
b
){
b
.
preventDefault
()},
!
1
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
c
(
this
,
this
.
onMouseMove
),
!
1
);
this
.
domElement
.
addEventListener
(
"
mousedown
"
,
c
(
this
,
this
.
onMouseDown
),
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
c
(
this
,
this
.
onMouseUp
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keydown
"
,
c
(
this
,
this
.
onKeyDown
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keyup
"
,
c
(
this
,
this
.
onKeyUp
),
!
1
)};
THREE
.
QuakeCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
QuakeCamera
.
prototype
.
constructor
=
THREE
.
QuakeCamera
;
THREE
.
QuakeCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
QuakeCamera
.
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
))};
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
c
(
this
,
this
.
onMouseUp
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keydown
"
,
c
(
this
,
this
.
onKeyDown
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keyup
"
,
c
(
this
,
this
.
onKeyUp
),
!
1
)};
THREE
.
FPCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
FPCamera
.
prototype
.
constructor
=
THREE
.
FPCamera
;
THREE
.
FPCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
FPCamera
.
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
,
d
,
c
,
e
){
var
g
=
{
name
:
c
,
fps
:
0.6
,
length
:
e
,
hierarchy
:[]},
f
,
j
=
d
.
getControlPointsArray
(),
k
=
d
.
getLength
(),
m
=
j
.
length
,
I
=
0
;
f
=
m
-
1
;
d
=
{
parent
:
-
1
,
keys
:[]};
d
.
keys
[
0
]
=
{
time
:
0
,
pos
:
j
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
d
.
keys
[
f
]
=
{
time
:
e
,
pos
:
j
[
f
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
f
=
1
;
f
<
m
-
1
;
f
++
)
I
=
e
*
k
.
chunks
[
f
]
/
k
.
total
,
d
.
keys
[
f
]
=
{
time
:
I
,
pos
:
j
[
f
]};
g
.
hierarchy
[
0
]
=
d
;
THREE
.
AnimationHandler
.
add
(
g
);
return
new
THREE
.
Animation
(
b
,
c
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
d
(
b
,
d
){
var
c
,
e
,
g
=
new
THREE
.
Geometry
;
for
(
c
=
0
;
c
<
b
.
points
.
length
*
d
;
c
++
)
e
=
c
/
(
b
.
points
.
length
*
d
),
e
=
b
.
getPoint
(
e
),
g
.
vertices
[
c
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
e
.
x
,
e
.
y
,
e
.
z
));
return
g
}
function
e
(
b
,
c
){
var
e
=
d
(
c
,
10
),
g
=
d
(
c
,
10
),
f
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
e
,
f
);
particleObj
=
new
THREE
.
ParticleSystem
(
g
,
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
);
g
=
new
THREE
.
SphereGeometry
(
1
,
16
,
8
);
f
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
c
.
points
.
length
;
i
++
)
e
=
new
THREE
.
Mesh
(
g
,
f
),
e
.
position
.
copy
(
c
.
points
[
i
]),
e
.
updateMatrix
(),
b
.
addChild
(
e
)}
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
=
...
...
@@ -431,7 +430,7 @@ f.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.po
c
(
this
,
function
(
b
){
d
&&
(
g
=
j
=
this
.
getMouseProjectionOnBall
(
b
.
clientX
,
b
.
clientY
),
k
=
m
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
),
o
=
n
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
),
d
=!
1
);
e
!==
this
.
STATE
.
NONE
&&
(
e
===
this
.
STATE
.
ROTATE
?
j
=
this
.
getMouseProjectionOnBall
(
b
.
clientX
,
b
.
clientY
):
e
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
m
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
):
e
===
this
.
STATE
.
PAN
&&!
this
.
noPan
&&
(
n
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
)))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mousedown
"
,
c
(
this
,
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
e
===
this
.
STATE
.
NONE
)
e
=
b
.
button
,
e
===
this
.
STATE
.
ROTATE
?
g
=
j
=
this
.
getMouseProjectionOnBall
(
b
.
clientX
,
b
.
clientY
):
e
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
k
=
m
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
):
this
.
noPan
||
(
o
=
n
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
c
(
this
,
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
e
=
this
.
STATE
.
NONE
}),
!
1
);
window
.
addEventListener
(
"
keydown
"
,
c
(
this
,
function
(
b
){
if
(
e
===
this
.
STATE
.
NONE
){
if
(
b
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ROTATE
])
e
=
this
.
STATE
.
ROTATE
;
else
if
(
b
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ZOOM
]
&&!
this
.
noZoom
)
e
=
this
.
STATE
.
ZOOM
;
else
if
(
b
.
keyCode
===
this
.
keys
[
this
.
STATE
.
PAN
]
&&!
this
.
noPan
)
e
=
this
.
STATE
.
PAN
;
e
!==
this
.
STATE
.
NONE
&&
(
d
=!
0
)}}),
!
1
);
window
.
addEventListener
(
"
keyup
"
,
c
(
this
,
function
(){
if
(
e
!==
this
.
STATE
.
NONE
)
e
=
this
.
STATE
.
NONE
}),
!
1
)};
THREE
.
TrackballCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
TrackballCamera
.
prototype
.
constructor
=
THREE
.
TrackballCamera
;
THREE
.
TrackballCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
TrackballCamera
.
prototype
.
STATE
=
{
NONE
:
-
1
,
ROTATE
:
0
,
ZOOM
:
1
,
PAN
:
2
};
THREE
.
TrackballCamera
.
prototype
.
STATE
=
{
NONE
:
-
1
,
ROTATE
:
0
,
ZOOM
:
1
,
PAN
:
2
};
THREE
.
QuakeCamera
=
THREE
.
FPCamera
;
THREE
.
CubeGeometry
=
function
(
b
,
c
,
d
,
e
,
f
,
g
,
j
,
k
,
m
){
function
o
(
b
,
d
,
c
,
j
,
k
,
m
,
o
,
p
){
var
t
,
u
,
v
=
e
||
1
,
y
=
f
||
1
,
S
=
k
/
2
,
T
=
m
/
2
,
h
=
n
.
vertices
.
length
;
if
(
b
==
"
x
"
&&
d
==
"
y
"
||
b
==
"
y
"
&&
d
==
"
x
"
)
t
=
"
z
"
;
else
if
(
b
==
"
x
"
&&
d
==
"
z
"
||
b
==
"
z
"
&&
d
==
"
x
"
)
t
=
"
y
"
,
y
=
g
||
1
;
else
if
(
b
==
"
z
"
&&
d
==
"
y
"
||
b
==
"
y
"
&&
d
==
"
z
"
)
t
=
"
x
"
,
v
=
g
||
1
;
var
R
=
v
+
1
,
J
=
y
+
1
;
k
/=
v
;
var
P
=
m
/
y
;
for
(
u
=
0
;
u
<
J
;
u
++
)
for
(
m
=
0
;
m
<
R
;
m
++
){
var
Q
=
new
THREE
.
Vector3
;
Q
[
b
]
=
(
m
*
k
-
S
)
*
c
;
Q
[
d
]
=
(
u
*
P
-
T
)
*
j
;
Q
[
t
]
=
o
;
n
.
vertices
.
push
(
new
THREE
.
Vertex
(
Q
))}
for
(
u
=
0
;
u
<
y
;
u
++
)
for
(
m
=
0
;
m
<
v
;
m
++
)
n
.
faces
.
push
(
new
THREE
.
Face4
(
m
+
R
*
u
+
h
,
m
+
R
*
(
u
+
1
)
+
h
,
m
+
1
+
R
*
(
u
+
1
)
+
h
,
m
+
1
+
R
*
u
+
h
,
null
,
null
,
p
)),
n
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
m
/
v
,
u
/
y
),
new
THREE
.
UV
(
m
/
v
,(
u
+
1
)
/
y
),
new
THREE
.
UV
((
m
+
1
)
/
v
,(
u
+
1
)
/
y
),
new
THREE
.
UV
((
m
+
1
)
/
v
,
u
/
y
)])}
THREE
.
Geometry
.
call
(
this
);
var
n
=
this
,
t
=
b
/
2
,
p
=
c
/
2
,
u
=
d
/
2
,
k
=
k
?
-
1
:
1
;
if
(
j
!==
void
0
)
if
(
j
instanceof
Array
)
this
.
materials
=
j
;
else
{
this
.
materials
=
[];
for
(
var
v
=
0
;
v
<
6
;
v
++
)
this
.
materials
.
push
([
j
])}
else
this
.
materials
=
[];
this
.
sides
=
{
px
:
!
0
,
nx
:
!
0
,
py
:
!
0
,
ny
:
!
0
,
pz
:
!
0
,
nz
:
!
0
};
if
(
m
!=
void
0
)
for
(
var
y
in
m
)
this
.
sides
[
y
]
!=
void
0
&&
(
this
.
sides
[
y
]
=
m
[
y
]);
this
.
sides
.
px
&&
o
(
"
z
"
,
"
y
"
,
1
*
k
,
-
1
,
d
,
c
,
-
t
,
this
.
materials
[
0
]);
this
.
sides
.
nx
&&
o
(
"
z
"
,
"
y
"
,
-
1
*
k
,
-
1
,
d
,
c
,
t
,
this
.
materials
[
1
]);
this
.
sides
.
py
&&
o
(
"
x
"
,
"
z
"
,
1
*
k
,
1
,
b
,
d
,
p
,
this
.
materials
[
2
]);
this
.
sides
.
ny
&&
o
(
"
x
"
,
"
z
"
,
1
*
k
,
-
1
,
b
,
d
,
-
p
,
this
.
materials
[
3
]);
this
.
sides
.
pz
&&
o
(
"
x
"
,
"
y
"
,
1
*
k
,
-
1
,
b
,
c
,
u
,
this
.
materials
[
4
]);
this
.
sides
.
nz
&&
o
(
"
x
"
,
"
y
"
,
-
1
*
k
,
-
1
,
b
,
c
,
-
u
,
this
.
materials
[
5
]);(
function
(){
for
(
var
b
=
[],
d
=
[],
c
=
0
,
e
=
n
.
vertices
.
length
;
c
<
e
;
c
++
){
for
(
var
g
=
n
.
vertices
[
c
],
f
=!
1
,
j
=
0
,
k
=
b
.
length
;
j
<
k
;
j
++
){
var
m
=
b
[
j
];
if
(
g
.
position
.
x
==
m
.
position
.
x
&&
...
...
build/custom/ThreeExtras.js
浏览文件 @
28c165f8
...
...
@@ -35,7 +35,7 @@ this.getPrevKeyWith("pos",o,g.index-1).pos,this.points[1]=e,this.points[2]=f,thi
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
a
,
b
){
var
c
=
[],
d
=
[],
e
,
f
,
g
,
j
,
h
,
k
;
e
=
(
a
.
length
-
1
)
*
b
;
f
=
Math
.
floor
(
e
);
e
-=
f
;
c
[
0
]
=
f
==
0
?
f
:
f
-
1
;
c
[
1
]
=
f
;
c
[
2
]
=
f
>
a
.
length
-
2
?
f
:
f
+
1
;
c
[
3
]
=
f
>
a
.
length
-
3
?
f
:
f
+
2
;
f
=
a
[
c
[
0
]];
j
=
a
[
c
[
1
]];
h
=
a
[
c
[
2
]];
k
=
a
[
c
[
3
]];
c
=
e
*
e
;
g
=
e
*
c
;
d
[
0
]
=
this
.
interpolate
(
f
[
0
],
j
[
0
],
h
[
0
],
k
[
0
],
e
,
c
,
g
);
d
[
1
]
=
this
.
interpolate
(
f
[
1
],
j
[
1
],
h
[
1
],
k
[
1
],
e
,
c
,
g
);
d
[
2
]
=
this
.
interpolate
(
f
[
2
],
j
[
2
],
h
[
2
],
k
[
2
],
e
,
c
,
g
);
return
d
};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
a
=
(
c
-
a
)
*
0.5
;
d
=
(
d
-
b
)
*
0.5
;
return
(
2
*
(
b
-
c
)
+
a
+
d
)
*
g
+
(
-
3
*
(
b
-
c
)
-
2
*
a
-
d
)
*
f
+
a
*
e
+
b
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
a
,
b
,
c
){
var
d
=
this
.
data
.
hierarchy
[
b
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
c
=
c
<
d
.
length
-
1
?
c
:
d
.
length
-
1
:
c
%=
d
.
length
;
c
<
d
.
length
;
c
++
)
if
(
d
[
c
][
a
]
!==
void
0
)
return
d
[
c
];
return
this
.
data
.
hierarchy
[
b
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
a
,
b
,
c
){
for
(
var
d
=
this
.
data
.
hierarchy
[
b
].
keys
,
c
=
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
c
>
0
?
c
:
0
:
c
>=
0
?
c
:
c
+
d
.
length
;
c
>=
0
;
c
--
)
if
(
d
[
c
][
a
]
!==
void
0
)
return
d
[
c
];
return
this
.
data
.
hierarchy
[
b
].
keys
[
d
.
length
-
1
]};
THREE
.
Quake
Camera
=
function
(
a
){
function
b
(
a
,
b
){
return
function
(){
b
.
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
.
FP
Camera
=
function
(
a
){
function
b
(
a
,
b
){
return
function
(){
b
.
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
=
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
();
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
=
...
...
@@ -43,8 +43,7 @@ a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
this
.
heightSpeed
?
this
.
tdiff
*
((
this
.
position
.
y
<
this
.
heightMin
?
this
.
heightMin
:
this
.
position
.
y
>
this
.
heightMax
?
this
.
heightMax
:
this
.
position
.
y
)
-
this
.
heightMin
)
*
this
.
heightCoef
:
0
;
var
b
=
this
.
tdiff
*
this
.
movementSpeed
;(
this
.
moveForward
||
this
.
autoForward
&&!
this
.
moveBackward
)
&&
this
.
translateZ
(
-
(
b
+
this
.
autoSpeedFactor
));
this
.
moveBackward
&&
this
.
translateZ
(
b
);
this
.
moveLeft
&&
this
.
translateX
(
-
b
);
this
.
moveRight
&&
this
.
translateX
(
b
);
b
=
this
.
tdiff
*
this
.
lookSpeed
;
this
.
activeLook
||
(
b
=
0
);
this
.
lon
+=
this
.
mouseX
*
b
;
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
b
);
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
Math
.
PI
/
180
;
this
.
theta
=
this
.
lon
*
Math
.
PI
/
180
;
var
a
=
this
.
target
.
position
,
e
=
this
.
position
;
a
.
x
=
e
.
x
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
a
.
y
=
e
.
y
+
100
*
Math
.
cos
(
this
.
phi
);
a
.
z
=
e
.
z
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
sin
(
this
.
theta
)}
this
.
lon
+=
this
.
mouseX
*
b
;
this
.
lookVertical
&&
(
this
.
lat
-=
this
.
mouseY
*
b
);
this
.
lat
=
Math
.
max
(
-
85
,
Math
.
min
(
85
,
this
.
lat
));
this
.
phi
=
(
90
-
this
.
lat
)
*
Math
.
PI
/
180
;
this
.
theta
=
this
.
lon
*
Math
.
PI
/
180
;
if
(
this
.
constrainVertical
)
this
.
phi
=
(
this
.
phi
-
0
)
*
(
this
.
verticalMax
-
this
.
verticalMin
)
/
3.14
+
this
.
verticalMin
;
a
=
this
.
target
.
position
;
e
=
this
.
position
;
a
.
x
=
e
.
x
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
a
.
y
=
e
.
y
+
100
*
Math
.
cos
(
this
.
phi
);
a
.
z
=
e
.
z
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
sin
(
this
.
theta
);
this
.
supr
.
update
.
call
(
this
)};
this
.
domElement
.
addEventListener
(
"
contextmenu
"
,
function
(
a
){
a
.
preventDefault
()},
!
1
);
this
.
domElement
.
addEventListener
(
"
mousemove
"
,
b
(
this
,
this
.
onMouseMove
),
!
1
);
this
.
domElement
.
addEventListener
(
"
mousedown
"
,
b
(
this
,
this
.
onMouseDown
),
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
b
(
this
,
this
.
onMouseUp
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keydown
"
,
b
(
this
,
this
.
onKeyDown
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keyup
"
,
b
(
this
,
this
.
onKeyUp
),
!
1
)};
THREE
.
QuakeCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
QuakeCamera
.
prototype
.
constructor
=
THREE
.
QuakeCamera
;
THREE
.
QuakeCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
QuakeCamera
.
prototype
.
translate
=
function
(
a
,
b
){
this
.
matrix
.
rotateAxis
(
b
);
if
(
this
.
noFly
)
b
.
y
=
0
;
this
.
position
.
addSelf
(
b
.
multiplyScalar
(
a
));
this
.
target
.
position
.
addSelf
(
b
.
multiplyScalar
(
a
))};
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
b
(
this
,
this
.
onMouseUp
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keydown
"
,
b
(
this
,
this
.
onKeyDown
),
!
1
);
this
.
domElement
.
addEventListener
(
"
keyup
"
,
b
(
this
,
this
.
onKeyUp
),
!
1
)};
THREE
.
FPCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
FPCamera
.
prototype
.
constructor
=
THREE
.
FPCamera
;
THREE
.
FPCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
FPCamera
.
prototype
.
translate
=
function
(
a
,
b
){
this
.
matrix
.
rotateAxis
(
b
);
if
(
this
.
noFly
)
b
.
y
=
0
;
this
.
position
.
addSelf
(
b
.
multiplyScalar
(
a
));
this
.
target
.
position
.
addSelf
(
b
.
multiplyScalar
(
a
))};
THREE
.
PathCamera
=
function
(
a
){
function
b
(
a
,
c
,
b
,
d
){
var
f
=
{
name
:
b
,
fps
:
0.6
,
length
:
d
,
hierarchy
:[]},
e
,
g
=
c
.
getControlPointsArray
(),
j
=
c
.
getLength
(),
h
=
g
.
length
,
v
=
0
;
e
=
h
-
1
;
c
=
{
parent
:
-
1
,
keys
:[]};
c
.
keys
[
0
]
=
{
time
:
0
,
pos
:
g
[
0
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
c
.
keys
[
e
]
=
{
time
:
d
,
pos
:
g
[
e
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
e
=
1
;
e
<
h
-
1
;
e
++
)
v
=
d
*
j
.
chunks
[
e
]
/
j
.
total
,
c
.
keys
[
e
]
=
{
time
:
v
,
pos
:
g
[
e
]};
f
.
hierarchy
[
0
]
=
c
;
THREE
.
AnimationHandler
.
add
(
f
);
return
new
THREE
.
Animation
(
a
,
b
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
c
(
a
,
c
){
var
b
,
d
,
f
=
new
THREE
.
Geometry
;
for
(
b
=
0
;
b
<
a
.
points
.
length
*
c
;
b
++
)
d
=
b
/
(
a
.
points
.
length
*
c
),
d
=
a
.
getPoint
(
d
),
f
.
vertices
[
b
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
d
.
x
,
d
.
y
,
d
.
z
));
return
f
}
function
d
(
a
,
b
){
var
d
=
c
(
b
,
10
),
f
=
c
(
b
,
10
),
e
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
d
,
e
);
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
);
e
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
b
.
points
.
length
;
i
++
)
d
=
new
THREE
.
Mesh
(
f
,
e
),
d
.
position
.
copy
(
b
.
points
[
i
]),
d
.
updateMatrix
(),
a
.
addChild
(
d
)}
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
=
...
...
@@ -82,7 +81,7 @@ e.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.po
b
(
this
,
function
(
a
){
c
&&
(
f
=
g
=
this
.
getMouseProjectionOnBall
(
a
.
clientX
,
a
.
clientY
),
j
=
h
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
),
k
=
l
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
),
c
=!
1
);
d
!==
this
.
STATE
.
NONE
&&
(
d
===
this
.
STATE
.
ROTATE
?
g
=
this
.
getMouseProjectionOnBall
(
a
.
clientX
,
a
.
clientY
):
d
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
h
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
):
d
===
this
.
STATE
.
PAN
&&!
this
.
noPan
&&
(
l
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
)))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mousedown
"
,
b
(
this
,
function
(
a
){
a
.
preventDefault
();
a
.
stopPropagation
();
if
(
d
===
this
.
STATE
.
NONE
)
d
=
a
.
button
,
d
===
this
.
STATE
.
ROTATE
?
f
=
g
=
this
.
getMouseProjectionOnBall
(
a
.
clientX
,
a
.
clientY
):
d
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
j
=
h
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
):
this
.
noPan
||
(
k
=
l
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
b
(
this
,
function
(
a
){
a
.
preventDefault
();
a
.
stopPropagation
();
d
=
this
.
STATE
.
NONE
}),
!
1
);
window
.
addEventListener
(
"
keydown
"
,
b
(
this
,
function
(
a
){
if
(
d
===
this
.
STATE
.
NONE
){
if
(
a
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ROTATE
])
d
=
this
.
STATE
.
ROTATE
;
else
if
(
a
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ZOOM
]
&&!
this
.
noZoom
)
d
=
this
.
STATE
.
ZOOM
;
else
if
(
a
.
keyCode
===
this
.
keys
[
this
.
STATE
.
PAN
]
&&!
this
.
noPan
)
d
=
this
.
STATE
.
PAN
;
d
!==
this
.
STATE
.
NONE
&&
(
c
=!
0
)}}),
!
1
);
window
.
addEventListener
(
"
keyup
"
,
b
(
this
,
function
(){
if
(
d
!==
this
.
STATE
.
NONE
)
d
=
this
.
STATE
.
NONE
}),
!
1
)};
THREE
.
TrackballCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
TrackballCamera
.
prototype
.
constructor
=
THREE
.
TrackballCamera
;
THREE
.
TrackballCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
TrackballCamera
.
prototype
.
STATE
=
{
NONE
:
-
1
,
ROTATE
:
0
,
ZOOM
:
1
,
PAN
:
2
};
THREE
.
TrackballCamera
.
prototype
.
STATE
=
{
NONE
:
-
1
,
ROTATE
:
0
,
ZOOM
:
1
,
PAN
:
2
};
THREE
.
QuakeCamera
=
THREE
.
FPCamera
;
THREE
.
CubeGeometry
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
j
,
h
){
function
k
(
a
,
c
,
b
,
g
,
j
,
h
,
k
,
m
){
var
o
,
n
,
t
=
d
||
1
,
u
=
e
||
1
,
L
=
j
/
2
,
G
=
h
/
2
,
M
=
l
.
vertices
.
length
;
if
(
a
==
"
x
"
&&
c
==
"
y
"
||
a
==
"
y
"
&&
c
==
"
x
"
)
o
=
"
z
"
;
else
if
(
a
==
"
x
"
&&
c
==
"
z
"
||
a
==
"
z
"
&&
c
==
"
x
"
)
o
=
"
y
"
,
u
=
f
||
1
;
else
if
(
a
==
"
z
"
&&
c
==
"
y
"
||
a
==
"
y
"
&&
c
==
"
z
"
)
o
=
"
x
"
,
t
=
f
||
1
;
var
H
=
t
+
1
,
A
=
u
+
1
;
j
/=
t
;
var
I
=
h
/
u
;
for
(
n
=
0
;
n
<
A
;
n
++
)
for
(
h
=
0
;
h
<
H
;
h
++
){
var
K
=
new
THREE
.
Vector3
;
K
[
a
]
=
(
h
*
j
-
L
)
*
b
;
K
[
c
]
=
(
n
*
I
-
G
)
*
g
;
K
[
o
]
=
k
;
l
.
vertices
.
push
(
new
THREE
.
Vertex
(
K
))}
for
(
n
=
0
;
n
<
u
;
n
++
)
for
(
h
=
0
;
h
<
t
;
h
++
)
l
.
faces
.
push
(
new
THREE
.
Face4
(
h
+
H
*
n
+
M
,
h
+
H
*
(
n
+
1
)
+
M
,
h
+
1
+
H
*
(
n
+
1
)
+
M
,
h
+
1
+
H
*
n
+
M
,
null
,
null
,
m
)),
l
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
h
/
t
,
n
/
u
),
new
THREE
.
UV
(
h
/
t
,(
n
+
1
)
/
u
),
new
THREE
.
UV
((
h
+
1
)
/
t
,(
n
+
1
)
/
u
),
new
THREE
.
UV
((
h
+
1
)
/
t
,
n
/
u
)])}
THREE
.
Geometry
.
call
(
this
);
var
l
=
this
,
m
=
a
/
2
,
n
=
b
/
2
,
o
=
c
/
2
,
j
=
j
?
-
1
:
1
;
if
(
g
!==
void
0
)
if
(
g
instanceof
Array
)
this
.
materials
=
g
;
else
{
this
.
materials
=
[];
for
(
var
t
=
0
;
t
<
6
;
t
++
)
this
.
materials
.
push
([
g
])}
else
this
.
materials
=
[];
this
.
sides
=
{
px
:
!
0
,
nx
:
!
0
,
py
:
!
0
,
ny
:
!
0
,
pz
:
!
0
,
nz
:
!
0
};
if
(
h
!=
void
0
)
for
(
var
u
in
h
)
this
.
sides
[
u
]
!=
void
0
&&
(
this
.
sides
[
u
]
=
h
[
u
]);
this
.
sides
.
px
&&
k
(
"
z
"
,
"
y
"
,
1
*
j
,
-
1
,
c
,
b
,
-
m
,
this
.
materials
[
0
]);
this
.
sides
.
nx
&&
k
(
"
z
"
,
"
y
"
,
-
1
*
j
,
-
1
,
c
,
b
,
m
,
this
.
materials
[
1
]);
this
.
sides
.
py
&&
k
(
"
x
"
,
"
z
"
,
1
*
j
,
1
,
a
,
c
,
n
,
this
.
materials
[
2
]);
this
.
sides
.
ny
&&
k
(
"
x
"
,
"
z
"
,
1
*
j
,
-
1
,
a
,
c
,
-
n
,
this
.
materials
[
3
]);
this
.
sides
.
pz
&&
k
(
"
x
"
,
"
y
"
,
1
*
j
,
-
1
,
a
,
b
,
o
,
this
.
materials
[
4
]);
this
.
sides
.
nz
&&
k
(
"
x
"
,
"
y
"
,
-
1
*
j
,
-
1
,
a
,
b
,
-
o
,
this
.
materials
[
5
]);(
function
(){
for
(
var
a
=
[],
c
=
[],
b
=
0
,
d
=
l
.
vertices
.
length
;
b
<
d
;
b
++
){
for
(
var
f
=
l
.
vertices
[
b
],
e
=!
1
,
g
=
0
,
j
=
a
.
length
;
g
<
j
;
g
++
){
var
h
=
a
[
g
];
if
(
f
.
position
.
x
==
h
.
position
.
x
&&
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录