Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4779db2d
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,发现更多精彩内容 >>
提交
4779db2d
编写于
4月 27, 2017
作者:
M
Mr.doob
提交者:
GitHub
4月 27, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11246 from Flightradar24/dev-revert_closure_optimisations
Revert closure optimisations
上级
4c6bd583
49a71ce7
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
121 addition
and
42 deletion
+121
-42
src/core/BufferGeometry.js
src/core/BufferGeometry.js
+18
-6
src/core/Geometry.js
src/core/Geometry.js
+18
-6
src/loaders/Loader.js
src/loaders/Loader.js
+5
-3
src/math/Box3.js
src/math/Box3.js
+3
-1
src/math/Euler.js
src/math/Euler.js
+3
-1
src/math/Matrix3.js
src/math/Matrix3.js
+3
-1
src/math/Matrix4.js
src/math/Matrix4.js
+23
-7
src/math/Quaternion.js
src/math/Quaternion.js
+1
-2
src/math/Sphere.js
src/math/Sphere.js
+3
-1
src/math/Triangle.js
src/math/Triangle.js
+10
-4
src/math/Vector2.js
src/math/Vector2.js
+8
-2
src/math/Vector3.js
src/math/Vector3.js
+26
-8
未找到文件。
src/core/BufferGeometry.js
浏览文件 @
4779db2d
...
...
@@ -173,10 +173,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world x-axis
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
rotateX
(
angle
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeRotationX
(
angle
);
this
.
applyMatrix
(
m1
);
...
...
@@ -191,10 +193,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world y-axis
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
rotateY
(
angle
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeRotationY
(
angle
);
this
.
applyMatrix
(
m1
);
...
...
@@ -209,10 +213,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world z-axis
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
rotateZ
(
angle
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeRotationZ
(
angle
);
this
.
applyMatrix
(
m1
);
...
...
@@ -227,10 +233,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
// translate geometry
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
translate
(
x
,
y
,
z
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeTranslation
(
x
,
y
,
z
);
this
.
applyMatrix
(
m1
);
...
...
@@ -245,10 +253,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
// scale geometry
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
scale
(
x
,
y
,
z
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeScale
(
x
,
y
,
z
);
this
.
applyMatrix
(
m1
);
...
...
@@ -261,10 +271,12 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
lookAt
:
function
()
{
var
obj
=
new
Object3D
()
;
var
obj
;
return
function
lookAt
(
vector
)
{
if
(
obj
===
undefined
)
obj
=
new
Object3D
();
obj
.
lookAt
(
vector
);
obj
.
updateMatrix
();
...
...
src/core/Geometry.js
浏览文件 @
4779db2d
...
...
@@ -110,10 +110,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world x-axis
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
rotateX
(
angle
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeRotationX
(
angle
);
this
.
applyMatrix
(
m1
);
...
...
@@ -128,10 +130,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world y-axis
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
rotateY
(
angle
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeRotationY
(
angle
);
this
.
applyMatrix
(
m1
);
...
...
@@ -146,10 +150,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world z-axis
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
rotateZ
(
angle
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeRotationZ
(
angle
);
this
.
applyMatrix
(
m1
);
...
...
@@ -164,10 +170,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// translate geometry
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
translate
(
x
,
y
,
z
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeTranslation
(
x
,
y
,
z
);
this
.
applyMatrix
(
m1
);
...
...
@@ -182,10 +190,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// scale geometry
var
m1
=
new
Matrix4
()
;
var
m1
;
return
function
scale
(
x
,
y
,
z
)
{
if
(
m1
===
undefined
)
m1
=
new
Matrix4
();
m1
.
makeScale
(
x
,
y
,
z
);
this
.
applyMatrix
(
m1
);
...
...
@@ -198,10 +208,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
lookAt
:
function
()
{
var
obj
=
new
Object3D
()
;
var
obj
;
return
function
lookAt
(
vector
)
{
if
(
obj
===
undefined
)
obj
=
new
Object3D
();
obj
.
lookAt
(
vector
);
obj
.
updateMatrix
();
...
...
src/loaders/Loader.js
浏览文件 @
4779db2d
...
...
@@ -106,12 +106,14 @@ Object.assign( Loader.prototype, {
CustomBlending
:
CustomBlending
};
var
color
=
new
Color
();
var
textureLoader
=
new
TextureLoader
();
var
materialLoader
=
new
MaterialLoader
();
var
color
,
textureLoader
,
materialLoader
;
return
function
createMaterial
(
m
,
texturePath
,
crossOrigin
)
{
if
(
color
===
undefined
)
color
=
new
Color
();
if
(
textureLoader
===
undefined
)
textureLoader
=
new
TextureLoader
();
if
(
materialLoader
===
undefined
)
materialLoader
=
new
MaterialLoader
();
// convert from old material format
var
textures
=
{};
...
...
src/math/Box3.js
浏览文件 @
4779db2d
...
...
@@ -308,10 +308,12 @@ Object.assign( Box3.prototype, {
intersectsSphere
:
(
function
()
{
var
closestPoint
=
new
Vector3
()
;
var
closestPoint
;
return
function
intersectsSphere
(
sphere
)
{
if
(
closestPoint
===
undefined
)
closestPoint
=
new
Vector3
();
// Find the point on the AABB closest to the sphere center.
this
.
clampPoint
(
sphere
.
center
,
closestPoint
);
...
...
src/math/Euler.js
浏览文件 @
4779db2d
...
...
@@ -255,10 +255,12 @@ Object.assign( Euler.prototype, {
setFromQuaternion
:
function
()
{
var
matrix
=
new
Matrix4
()
;
var
matrix
;
return
function
setFromQuaternion
(
q
,
order
,
update
)
{
if
(
matrix
===
undefined
)
matrix
=
new
Matrix4
();
matrix
.
makeRotationFromQuaternion
(
q
);
return
this
.
setFromRotationMatrix
(
matrix
,
order
,
update
);
...
...
src/math/Matrix3.js
浏览文件 @
4779db2d
...
...
@@ -92,10 +92,12 @@ Object.assign( Matrix3.prototype, {
applyToBufferAttribute
:
function
()
{
var
v1
=
new
Vector3
()
;
var
v1
;
return
function
applyToBufferAttribute
(
attribute
)
{
if
(
v1
===
undefined
)
v1
=
new
Vector3
();
for
(
var
i
=
0
,
l
=
attribute
.
count
;
i
<
l
;
i
++
)
{
v1
.
x
=
attribute
.
getX
(
i
);
...
...
src/math/Matrix4.js
浏览文件 @
4779db2d
...
...
@@ -121,10 +121,12 @@ Object.assign( Matrix4.prototype, {
extractRotation
:
function
()
{
var
v1
=
new
Vector3
()
;
var
v1
;
return
function
extractRotation
(
m
)
{
if
(
v1
===
undefined
)
v1
=
new
Vector3
();
var
te
=
this
.
elements
;
var
me
=
m
.
elements
;
...
...
@@ -317,12 +319,18 @@ Object.assign( Matrix4.prototype, {
lookAt
:
function
()
{
var
x
=
new
Vector3
();
var
y
=
new
Vector3
();
var
z
=
new
Vector3
();
var
x
,
y
,
z
;
return
function
lookAt
(
eye
,
target
,
up
)
{
if
(
x
===
undefined
)
{
x
=
new
Vector3
();
y
=
new
Vector3
();
z
=
new
Vector3
();
}
var
te
=
this
.
elements
;
z
.
subVectors
(
eye
,
target
);
...
...
@@ -434,10 +442,12 @@ Object.assign( Matrix4.prototype, {
applyToBufferAttribute
:
function
()
{
var
v1
=
new
Vector3
()
;
var
v1
;
return
function
applyToBufferAttribute
(
attribute
)
{
if
(
v1
===
undefined
)
v1
=
new
Vector3
();
for
(
var
i
=
0
,
l
=
attribute
.
count
;
i
<
l
;
i
++
)
{
v1
.
x
=
attribute
.
getX
(
i
);
...
...
@@ -754,11 +764,17 @@ Object.assign( Matrix4.prototype, {
decompose
:
function
()
{
var
vector
=
new
Vector3
();
var
matrix
=
new
Matrix4
();
var
vector
,
matrix
;
return
function
decompose
(
position
,
quaternion
,
scale
)
{
if
(
vector
===
undefined
)
{
vector
=
new
Vector3
();
matrix
=
new
Matrix4
();
}
var
te
=
this
.
elements
;
var
sx
=
vector
.
set
(
te
[
0
],
te
[
1
],
te
[
2
]
).
length
();
...
...
src/math/Quaternion.js
浏览文件 @
4779db2d
...
...
@@ -351,8 +351,7 @@ Object.assign( Quaternion.prototype, {
// assumes direction vectors vFrom and vTo are normalized
var
v1
=
new
Vector3
();
var
r
;
var
v1
,
r
;
var
EPS
=
0.000001
;
...
...
src/math/Sphere.js
浏览文件 @
4779db2d
...
...
@@ -26,10 +26,12 @@ Object.assign( Sphere.prototype, {
setFromPoints
:
function
()
{
var
box
=
new
Box3
()
;
var
box
;
return
function
setFromPoints
(
points
,
optionalCenter
)
{
if
(
box
===
undefined
)
box
=
new
Box3
();
// see #10547
var
center
=
this
.
center
;
if
(
optionalCenter
!==
undefined
)
{
...
...
src/math/Triangle.js
浏览文件 @
4779db2d
...
...
@@ -191,13 +191,19 @@ Object.assign( Triangle.prototype, {
closestPointToPoint
:
function
()
{
var
plane
=
new
Plane
();
var
edgeList
=
[
new
Line3
(),
new
Line3
(),
new
Line3
()
];
var
projectedPoint
=
new
Vector3
();
var
closestPoint
=
new
Vector3
();
var
plane
,
edgeList
,
projectedPoint
,
closestPoint
;
return
function
closestPointToPoint
(
point
,
optionalTarget
)
{
if
(
plane
===
undefined
)
{
plane
=
new
Plane
();
edgeList
=
[
new
Line3
(),
new
Line3
(),
new
Line3
()
];
projectedPoint
=
new
Vector3
();
closestPoint
=
new
Vector3
();
}
var
result
=
optionalTarget
||
new
Vector3
();
var
minDistance
=
Infinity
;
...
...
src/math/Vector2.js
浏览文件 @
4779db2d
...
...
@@ -268,11 +268,17 @@ Object.assign( Vector2.prototype, {
clampScalar
:
function
()
{
var
min
=
new
Vector2
();
var
max
=
new
Vector2
();
var
min
,
max
;
return
function
clampScalar
(
minVal
,
maxVal
)
{
if
(
min
===
undefined
)
{
min
=
new
Vector2
();
max
=
new
Vector2
();
}
min
.
set
(
minVal
,
minVal
);
max
.
set
(
maxVal
,
maxVal
);
...
...
src/math/Vector3.js
浏览文件 @
4779db2d
...
...
@@ -234,7 +234,7 @@ Object.assign( Vector3.prototype, {
applyEuler
:
function
()
{
var
quaternion
=
new
Quaternion
()
;
var
quaternion
;
return
function
applyEuler
(
euler
)
{
...
...
@@ -244,6 +244,8 @@ Object.assign( Vector3.prototype, {
}
if
(
quaternion
===
undefined
)
quaternion
=
new
Quaternion
();
return
this
.
applyQuaternion
(
quaternion
.
setFromEuler
(
euler
)
);
};
...
...
@@ -252,10 +254,12 @@ Object.assign( Vector3.prototype, {
applyAxisAngle
:
function
()
{
var
quaternion
=
new
Quaternion
()
;
var
quaternion
;
return
function
applyAxisAngle
(
axis
,
angle
)
{
if
(
quaternion
===
undefined
)
quaternion
=
new
Quaternion
();
return
this
.
applyQuaternion
(
quaternion
.
setFromAxisAngle
(
axis
,
angle
)
);
};
...
...
@@ -313,10 +317,12 @@ Object.assign( Vector3.prototype, {
project
:
function
()
{
var
matrix
=
new
Matrix4
()
;
var
matrix
;
return
function
project
(
camera
)
{
if
(
matrix
===
undefined
)
matrix
=
new
Matrix4
();
matrix
.
multiplyMatrices
(
camera
.
projectionMatrix
,
matrix
.
getInverse
(
camera
.
matrixWorld
)
);
return
this
.
applyMatrix4
(
matrix
);
...
...
@@ -326,10 +332,12 @@ Object.assign( Vector3.prototype, {
unproject
:
function
()
{
var
matrix
=
new
Matrix4
()
;
var
matrix
;
return
function
unproject
(
camera
)
{
if
(
matrix
===
undefined
)
matrix
=
new
Matrix4
();
matrix
.
multiplyMatrices
(
camera
.
matrixWorld
,
matrix
.
getInverse
(
camera
.
projectionMatrix
)
);
return
this
.
applyMatrix4
(
matrix
);
...
...
@@ -403,11 +411,17 @@ Object.assign( Vector3.prototype, {
clampScalar
:
function
()
{
var
min
=
new
Vector3
();
var
max
=
new
Vector3
();
var
min
,
max
;
return
function
clampScalar
(
minVal
,
maxVal
)
{
if
(
min
===
undefined
)
{
min
=
new
Vector3
();
max
=
new
Vector3
();
}
min
.
set
(
minVal
,
minVal
,
minVal
);
max
.
set
(
maxVal
,
maxVal
,
maxVal
);
...
...
@@ -571,10 +585,12 @@ Object.assign( Vector3.prototype, {
projectOnPlane
:
function
()
{
var
v1
=
new
Vector3
()
;
var
v1
;
return
function
projectOnPlane
(
planeNormal
)
{
if
(
v1
===
undefined
)
v1
=
new
Vector3
();
v1
.
copy
(
this
).
projectOnVector
(
planeNormal
);
return
this
.
sub
(
v1
);
...
...
@@ -588,10 +604,12 @@ Object.assign( Vector3.prototype, {
// reflect incident vector off plane orthogonal to normal
// normal is assumed to have unit length
var
v1
=
new
Vector3
()
;
var
v1
;
return
function
reflect
(
normal
)
{
if
(
v1
===
undefined
)
v1
=
new
Vector3
();
return
this
.
sub
(
v1
.
copy
(
normal
).
multiplyScalar
(
2
*
this
.
dot
(
normal
)
)
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录