Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
70a6000d
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,发现更多精彩内容 >>
提交
70a6000d
编写于
7月 03, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rebuild libs.
上级
d7a82b34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
6 deletion
+8
-6
build/Three.js
build/Three.js
+4
-3
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+4
-3
未找到文件。
build/Three.js
浏览文件 @
70a6000d
...
...
@@ -382,7 +382,7 @@ this.getPrevKeyWith("pos",u,k.index-1).pos,this.points[1]=g,this.points[2]=h,thi
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
b
,
c
){
var
e
=
[],
f
=
[],
g
,
h
,
k
,
m
,
n
,
o
;
g
=
(
b
.
length
-
1
)
*
c
;
h
=
Math
.
floor
(
g
);
g
-=
h
;
e
[
0
]
=
h
==
0
?
h
:
h
-
1
;
e
[
1
]
=
h
;
e
[
2
]
=
h
>
b
.
length
-
2
?
h
:
h
+
1
;
e
[
3
]
=
h
>
b
.
length
-
3
?
h
:
h
+
2
;
h
=
b
[
e
[
0
]];
m
=
b
[
e
[
1
]];
n
=
b
[
e
[
2
]];
o
=
b
[
e
[
3
]];
e
=
g
*
g
;
k
=
g
*
e
;
f
[
0
]
=
this
.
interpolate
(
h
[
0
],
m
[
0
],
n
[
0
],
o
[
0
],
g
,
e
,
k
);
f
[
1
]
=
this
.
interpolate
(
h
[
1
],
m
[
1
],
n
[
1
],
o
[
1
],
g
,
e
,
k
);
f
[
2
]
=
this
.
interpolate
(
h
[
2
],
m
[
2
],
n
[
2
],
o
[
2
],
g
,
e
,
k
);
return
f
};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
b
,
c
,
e
,
f
,
g
,
h
,
k
){
b
=
(
e
-
b
)
*
0.5
;
f
=
(
f
-
c
)
*
0.5
;
return
(
2
*
(
c
-
e
)
+
b
+
f
)
*
k
+
(
-
3
*
(
c
-
e
)
-
2
*
b
-
f
)
*
h
+
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
.
F
P
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.0050
;
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
.
F
irstPerson
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.0050
;
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
=
...
...
@@ -390,7 +390,8 @@ 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
,
g
=
this
.
position
;
b
.
x
=
g
.
x
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
b
.
y
=
g
.
y
+
100
*
Math
.
cos
(
this
.
phi
);
b
.
z
=
g
.
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
;
g
=
this
.
position
;
b
.
x
=
g
.
x
+
100
*
Math
.
sin
(
this
.
phi
)
*
Math
.
cos
(
this
.
theta
);
b
.
y
=
g
.
y
+
100
*
Math
.
cos
(
this
.
phi
);
b
.
z
=
g
.
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
.
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
))};
!
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
.
FirstPersonCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
FirstPersonCamera
.
prototype
.
constructor
=
THREE
.
FirstPersonCamera
;
THREE
.
FirstPersonCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
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
,
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.0050
;
this
.
lookHorizontal
=
...
...
@@ -428,7 +429,7 @@ g.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.po
c
(
this
,
function
(
b
){
e
&&
(
h
=
k
=
this
.
getMouseProjectionOnBall
(
b
.
clientX
,
b
.
clientY
),
m
=
n
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
),
o
=
p
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
),
e
=!
1
);
f
!==
this
.
STATE
.
NONE
&&
(
f
===
this
.
STATE
.
ROTATE
?
k
=
this
.
getMouseProjectionOnBall
(
b
.
clientX
,
b
.
clientY
):
f
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
n
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
):
f
===
this
.
STATE
.
PAN
&&!
this
.
noPan
&&
(
p
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
)))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mousedown
"
,
c
(
this
,
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
if
(
f
===
this
.
STATE
.
NONE
)
f
=
b
.
button
,
f
===
this
.
STATE
.
ROTATE
?
h
=
k
=
this
.
getMouseProjectionOnBall
(
b
.
clientX
,
b
.
clientY
):
f
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
m
=
n
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
):
this
.
noPan
||
(
o
=
p
=
this
.
getMouseOnScreen
(
b
.
clientX
,
b
.
clientY
))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
c
(
this
,
function
(
b
){
b
.
preventDefault
();
b
.
stopPropagation
();
f
=
this
.
STATE
.
NONE
}),
!
1
);
window
.
addEventListener
(
"
keydown
"
,
c
(
this
,
function
(
b
){
if
(
f
===
this
.
STATE
.
NONE
){
if
(
b
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ROTATE
])
f
=
this
.
STATE
.
ROTATE
;
else
if
(
b
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ZOOM
]
&&!
this
.
noZoom
)
f
=
this
.
STATE
.
ZOOM
;
else
if
(
b
.
keyCode
===
this
.
keys
[
this
.
STATE
.
PAN
]
&&!
this
.
noPan
)
f
=
this
.
STATE
.
PAN
;
f
!==
this
.
STATE
.
NONE
&&
(
e
=!
0
)}}),
!
1
);
window
.
addEventListener
(
"
keyup
"
,
c
(
this
,
function
(){
if
(
f
!==
this
.
STATE
.
NONE
)
f
=
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
.
QuakeCamera
=
THREE
.
F
P
Camera
;
THREE
.
TrackballCamera
.
prototype
.
STATE
=
{
NONE
:
-
1
,
ROTATE
:
0
,
ZOOM
:
1
,
PAN
:
2
};
THREE
.
QuakeCamera
=
THREE
.
F
irstPerson
Camera
;
THREE
.
CubeGeometry
=
function
(
b
,
c
,
e
,
f
,
g
,
h
,
k
,
m
,
n
){
function
o
(
b
,
c
,
e
,
k
,
m
,
n
,
o
,
t
){
var
u
,
v
,
w
=
f
||
1
,
B
=
g
||
1
,
K
=
m
/
2
,
ea
=
n
/
2
,
j
=
p
.
vertices
.
length
;
if
(
b
==
"
x
"
&&
c
==
"
y
"
||
b
==
"
y
"
&&
c
==
"
x
"
)
u
=
"
z
"
;
else
if
(
b
==
"
x
"
&&
c
==
"
z
"
||
b
==
"
z
"
&&
c
==
"
x
"
)
u
=
"
y
"
,
B
=
h
||
1
;
else
if
(
b
==
"
z
"
&&
c
==
"
y
"
||
b
==
"
y
"
&&
c
==
"
z
"
)
u
=
"
x
"
,
w
=
h
||
1
;
var
ca
=
w
+
1
,
T
=
B
+
1
;
m
/=
w
;
var
Z
=
n
/
B
;
for
(
v
=
0
;
v
<
T
;
v
++
)
for
(
n
=
0
;
n
<
ca
;
n
++
){
var
N
=
new
THREE
.
Vector3
;
N
[
b
]
=
(
n
*
m
-
K
)
*
e
;
N
[
c
]
=
(
v
*
Z
-
ea
)
*
k
;
N
[
u
]
=
o
;
p
.
vertices
.
push
(
new
THREE
.
Vertex
(
N
))}
for
(
v
=
0
;
v
<
B
;
v
++
)
for
(
n
=
0
;
n
<
w
;
n
++
)
p
.
faces
.
push
(
new
THREE
.
Face4
(
n
+
ca
*
v
+
j
,
n
+
ca
*
(
v
+
1
)
+
j
,
n
+
1
+
ca
*
(
v
+
1
)
+
j
,
n
+
1
+
ca
*
v
+
j
,
null
,
null
,
t
)),
p
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
n
/
w
,
v
/
B
),
new
THREE
.
UV
(
n
/
w
,(
v
+
1
)
/
B
),
new
THREE
.
UV
((
n
+
1
)
/
w
,(
v
+
1
)
/
B
),
new
THREE
.
UV
((
n
+
1
)
/
w
,
v
/
B
)])}
THREE
.
Geometry
.
call
(
this
);
var
p
=
this
,
t
=
b
/
2
,
v
=
c
/
2
,
u
=
e
/
2
,
m
=
m
?
-
1
:
1
;
if
(
k
!==
void
0
)
if
(
k
instanceof
Array
)
this
.
materials
=
k
;
else
{
this
.
materials
=
[];
for
(
var
w
=
0
;
w
<
6
;
w
++
)
this
.
materials
.
push
([
k
])}
else
this
.
materials
=
[];
this
.
sides
=
{
px
:
!
0
,
nx
:
!
0
,
py
:
!
0
,
ny
:
!
0
,
pz
:
!
0
,
nz
:
!
0
};
if
(
n
!=
void
0
)
for
(
var
B
in
n
)
this
.
sides
[
B
]
!=
void
0
&&
(
this
.
sides
[
B
]
=
n
[
B
]);
this
.
sides
.
px
&&
o
(
"
z
"
,
"
y
"
,
1
*
m
,
-
1
,
e
,
c
,
-
t
,
this
.
materials
[
0
]);
this
.
sides
.
nx
&&
o
(
"
z
"
,
"
y
"
,
-
1
*
m
,
-
1
,
e
,
c
,
t
,
this
.
materials
[
1
]);
this
.
sides
.
py
&&
o
(
"
x
"
,
"
z
"
,
1
*
m
,
1
,
b
,
e
,
v
,
this
.
materials
[
2
]);
this
.
sides
.
ny
&&
o
(
"
x
"
,
"
z
"
,
1
*
m
,
-
1
,
b
,
e
,
-
v
,
this
.
materials
[
3
]);
this
.
sides
.
pz
&&
o
(
"
x
"
,
"
y
"
,
1
*
m
,
-
1
,
b
,
c
,
u
,
this
.
materials
[
4
]);
this
.
sides
.
nz
&&
o
(
"
x
"
,
"
y
"
,
-
1
*
m
,
-
1
,
b
,
c
,
-
u
,
this
.
materials
[
5
]);(
function
(){
for
(
var
b
=
[],
c
=
[],
e
=
0
,
f
=
p
.
vertices
.
length
;
e
<
f
;
e
++
){
for
(
var
h
=
p
.
vertices
[
e
],
g
=!
1
,
k
=
0
,
m
=
b
.
length
;
k
<
m
;
k
++
){
var
n
=
b
[
k
];
if
(
h
.
position
.
x
==
n
.
position
.
x
&&
...
...
build/custom/ThreeExtras.js
浏览文件 @
70a6000d
...
...
@@ -35,7 +35,7 @@ this.getPrevKeyWith("pos",p,g.index-1).pos,this.points[1]=e,this.points[2]=h,thi
THREE
.
Animation
.
prototype
.
interpolateCatmullRom
=
function
(
a
,
b
){
var
c
=
[],
f
=
[],
e
,
h
,
g
,
k
,
j
,
m
;
e
=
(
a
.
length
-
1
)
*
b
;
h
=
Math
.
floor
(
e
);
e
-=
h
;
c
[
0
]
=
h
==
0
?
h
:
h
-
1
;
c
[
1
]
=
h
;
c
[
2
]
=
h
>
a
.
length
-
2
?
h
:
h
+
1
;
c
[
3
]
=
h
>
a
.
length
-
3
?
h
:
h
+
2
;
h
=
a
[
c
[
0
]];
k
=
a
[
c
[
1
]];
j
=
a
[
c
[
2
]];
m
=
a
[
c
[
3
]];
c
=
e
*
e
;
g
=
e
*
c
;
f
[
0
]
=
this
.
interpolate
(
h
[
0
],
k
[
0
],
j
[
0
],
m
[
0
],
e
,
c
,
g
);
f
[
1
]
=
this
.
interpolate
(
h
[
1
],
k
[
1
],
j
[
1
],
m
[
1
],
e
,
c
,
g
);
f
[
2
]
=
this
.
interpolate
(
h
[
2
],
k
[
2
],
j
[
2
],
m
[
2
],
e
,
c
,
g
);
return
f
};
THREE
.
Animation
.
prototype
.
interpolate
=
function
(
a
,
b
,
c
,
f
,
e
,
h
,
g
){
a
=
(
c
-
a
)
*
0.5
;
f
=
(
f
-
b
)
*
0.5
;
return
(
2
*
(
b
-
c
)
+
a
+
f
)
*
g
+
(
-
3
*
(
b
-
c
)
-
2
*
a
-
f
)
*
h
+
a
*
e
+
b
};
THREE
.
Animation
.
prototype
.
getNextKeyWith
=
function
(
a
,
b
,
c
){
var
f
=
this
.
data
.
hierarchy
[
b
].
keys
;
for
(
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM
||
this
.
interpolationType
===
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
?
c
=
c
<
f
.
length
-
1
?
c
:
f
.
length
-
1
:
c
%=
f
.
length
;
c
<
f
.
length
;
c
++
)
if
(
f
[
c
][
a
]
!==
void
0
)
return
f
[
c
];
return
this
.
data
.
hierarchy
[
b
].
keys
[
0
]};
THREE
.
Animation
.
prototype
.
getPrevKeyWith
=
function
(
a
,
b
,
c
){
for
(
var
f
=
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
+
f
.
length
;
c
>=
0
;
c
--
)
if
(
f
[
c
][
a
]
!==
void
0
)
return
f
[
c
];
return
this
.
data
.
hierarchy
[
b
].
keys
[
f
.
length
-
1
]};
THREE
.
F
P
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.0050
;
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
.
F
irstPerson
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.0050
;
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,7 +43,8 @@ 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
.
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
))};
!
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
.
FirstPersonCamera
.
prototype
=
new
THREE
.
Camera
;
THREE
.
FirstPersonCamera
.
prototype
.
constructor
=
THREE
.
FirstPersonCamera
;
THREE
.
FirstPersonCamera
.
prototype
.
supr
=
THREE
.
Camera
.
prototype
;
THREE
.
FirstPersonCamera
.
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
,
f
){
var
h
=
{
name
:
b
,
fps
:
0.6
,
length
:
f
,
hierarchy
:[]},
e
,
g
=
c
.
getControlPointsArray
(),
k
=
c
.
getLength
(),
j
=
g
.
length
,
w
=
0
;
e
=
j
-
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
:
f
,
pos
:
g
[
e
],
rot
:[
0
,
0
,
0
,
1
],
scl
:[
1
,
1
,
1
]};
for
(
e
=
1
;
e
<
j
-
1
;
e
++
)
w
=
f
*
k
.
chunks
[
e
]
/
k
.
total
,
c
.
keys
[
e
]
=
{
time
:
w
,
pos
:
g
[
e
]};
h
.
hierarchy
[
0
]
=
c
;
THREE
.
AnimationHandler
.
add
(
h
);
return
new
THREE
.
Animation
(
a
,
b
,
THREE
.
AnimationHandler
.
CATMULLROM_FORWARD
,
!
1
)}
function
c
(
a
,
c
){
var
b
,
f
,
e
=
new
THREE
.
Geometry
;
for
(
b
=
0
;
b
<
a
.
points
.
length
*
c
;
b
++
)
f
=
b
/
(
a
.
points
.
length
*
c
),
f
=
a
.
getPoint
(
f
),
e
.
vertices
[
b
]
=
new
THREE
.
Vertex
(
new
THREE
.
Vector3
(
f
.
x
,
f
.
y
,
f
.
z
));
return
e
}
function
f
(
a
,
b
){
var
f
=
c
(
b
,
10
),
e
=
c
(
b
,
10
),
h
=
new
THREE
.
LineBasicMaterial
({
color
:
16711680
,
linewidth
:
3
});
lineObj
=
new
THREE
.
Line
(
f
,
h
);
particleObj
=
new
THREE
.
ParticleSystem
(
e
,
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
);
e
=
new
THREE
.
SphereGeometry
(
1
,
16
,
8
);
h
=
new
THREE
.
MeshBasicMaterial
({
color
:
65280
});
for
(
i
=
0
;
i
<
b
.
points
.
length
;
i
++
)
f
=
new
THREE
.
Mesh
(
e
,
h
),
f
.
position
.
copy
(
b
.
points
[
i
]),
f
.
updateMatrix
(),
a
.
addChild
(
f
)}
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.0050
;
this
.
lookHorizontal
=
...
...
@@ -81,7 +82,7 @@ e.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.po
b
(
this
,
function
(
a
){
c
&&
(
h
=
g
=
this
.
getMouseProjectionOnBall
(
a
.
clientX
,
a
.
clientY
),
k
=
j
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
),
m
=
l
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
),
c
=!
1
);
f
!==
this
.
STATE
.
NONE
&&
(
f
===
this
.
STATE
.
ROTATE
?
g
=
this
.
getMouseProjectionOnBall
(
a
.
clientX
,
a
.
clientY
):
f
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
j
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
):
f
===
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
(
f
===
this
.
STATE
.
NONE
)
f
=
a
.
button
,
f
===
this
.
STATE
.
ROTATE
?
h
=
g
=
this
.
getMouseProjectionOnBall
(
a
.
clientX
,
a
.
clientY
):
f
===
this
.
STATE
.
ZOOM
&&!
this
.
noZoom
?
k
=
j
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
):
this
.
noPan
||
(
m
=
l
=
this
.
getMouseOnScreen
(
a
.
clientX
,
a
.
clientY
))}),
!
1
);
this
.
domElement
.
addEventListener
(
"
mouseup
"
,
b
(
this
,
function
(
a
){
a
.
preventDefault
();
a
.
stopPropagation
();
f
=
this
.
STATE
.
NONE
}),
!
1
);
window
.
addEventListener
(
"
keydown
"
,
b
(
this
,
function
(
a
){
if
(
f
===
this
.
STATE
.
NONE
){
if
(
a
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ROTATE
])
f
=
this
.
STATE
.
ROTATE
;
else
if
(
a
.
keyCode
===
this
.
keys
[
this
.
STATE
.
ZOOM
]
&&!
this
.
noZoom
)
f
=
this
.
STATE
.
ZOOM
;
else
if
(
a
.
keyCode
===
this
.
keys
[
this
.
STATE
.
PAN
]
&&!
this
.
noPan
)
f
=
this
.
STATE
.
PAN
;
f
!==
this
.
STATE
.
NONE
&&
(
c
=!
0
)}}),
!
1
);
window
.
addEventListener
(
"
keyup
"
,
b
(
this
,
function
(){
if
(
f
!==
this
.
STATE
.
NONE
)
f
=
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
.
QuakeCamera
=
THREE
.
F
P
Camera
;
THREE
.
TrackballCamera
.
prototype
.
STATE
=
{
NONE
:
-
1
,
ROTATE
:
0
,
ZOOM
:
1
,
PAN
:
2
};
THREE
.
QuakeCamera
=
THREE
.
F
irstPerson
Camera
;
THREE
.
CubeGeometry
=
function
(
a
,
b
,
c
,
f
,
e
,
h
,
g
,
k
,
j
){
function
m
(
a
,
c
,
b
,
g
,
k
,
j
,
m
,
n
){
var
p
,
o
,
u
=
f
||
1
,
v
=
e
||
1
,
C
=
k
/
2
,
J
=
j
/
2
,
L
=
l
.
vertices
.
length
;
if
(
a
==
"
x
"
&&
c
==
"
y
"
||
a
==
"
y
"
&&
c
==
"
x
"
)
p
=
"
z
"
;
else
if
(
a
==
"
x
"
&&
c
==
"
z
"
||
a
==
"
z
"
&&
c
==
"
x
"
)
p
=
"
y
"
,
v
=
h
||
1
;
else
if
(
a
==
"
z
"
&&
c
==
"
y
"
||
a
==
"
y
"
&&
c
==
"
z
"
)
p
=
"
x
"
,
u
=
h
||
1
;
var
H
=
u
+
1
,
N
=
v
+
1
;
k
/=
u
;
var
O
=
j
/
v
;
for
(
o
=
0
;
o
<
N
;
o
++
)
for
(
j
=
0
;
j
<
H
;
j
++
){
var
B
=
new
THREE
.
Vector3
;
B
[
a
]
=
(
j
*
k
-
C
)
*
b
;
B
[
c
]
=
(
o
*
O
-
J
)
*
g
;
B
[
p
]
=
m
;
l
.
vertices
.
push
(
new
THREE
.
Vertex
(
B
))}
for
(
o
=
0
;
o
<
v
;
o
++
)
for
(
j
=
0
;
j
<
u
;
j
++
)
l
.
faces
.
push
(
new
THREE
.
Face4
(
j
+
H
*
o
+
L
,
j
+
H
*
(
o
+
1
)
+
L
,
j
+
1
+
H
*
(
o
+
1
)
+
L
,
j
+
1
+
H
*
o
+
L
,
null
,
null
,
n
)),
l
.
faceVertexUvs
[
0
].
push
([
new
THREE
.
UV
(
j
/
u
,
o
/
v
),
new
THREE
.
UV
(
j
/
u
,(
o
+
1
)
/
v
),
new
THREE
.
UV
((
j
+
1
)
/
u
,(
o
+
1
)
/
v
),
new
THREE
.
UV
((
j
+
1
)
/
u
,
o
/
v
)])}
THREE
.
Geometry
.
call
(
this
);
var
l
=
this
,
n
=
a
/
2
,
o
=
b
/
2
,
p
=
c
/
2
,
k
=
k
?
-
1
:
1
;
if
(
g
!==
void
0
)
if
(
g
instanceof
Array
)
this
.
materials
=
g
;
else
{
this
.
materials
=
[];
for
(
var
u
=
0
;
u
<
6
;
u
++
)
this
.
materials
.
push
([
g
])}
else
this
.
materials
=
[];
this
.
sides
=
{
px
:
!
0
,
nx
:
!
0
,
py
:
!
0
,
ny
:
!
0
,
pz
:
!
0
,
nz
:
!
0
};
if
(
j
!=
void
0
)
for
(
var
v
in
j
)
this
.
sides
[
v
]
!=
void
0
&&
(
this
.
sides
[
v
]
=
j
[
v
]);
this
.
sides
.
px
&&
m
(
"
z
"
,
"
y
"
,
1
*
k
,
-
1
,
c
,
b
,
-
n
,
this
.
materials
[
0
]);
this
.
sides
.
nx
&&
m
(
"
z
"
,
"
y
"
,
-
1
*
k
,
-
1
,
c
,
b
,
n
,
this
.
materials
[
1
]);
this
.
sides
.
py
&&
m
(
"
x
"
,
"
z
"
,
1
*
k
,
1
,
a
,
c
,
o
,
this
.
materials
[
2
]);
this
.
sides
.
ny
&&
m
(
"
x
"
,
"
z
"
,
1
*
k
,
-
1
,
a
,
c
,
-
o
,
this
.
materials
[
3
]);
this
.
sides
.
pz
&&
m
(
"
x
"
,
"
y
"
,
1
*
k
,
-
1
,
a
,
b
,
p
,
this
.
materials
[
4
]);
this
.
sides
.
nz
&&
m
(
"
x
"
,
"
y
"
,
-
1
*
k
,
-
1
,
a
,
b
,
-
p
,
this
.
materials
[
5
]);(
function
(){
for
(
var
a
=
[],
c
=
[],
b
=
0
,
f
=
l
.
vertices
.
length
;
b
<
f
;
b
++
){
for
(
var
e
=
l
.
vertices
[
b
],
g
=!
1
,
h
=
0
,
k
=
a
.
length
;
h
<
k
;
h
++
){
var
j
=
a
[
h
];
if
(
e
.
position
.
x
==
j
.
position
.
x
&&
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录