Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
2bfc6409
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,发现更多精彩内容 >>
提交
2bfc6409
编写于
9月 11, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
57a96193
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
26 deletion
+13
-26
build/three.js
build/three.js
+10
-23
build/three.min.js
build/three.min.js
+3
-3
未找到文件。
build/three.js
浏览文件 @
2bfc6409
...
...
@@ -15069,7 +15069,6 @@ THREE.Scene = function () {
this.autoUpdate = true; // checked by the renderer
this.matrixAutoUpdate = false;
this.__objects = [];
this.__lights = [];
this.__objectsAdded = [];
...
...
@@ -15097,9 +15096,6 @@ THREE.Scene.prototype.__addObject = function ( object ) {
} else if ( !( object instanceof THREE.Camera || object instanceof THREE.Bone ) ) {
if ( this.__objects.indexOf( object ) === - 1 ) {
this.__objects.push( object );
this.__objectsAdded.push( object );
// check if previously removed
...
...
@@ -15114,8 +15110,6 @@ THREE.Scene.prototype.__addObject = function ( object ) {
}
}
for ( var c = 0; c < object.children.length; c ++ ) {
this.__addObject( object.children[ c ] );
...
...
@@ -15148,22 +15142,15 @@ THREE.Scene.prototype.__removeObject = function ( object ) {
} else if ( !( object instanceof THREE.Camera ) ) {
var i = this.__objects.indexOf( object );
if ( i !== -1 ) {
this.__objects.splice( i, 1 );
this.__objectsRemoved.push( object );
// check if previously added
var ai = this.__objectsAdded.indexOf( object );
if ( ai !== -1 ) {
var i = this.__objectsAdded.indexOf( object );
this.__objectsAdded.splice( ai, 1 );
if ( i !== -1 ) {
}
this.__objectsAdded.splice( i, 1 );
}
...
...
build/three.min.js
浏览文件 @
2bfc6409
...
...
@@ -293,9 +293,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
.
Ribbon
=
function
(
a
,
b
){
THREE
.
Object3D
.
call
(
this
);
this
.
geometry
=
a
;
this
.
material
=
b
};
THREE
.
Ribbon
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Ribbon
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Ribbon
(
this
.
geometry
,
this
.
material
));
THREE
.
Object3D
.
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
.
getPositionFromMatrix
(
c
.
matrixWorld
);
b
.
getPositionFromMatrix
(
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
;
this
.
rotation3d
=
this
.
rotation
;
this
.
rotation
=
0
};
THREE
.
Sprite
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Sprite
.
prototype
.
updateMatrix
=
function
(){
this
.
rotation3d
.
set
(
0
,
0
,
this
.
rotation
,
this
.
rotation3d
.
order
);
this
.
quaternion
.
setFromEuler
(
this
.
rotation3d
);
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
.
Scene
=
function
(){
THREE
.
Object3D
.
call
(
this
);
this
.
overrideMaterial
=
this
.
fog
=
null
;
this
.
autoUpdate
=!
0
;
this
.
matrixAutoUpdate
=!
1
;
this
.
__
objects
=
[];
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
)
&&-
1
===
this
.
__objects
.
indexOf
(
a
)){
this
.
__objects
.
push
(
a
);
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
||
(
b
=
this
.
__objects
.
indexOf
(
a
),
-
1
!==
b
&&
(
this
.
__objects
.
splice
(
b
,
1
),
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
.
Sprite
.
prototype
.
clone
=
function
(
a
){
void
0
===
a
&&
(
a
=
new
THREE
.
Sprite
(
this
.
material
));
THREE
.
Object3D
.
prototype
.
clone
.
call
(
this
,
a
);
return
a
};
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
=
E
.
length
;
d
<
e
;
d
++
){
var
f
=
E
[
d
];
Pa
.
copy
(
f
.
color
);
if
(
f
instanceof
THREE
.
DirectionalLight
){
var
h
=
wa
.
getPositionFromMatrix
(
f
.
matrixWorld
).
normalize
(),
g
=
b
.
dot
(
h
);
0
>=
g
||
(
g
*=
f
.
intensity
,
c
.
add
(
Pa
.
multiplyScalar
(
g
)))}
else
f
instanceof
THREE
.
PointLight
&&
(
h
=
wa
.
getPositionFromMatrix
(
f
.
matrixWorld
),
g
=
b
.
dot
(
wa
.
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
(
Pa
.
multiplyScalar
(
g
)))))}}
function
c
(
a
,
b
,
c
,
d
){
m
(
b
);
l
(
c
);
n
(
d
);
s
(
a
.
getStyle
());
B
.
stroke
();
ta
.
expandByScalar
(
2
*
b
)}
function
d
(
a
){
t
(
a
.
getStyle
());
B
.
fill
()}
function
e
(
a
,
b
,
c
,
e
,
f
,
h
,
g
,
j
,
i
,
k
,
m
,
l
,
n
){
if
(
!
(
n
instanceof
THREE
.
DataTexture
||
void
0
===
n
.
image
||
0
==
n
.
image
.
width
)){
if
(
!
0
===
n
.
needsUpdate
){
var
p
=
n
.
wrapS
==
THREE
.
RepeatWrapping
,
r
=
n
.
wrapT
==
THREE
.
RepeatWrapping
;
Ja
[
n
.
id
]
=
B
.
createPattern
(
n
.
image
,
!
0
===
p
&&!
0
===
r
?
"
repeat
"
:
!
0
===
p
&&!
1
===
r
?
"
repeat-x
"
:
!
1
===
p
&&!
0
===
r
?
"
repeat-y
"
:
"
no-repeat
"
);
n
.
needsUpdate
=!
1
}
void
0
===
Ja
[
n
.
id
]?
t
(
"
rgba(0,0,0,1)
"
):
t
(
Ja
[
n
.
id
]);
var
p
=
n
.
offset
.
x
/
n
.
repeat
.
x
,
r
=
n
.
offset
.
y
/
n
.
repeat
.
y
,
s
=
n
.
image
.
width
*
n
.
repeat
.
x
,
q
=
n
.
image
.
height
*
n
.
repeat
.
y
,
g
=
(
g
+
p
)
*
s
,
j
=
(
1
-
j
+
r
)
*
q
,
c
=
c
-
a
,
e
=
e
-
b
,
f
=
f
-
a
,
h
=
h
-
b
,
i
=
(
i
+
p
)
*
s
-
g
,
k
=
(
1
-
k
+
r
)
*
q
-
j
,
m
=
(
m
+
p
)
*
s
-
g
,
l
=
(
1
-
l
+
r
)
*
q
-
j
,
p
=
i
*
l
-
m
*
k
;
0
===
p
?(
void
0
===
ga
[
n
.
id
]
&&
(
b
=
document
.
createElement
(
"
canvas
"
),
b
.
width
=
n
.
image
.
width
,
b
.
height
=
n
.
image
.
height
,
b
=
b
.
getContext
(
"
2d
"
),
b
.
drawImage
(
n
.
image
,
0
,
0
),
ga
[
n
.
id
]
=
b
.
getImageData
(
0
,
0
,
n
.
image
.
width
,
n
.
image
.
height
).
data
),
b
=
ga
[
n
.
id
],
g
=
4
*
(
Math
.
floor
(
g
)
+
Math
.
floor
(
j
)
*
n
.
image
.
width
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录