Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
3ced32af
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,发现更多精彩内容 >>
提交
3ced32af
编写于
2月 08, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code clean up as per Ufligy2 warnings.
上级
3b63de52
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
21 addition
and
29 deletion
+21
-29
src/Three.js
src/Three.js
+3
-4
src/core/BufferGeometry.js
src/core/BufferGeometry.js
+0
-1
src/core/Geometry.js
src/core/Geometry.js
+6
-7
src/core/Projector.js
src/core/Projector.js
+2
-5
src/math/Matrix4.js
src/math/Matrix4.js
+0
-1
src/renderers/CanvasRenderer.js
src/renderers/CanvasRenderer.js
+10
-11
未找到文件。
src/Three.js
浏览文件 @
3ced32af
...
...
@@ -60,8 +60,7 @@ THREE.extend = function ( obj, source ) {
}
}
else
{
}
else
{
var
safeHasOwnProperty
=
{}.
hasOwnProperty
;
...
...
@@ -71,7 +70,7 @@ THREE.extend = function ( obj, source ) {
obj
[
prop
]
=
source
[
prop
];
}
}
}
...
...
@@ -101,7 +100,7 @@ THREE.extend = function ( obj, source ) {
if
(
window
.
requestAnimationFrame
===
undefined
)
{
window
.
requestAnimationFrame
=
function
(
callback
,
element
)
{
window
.
requestAnimationFrame
=
function
(
callback
)
{
var
currTime
=
Date
.
now
(),
timeToCall
=
Math
.
max
(
0
,
16
-
(
currTime
-
lastTime
)
);
var
id
=
window
.
setTimeout
(
function
()
{
callback
(
currTime
+
timeToCall
);
},
timeToCall
);
...
...
src/core/BufferGeometry.js
浏览文件 @
3ced32af
...
...
@@ -489,7 +489,6 @@ THREE.BufferGeometry.prototype = {
var
tmp
=
new
THREE
.
Vector3
(),
tmp2
=
new
THREE
.
Vector3
();
var
n
=
new
THREE
.
Vector3
(),
n2
=
new
THREE
.
Vector3
();
var
w
,
t
,
test
;
var
nx
,
ny
,
nz
;
function
handleVertex
(
v
)
{
...
...
src/core/Geometry.js
浏览文件 @
3ced32af
...
...
@@ -118,16 +118,15 @@ THREE.Geometry.prototype = {
computeFaceNormals
:
function
()
{
var
n
,
nl
,
v
,
vl
,
vertex
,
f
,
fl
,
face
,
vA
,
vB
,
vC
,
cb
=
new
THREE
.
Vector3
(),
ab
=
new
THREE
.
Vector3
();
var
cb
=
new
THREE
.
Vector3
(),
ab
=
new
THREE
.
Vector3
();
for
(
f
=
0
,
fl
=
this
.
faces
.
length
;
f
<
fl
;
f
++
)
{
for
(
var
f
=
0
,
fl
=
this
.
faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
this
.
faces
[
f
];
var
face
=
this
.
faces
[
f
];
vA
=
this
.
vertices
[
face
.
a
];
vB
=
this
.
vertices
[
face
.
b
];
vC
=
this
.
vertices
[
face
.
c
];
v
ar
v
A
=
this
.
vertices
[
face
.
a
];
v
ar
v
B
=
this
.
vertices
[
face
.
b
];
v
ar
v
C
=
this
.
vertices
[
face
.
c
];
cb
.
subVectors
(
vC
,
vB
);
ab
.
subVectors
(
vA
,
vB
);
...
...
src/core/Projector.js
浏览文件 @
3ced32af
...
...
@@ -37,9 +37,7 @@ THREE.Projector = function () {
_frustum
=
new
THREE
.
Frustum
(),
_clippedVertex1PositionScreen
=
new
THREE
.
Vector4
(),
_clippedVertex2PositionScreen
=
new
THREE
.
Vector4
(),
_face3VertexNormals
;
_clippedVertex2PositionScreen
=
new
THREE
.
Vector4
();
this
.
projectVector
=
function
(
vector
,
camera
)
{
...
...
@@ -180,8 +178,7 @@ THREE.Projector = function () {
var
visible
=
false
,
o
,
ol
,
v
,
vl
,
f
,
fl
,
n
,
nl
,
c
,
cl
,
u
,
ul
,
object
,
geometry
,
vertices
,
vertex
,
vertexPositionScreen
,
faces
,
face
,
faceVertexNormals
,
faceVertexUvs
,
uvs
,
geometry
,
vertices
,
faces
,
face
,
faceVertexNormals
,
faceVertexUvs
,
uvs
,
v1
,
v2
,
v3
,
v4
,
isFaceMaterial
,
objectMaterials
;
_face3Count
=
0
;
...
...
src/math/Matrix4.js
浏览文件 @
3ced32af
...
...
@@ -859,7 +859,6 @@ THREE.extend( THREE.Matrix4.prototype, {
var
m11
=
te
[
0
],
m21
=
te
[
1
],
m31
=
te
[
2
],
m41
=
te
[
3
];
var
m12
=
te
[
4
],
m22
=
te
[
5
],
m32
=
te
[
6
],
m42
=
te
[
7
];
var
m13
=
te
[
8
],
m23
=
te
[
9
],
m33
=
te
[
10
],
m43
=
te
[
11
];
var
m14
=
te
[
12
],
m24
=
te
[
13
],
m34
=
te
[
14
],
m44
=
te
[
15
];
te
[
0
]
=
r11
*
m11
+
r21
*
m12
+
r31
*
m13
;
te
[
1
]
=
r11
*
m21
+
r21
*
m22
+
r31
*
m23
;
...
...
src/renderers/CanvasRenderer.js
浏览文件 @
3ced32af
...
...
@@ -66,7 +66,6 @@ THREE.CanvasRenderer = function ( parameters ) {
_directionalLights
=
new
THREE
.
Color
(),
_pointLights
=
new
THREE
.
Color
(),
_pi2
=
Math
.
PI
*
2
,
_vector3
=
new
THREE
.
Vector3
(),
// Needed for PointLight
_pixelMap
,
_pixelMapContext
,
_pixelMapImage
,
_pixelMapData
,
...
...
@@ -105,7 +104,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
else
{
_context
.
setLineDash
=
function
(
values
)
{}
_context
.
setLineDash
=
function
()
{}
}
...
...
@@ -298,7 +297,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_v1
=
element
;
_v1
.
x
*=
_canvasWidthHalf
;
_v1
.
y
*=
_canvasHeightHalf
;
renderParticle
(
_v1
,
element
,
material
,
scene
);
renderParticle
(
_v1
,
element
,
material
);
}
else
if
(
element
instanceof
THREE
.
RenderableLine
)
{
...
...
@@ -311,7 +310,7 @@ THREE.CanvasRenderer = function ( parameters ) {
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
renderLine
(
_v1
,
_v2
,
element
,
material
,
scene
);
renderLine
(
_v1
,
_v2
,
element
,
material
);
}
...
...
@@ -337,7 +336,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
]
);
renderFace3
(
_v1
,
_v2
,
_v3
,
0
,
1
,
2
,
element
,
material
,
scene
);
renderFace3
(
_v1
,
_v2
,
_v3
,
0
,
1
,
2
,
element
,
material
);
}
else
if
(
element
instanceof
THREE
.
RenderableFace4
)
{
...
...
@@ -468,7 +467,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
function
renderParticle
(
v1
,
element
,
material
,
scene
)
{
function
renderParticle
(
v1
,
element
,
material
)
{
setOpacity
(
material
.
opacity
);
setBlending
(
material
.
blending
);
...
...
@@ -580,7 +579,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
function
renderLine
(
v1
,
v2
,
element
,
material
,
scene
)
{
function
renderLine
(
v1
,
v2
,
element
,
material
)
{
setOpacity
(
material
.
opacity
);
setBlending
(
material
.
blending
);
...
...
@@ -615,7 +614,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
function
renderFace3
(
v1
,
v2
,
v3
,
uv1
,
uv2
,
uv3
,
element
,
material
,
scene
)
{
function
renderFace3
(
v1
,
v2
,
v3
,
uv1
,
uv2
,
uv3
,
element
,
material
)
{
_this
.
info
.
render
.
vertices
+=
3
;
_this
.
info
.
render
.
faces
++
;
...
...
@@ -795,7 +794,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
function
renderFace4
(
v1
,
v2
,
v3
,
v4
,
v5
,
v6
,
element
,
material
,
scene
)
{
function
renderFace4
(
v1
,
v2
,
v3
,
v4
,
v5
,
v6
,
element
,
material
)
{
_this
.
info
.
render
.
vertices
+=
4
;
_this
.
info
.
render
.
faces
++
;
...
...
@@ -807,8 +806,8 @@ THREE.CanvasRenderer = function ( parameters ) {
// Let renderFace3() handle this
renderFace3
(
v1
,
v2
,
v4
,
0
,
1
,
3
,
element
,
material
,
scene
);
renderFace3
(
v5
,
v3
,
v6
,
1
,
2
,
3
,
element
,
material
,
scene
);
renderFace3
(
v1
,
v2
,
v4
,
0
,
1
,
3
,
element
,
material
);
renderFace3
(
v5
,
v3
,
v6
,
1
,
2
,
3
,
element
,
material
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录