Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
65f5ed50
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
65f5ed50
编写于
12月 19, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
f4cf8d74
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
3 deletion
+9
-3
build/three.js
build/three.js
+6
-0
build/three.min.js
build/three.min.js
+3
-3
未找到文件。
build/three.js
浏览文件 @
65f5ed50
...
...
@@ -15188,6 +15188,9 @@ THREE.Scene.prototype.__addObject = function ( object ) {
}
this.dispatchEvent( { type: 'objectAdded', object: object } );
object.dispatchEvent( { type: 'addedToScene', scene: this } );
for ( var c = 0; c < object.children.length; c ++ ) {
this.__addObject( object.children[ c ] );
...
...
@@ -15234,6 +15237,9 @@ THREE.Scene.prototype.__removeObject = function ( object ) {
}
this.dispatchEvent( { type: 'objectRemoved', object: object } );
object.dispatchEvent( { type: 'removedFromScene', scene: this } );
for ( var c = 0; c < object.children.length; c ++ ) {
this.__removeObject( object.children[ c ] );
...
...
build/three.min.js
浏览文件 @
65f5ed50
...
...
@@ -295,9 +295,9 @@ THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/th
(
this
.
morphTargetInfluences
[
this
.
lastKeyframe
]
=
0
,
this
.
morphTargetInfluences
[
this
.
currentKeyframe
]
=
1
,
this
.
morphTargetInfluences
[
a
]
=
0
,
this
.
lastKeyframe
=
this
.
currentKeyframe
,
this
.
currentKeyframe
=
a
);
b
=
this
.
time
%
b
/
b
;
this
.
directionBackwards
&&
(
b
=
1
-
b
);
this
.
morphTargetInfluences
[
this
.
currentKeyframe
]
=
b
;
this
.
morphTargetInfluences
[
this
.
lastKeyframe
]
=
1
-
b
};
THREE
.
MorphAnimMesh
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
MorphAnimMesh
(
this
.
geometry
,
this
.
material
));
a
.
duration
=
this
.
duration
;
a
.
mirroredLoop
=
this
.
mirroredLoop
;
a
.
time
=
this
.
time
;
a
.
lastKeyframe
=
this
.
lastKeyframe
;
a
.
currentKeyframe
=
this
.
currentKeyframe
;
a
.
direction
=
this
.
direction
;
a
.
directionBackwards
=
this
.
directionBackwards
;
THREE
.
Mesh
.
prototype
.
clone
.
call
(
this
,
a
);
return
a
};
THREE
.
LOD
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
objects
=
[]};
THREE
.
LOD
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
LOD
.
prototype
.
addLevel
=
function
(
a
,
b
){
void
0
===
b
&&
(
b
=
0
);
for
(
var
b
=
Math
.
abs
(
b
),
c
=
0
;
c
<
this
.
objects
.
length
&&!
(
b
<
this
.
objects
[
c
].
distance
);
c
++
);
this
.
objects
.
splice
(
c
,
0
,{
distance
:
b
,
object
:
a
});
this
.
add
(
a
)};
THREE
.
LOD
.
prototype
.
getObjectForDistance
=
function
(
a
){
for
(
var
b
=
1
,
c
=
this
.
objects
.
length
;
b
<
c
&&!
(
a
<
this
.
objects
[
b
].
distance
);
b
++
);
return
this
.
objects
[
b
-
1
].
object
};
THREE
.
LOD
.
prototype
.
update
=
function
(){
var
a
=
new
THREE
.
Vector3
,
b
=
new
THREE
.
Vector3
;
return
function
(
c
){
if
(
1
<
this
.
objects
.
length
){
a
.
setFromMatrixPosition
(
c
.
matrixWorld
);
b
.
setFromMatrixPosition
(
this
.
matrixWorld
);
c
=
a
.
distanceTo
(
b
);
this
.
objects
[
0
].
object
.
visible
=!
0
;
for
(
var
d
=
1
,
e
=
this
.
objects
.
length
;
d
<
e
;
d
++
)
if
(
c
>=
this
.
objects
[
d
].
distance
)
this
.
objects
[
d
-
1
].
object
.
visible
=!
1
,
this
.
objects
[
d
].
object
.
visible
=!
0
;
else
break
;
for
(;
d
<
e
;
d
++
)
this
.
objects
[
d
].
object
.
visible
=!
1
}}}();
THREE
.
LOD
.
prototype
.
clone
=
function
(){};
THREE
.
Sprite
=
function
(
a
){
THREE
.
Object3D
.
call
(
this
);
this
.
material
=
void
0
!==
a
?
a
:
new
THREE
.
SpriteMaterial
};
THREE
.
Sprite
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Sprite
.
prototype
.
updateMatrix
=
function
(){
this
.
matrix
.
compose
(
this
.
position
,
this
.
quaternion
,
this
.
scale
);
this
.
matrixWorldNeedsUpdate
=!
0
};
THREE
.
Sprite
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Sprite
(
this
.
material
));
THREE
.
Object3D
.
prototype
.
clone
.
call
(
this
,
a
);
return
a
};
THREE
.
Particle
=
THREE
.
Sprite
;
THREE
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
overrideMaterial
=
this
.
fog
=
null
;
this
.
autoUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
1
;
this
.
__lights
=
[];
this
.
__objectsAdded
=
[];
this
.
__objectsRemoved
=
[]};
THREE
.
Scene
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Scene
.
prototype
.
__addObject
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
-
1
===
this
.
__lights
.
indexOf
(
a
)
&&
this
.
__lights
.
push
(
a
),
a
.
target
&&
void
0
===
a
.
target
.
parent
&&
this
.
add
(
a
.
target
);
else
if
(
!
(
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
)){
this
.
__objectsAdded
.
push
(
a
);
var
b
=
this
.
__objectsRemoved
.
indexOf
(
a
);
-
1
!==
b
&&
this
.
__objectsRemoved
.
splice
(
b
,
1
)}
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
__addObject
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
__removeObject
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
__lights
.
indexOf
(
a
);
-
1
!==
b
&&
this
.
__lights
.
splice
(
b
,
1
);
if
(
a
.
shadowCascadeArray
)
for
(
b
=
0
;
b
<
a
.
shadowCascadeArray
.
length
;
b
++
)
this
.
__removeObject
(
a
.
shadowCascadeArray
[
b
])}
else
a
instanceof
THREE
.
Camera
||
(
this
.
__objectsRemoved
.
push
(
a
),
b
=
this
.
__objectsAdded
.
indexOf
(
a
),
-
1
!==
b
&&
this
.
__objectsAdded
.
splice
(
b
,
1
));
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
__removeObject
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Scene
);
THREE
.
Object3D
.
prototype
.
clone
.
call
(
this
,
a
);
null
!==
this
.
fog
&&
(
a
.
fog
=
this
.
fog
.
clone
());
null
!==
this
.
overrideMaterial
&&
(
a
.
overrideMaterial
=
this
.
overrideMaterial
.
clone
());
a
.
autoUpdate
=
this
.
autoUpdate
;
a
.
matrixAutoUpdate
=
this
.
matrixAutoUpdate
;
return
a
};
THREE
.
Fog
=
function
(
a
,
b
,
c
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
near
=
void
0
!==
b
?
b
:
1
;
this
.
far
=
void
0
!==
c
?
c
:
1
E3
};
THREE
.
Fog
.
prototype
.
clone
=
function
(){
return
new
THREE
.
Fog
(
this
.
color
.
getHex
(),
this
.
near
,
this
.
far
)};
THREE
.
FogExp2
=
function
(
a
,
b
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
density
=
void
0
!==
b
?
b
:
2.5
E
-
4
};
THREE
.
FogExp2
.
prototype
.
clone
=
function
(){
return
new
THREE
.
FogExp2
(
this
.
color
.
getHex
(),
this
.
density
)};
THREE
.
CanvasRenderer
=
function
(
a
){
function
b
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
z
.
length
;
d
<
e
;
d
++
){
var
f
=
z
[
d
];
Ka
.
copy
(
f
.
color
);
if
(
f
instanceof
THREE
.
DirectionalLight
){
var
h
=
ta
.
setFromMatrixPosition
(
f
.
matrixWorld
).
normalize
(),
g
=
b
.
dot
(
h
);
0
>=
g
||
(
g
*=
f
.
intensity
,
c
.
add
(
Ka
.
multiplyScalar
(
g
)))}
else
f
instanceof
THREE
.
PointLight
&&
(
h
=
ta
.
setFromMatrixPosition
(
f
.
matrixWorld
),
g
=
b
.
dot
(
ta
.
subVectors
(
h
,
a
).
normalize
()),
0
>=
g
||
(
g
*=
0
==
f
.
distance
?
1
:
1
-
Math
.
min
(
a
.
distanceTo
(
h
)
/
f
.
distance
,
1
),
0
!=
g
&&
(
g
*=
f
.
intensity
,
c
.
add
(
Ka
.
multiplyScalar
(
g
)))))}}
THREE
.
Scene
.
prototype
.
__addObject
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
)
-
1
===
this
.
__lights
.
indexOf
(
a
)
&&
this
.
__lights
.
push
(
a
),
a
.
target
&&
void
0
===
a
.
target
.
parent
&&
this
.
add
(
a
.
target
);
else
if
(
!
(
a
instanceof
THREE
.
Camera
||
a
instanceof
THREE
.
Bone
)){
this
.
__objectsAdded
.
push
(
a
);
var
b
=
this
.
__objectsRemoved
.
indexOf
(
a
);
-
1
!==
b
&&
this
.
__objectsRemoved
.
splice
(
b
,
1
)}
this
.
dispatchEvent
({
type
:
"
objectAdded
"
,
object
:
a
});
a
.
dispatchEvent
({
type
:
"
addedToScene
"
,
scene
:
this
});
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
__addObject
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
__removeObject
=
function
(
a
){
if
(
a
instanceof
THREE
.
Light
){
var
b
=
this
.
__lights
.
indexOf
(
a
);
-
1
!==
b
&&
this
.
__lights
.
splice
(
b
,
1
);
if
(
a
.
shadowCascadeArray
)
for
(
b
=
0
;
b
<
a
.
shadowCascadeArray
.
length
;
b
++
)
this
.
__removeObject
(
a
.
shadowCascadeArray
[
b
])}
else
a
instanceof
THREE
.
Camera
||
(
this
.
__objectsRemoved
.
push
(
a
),
b
=
this
.
__objectsAdded
.
indexOf
(
a
),
-
1
!==
b
&&
this
.
__objectsAdded
.
splice
(
b
,
1
));
this
.
dispatchEvent
({
type
:
"
objectRemoved
"
,
object
:
a
});
a
.
dispatchEvent
({
type
:
"
removedFromScene
"
,
scene
:
this
});
for
(
b
=
0
;
b
<
a
.
children
.
length
;
b
++
)
this
.
__removeObject
(
a
.
children
[
b
])};
THREE
.
Scene
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Scene
);
THREE
.
Object3D
.
prototype
.
clone
.
call
(
this
,
a
);
null
!==
this
.
fog
&&
(
a
.
fog
=
this
.
fog
.
clone
());
null
!==
this
.
overrideMaterial
&&
(
a
.
overrideMaterial
=
this
.
overrideMaterial
.
clone
());
a
.
autoUpdate
=
this
.
autoUpdate
;
a
.
matrixAutoUpdate
=
this
.
matrixAutoUpdate
;
return
a
};
THREE
.
Fog
=
function
(
a
,
b
,
c
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
near
=
void
0
!==
b
?
b
:
1
;
this
.
far
=
void
0
!==
c
?
c
:
1
E3
};
THREE
.
Fog
.
prototype
.
clone
=
function
(){
return
new
THREE
.
Fog
(
this
.
color
.
getHex
(),
this
.
near
,
this
.
far
)};
THREE
.
FogExp2
=
function
(
a
,
b
){
this
.
name
=
""
;
this
.
color
=
new
THREE
.
Color
(
a
);
this
.
density
=
void
0
!==
b
?
b
:
2.5
E
-
4
};
THREE
.
FogExp2
.
prototype
.
clone
=
function
(){
return
new
THREE
.
FogExp2
(
this
.
color
.
getHex
(),
this
.
density
)};
THREE
.
CanvasRenderer
=
function
(
a
){
function
b
(
a
,
b
,
c
){
for
(
var
d
=
0
,
e
=
z
.
length
;
d
<
e
;
d
++
){
var
f
=
z
[
d
];
Ka
.
copy
(
f
.
color
);
if
(
f
instanceof
THREE
.
DirectionalLight
){
var
h
=
ta
.
setFromMatrixPosition
(
f
.
matrixWorld
).
normalize
(),
g
=
b
.
dot
(
h
);
0
>=
g
||
(
g
*=
f
.
intensity
,
c
.
add
(
Ka
.
multiplyScalar
(
g
)))}
else
f
instanceof
THREE
.
PointLight
&&
(
h
=
ta
.
setFromMatrixPosition
(
f
.
matrixWorld
),
g
=
b
.
dot
(
ta
.
subVectors
(
h
,
a
).
normalize
()),
0
>=
g
||
(
g
*=
0
==
f
.
distance
?
1
:
1
-
Math
.
min
(
a
.
distanceTo
(
h
)
/
f
.
distance
,
1
),
0
!=
g
&&
(
g
*=
f
.
intensity
,
c
.
add
(
Ka
.
multiplyScalar
(
g
)))))}}
function
c
(
a
,
b
,
c
,
d
){
l
(
b
);
p
(
c
);
m
(
d
);
s
(
a
.
getStyle
());
D
.
stroke
();
Ea
.
expandByScalar
(
2
*
b
)}
function
d
(
a
){
t
(
a
.
getStyle
());
D
.
fill
()}
function
e
(
a
,
b
,
c
,
e
,
f
,
h
,
g
,
j
,
i
,
k
,
l
,
p
,
m
){
if
(
!
(
m
instanceof
THREE
.
DataTexture
||
void
0
===
m
.
image
||
0
===
m
.
image
.
width
)){
if
(
!
0
===
m
.
needsUpdate
){
var
n
=
m
.
wrapS
===
THREE
.
RepeatWrapping
,
q
=
m
.
wrapT
===
THREE
.
RepeatWrapping
;
Ga
[
m
.
id
]
=
D
.
createPattern
(
m
.
image
,
!
0
===
n
&&!
0
===
q
?
"
repeat
"
:
!
0
===
n
&&!
1
===
q
?
"
repeat-x
"
:
!
1
===
n
&&!
0
===
q
?
"
repeat-y
"
:
"
no-repeat
"
);
m
.
needsUpdate
=!
1
}
void
0
===
Ga
[
m
.
id
]?
t
(
"
rgba(0,0,0,1)
"
):
t
(
Ga
[
m
.
id
]);
var
n
=
m
.
offset
.
x
/
m
.
repeat
.
x
,
q
=
m
.
offset
.
y
/
m
.
repeat
.
y
,
s
=
m
.
image
.
width
*
m
.
repeat
.
x
,
r
=
m
.
image
.
height
*
m
.
repeat
.
y
,
g
=
(
g
+
n
)
*
s
,
j
=
(
1
-
j
+
q
)
*
r
,
c
=
c
-
a
,
e
=
e
-
b
,
f
=
f
-
a
,
h
=
h
-
b
,
i
=
(
i
+
n
)
*
s
-
g
,
k
=
(
1
-
k
+
q
)
*
r
-
j
,
l
=
(
l
+
n
)
*
s
-
g
,
p
=
(
1
-
p
+
q
)
*
r
-
j
,
n
=
i
*
p
-
l
*
k
;
0
===
n
?(
void
0
===
ka
[
m
.
id
]
&&
(
b
=
document
.
createElement
(
"
canvas
"
),
b
.
width
=
m
.
image
.
width
,
b
.
height
=
m
.
image
.
height
,
b
=
b
.
getContext
(
"
2d
"
),
b
.
drawImage
(
m
.
image
,
0
,
0
),
ka
[
m
.
id
]
=
b
.
getImageData
(
0
,
0
,
m
.
image
.
width
,
m
.
image
.
height
).
data
),
b
=
ka
[
m
.
id
],
g
=
4
*
(
Math
.
floor
(
g
)
+
Math
.
floor
(
j
)
*
m
.
image
.
width
),
V
.
setRGB
(
b
[
g
]
/
255
,
b
[
g
+
1
]
/
255
,
b
[
g
+
2
]
/
255
),
d
(
V
)):(
n
=
1
/
n
,
m
=
(
p
*
c
-
k
*
f
)
*
n
,
k
=
(
p
*
e
-
k
*
h
)
*
n
,
c
=
(
i
*
f
-
l
*
c
)
*
n
,
e
=
(
i
*
h
-
l
*
e
)
*
n
,
a
=
a
-
m
*
g
-
c
*
j
,
g
=
b
-
k
*
g
-
e
*
j
,
D
.
save
(),
D
.
transform
(
m
,
k
,
c
,
e
,
a
,
g
),
D
.
fill
(),
D
.
restore
())}}
function
f
(
a
,
b
,
c
,
d
,
e
,
f
,
h
,
g
,
j
,
i
,
k
,
l
,
p
){
var
m
,
n
;
m
=
p
.
width
-
1
;
n
=
p
.
height
-
1
;
h
*=
m
;
g
*=
n
;
c
-=
a
;
d
-=
b
;
e
-=
a
;
f
-=
b
;
j
=
j
*
m
-
h
;
i
=
i
*
n
-
g
;
k
=
k
*
m
-
h
;
l
=
l
*
n
-
g
;
n
=
1
/
(
j
*
l
-
k
*
i
);
m
=
(
l
*
c
-
i
*
e
)
*
n
;
i
=
(
l
*
d
-
i
*
f
)
*
n
;
c
=
(
j
*
e
-
k
*
c
)
*
n
;
d
=
(
j
*
f
-
k
*
d
)
*
n
;
a
=
a
-
m
*
h
-
c
*
g
;
b
=
b
-
i
*
h
-
d
*
g
;
D
.
save
();
D
.
transform
(
m
,
i
,
c
,
d
,
a
,
b
);
D
.
clip
();
D
.
drawImage
(
p
,
0
,
0
);
D
.
restore
()}
function
h
(
a
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录