Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
42104287
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,发现更多精彩内容 >>
提交
42104287
编写于
11月 09, 2012
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Garbage collection friendlier normalMatrix in Projector.
Small fix to #2610
上级
95a05c1a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
205 addition
and
207 deletion
+205
-207
build/three.js
build/three.js
+6
-7
build/three.min.js
build/three.min.js
+193
-193
src/core/Projector.js
src/core/Projector.js
+6
-7
未找到文件。
build/three.js
浏览文件 @
42104287
...
...
@@ -3773,6 +3773,7 @@ THREE.Projector = function() {
_viewProjectionMatrix = new THREE.Matrix4(),
_modelViewProjectionMatrix = new THREE.Matrix4(),
_normalMatrix = new THREE.Matrix3(),
_frustum = new THREE.Frustum(),
...
...
@@ -3924,13 +3925,11 @@ THREE.Projector = function() {
var near = camera.near, far = camera.far, visible = false,
o, ol, v, vl, f, fl, n, nl, c, cl, u, ul, object,
modelMatrix,
rotationMatrix,
modelMatrix,
geometry, geometryMaterials, vertices, vertex, vertexPositionScreen,
faces, face, faceVertexNormals, normal, faceVertexUvs, uvs,
v1, v2, v3, v4, isFaceMaterial, material, side;
rotationMatrix = new THREE.Matrix3();
_face3Count = 0;
_face4Count = 0;
_lineCount = 0;
...
...
@@ -3966,8 +3965,8 @@ THREE.Projector = function() {
faces = geometry.faces;
faceVertexUvs = geometry.faceVertexUvs;
rotation
Matrix.getInverse( modelMatrix );
rotation
Matrix.transpose();
_normal
Matrix.getInverse( modelMatrix );
_normal
Matrix.transpose();
isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial;
side = object.material.side;
...
...
@@ -4071,7 +4070,7 @@ THREE.Projector = function() {
_face.normalWorld.copy( face.normal );
if ( visible === false && ( side === THREE.BackSide || side === THREE.DoubleSide ) ) _face.normalWorld.negate();
rotation
Matrix.multiplyVector3( _face.normalWorld ).normalize();
_normal
Matrix.multiplyVector3( _face.normalWorld ).normalize();
_face.centroidWorld.copy( face.centroid );
modelMatrix.multiplyVector3( _face.centroidWorld );
...
...
@@ -4088,7 +4087,7 @@ THREE.Projector = function() {
if ( visible === false && ( side === THREE.BackSide || side === THREE.DoubleSide ) ) normal.negate();
rotation
Matrix.multiplyVector3( normal ).normalize();
_normal
Matrix.multiplyVector3( normal ).normalize();
}
...
...
build/three.min.js
浏览文件 @
42104287
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/core/Projector.js
浏览文件 @
42104287
...
...
@@ -20,6 +20,7 @@ THREE.Projector = function() {
_viewProjectionMatrix
=
new
THREE
.
Matrix4
(),
_modelViewProjectionMatrix
=
new
THREE
.
Matrix4
(),
_normalMatrix
=
new
THREE
.
Matrix3
(),
_frustum
=
new
THREE
.
Frustum
(),
...
...
@@ -171,13 +172,11 @@ THREE.Projector = function() {
var
near
=
camera
.
near
,
far
=
camera
.
far
,
visible
=
false
,
o
,
ol
,
v
,
vl
,
f
,
fl
,
n
,
nl
,
c
,
cl
,
u
,
ul
,
object
,
modelMatrix
,
rotationMatrix
,
modelMatrix
,
geometry
,
geometryMaterials
,
vertices
,
vertex
,
vertexPositionScreen
,
faces
,
face
,
faceVertexNormals
,
normal
,
faceVertexUvs
,
uvs
,
v1
,
v2
,
v3
,
v4
,
isFaceMaterial
,
material
,
side
;
rotationMatrix
=
new
THREE
.
Matrix3
();
_face3Count
=
0
;
_face4Count
=
0
;
_lineCount
=
0
;
...
...
@@ -213,8 +212,8 @@ THREE.Projector = function() {
faces
=
geometry
.
faces
;
faceVertexUvs
=
geometry
.
faceVertexUvs
;
rotation
Matrix
.
getInverse
(
modelMatrix
);
rotation
Matrix
.
transpose
();
_normal
Matrix
.
getInverse
(
modelMatrix
);
_normal
Matrix
.
transpose
();
isFaceMaterial
=
object
.
material
instanceof
THREE
.
MeshFaceMaterial
;
side
=
object
.
material
.
side
;
...
...
@@ -318,7 +317,7 @@ THREE.Projector = function() {
_face
.
normalWorld
.
copy
(
face
.
normal
);
if
(
visible
===
false
&&
(
side
===
THREE
.
BackSide
||
side
===
THREE
.
DoubleSide
)
)
_face
.
normalWorld
.
negate
();
rotation
Matrix
.
multiplyVector3
(
_face
.
normalWorld
).
normalize
();
_normal
Matrix
.
multiplyVector3
(
_face
.
normalWorld
).
normalize
();
_face
.
centroidWorld
.
copy
(
face
.
centroid
);
modelMatrix
.
multiplyVector3
(
_face
.
centroidWorld
);
...
...
@@ -335,7 +334,7 @@ THREE.Projector = function() {
if
(
visible
===
false
&&
(
side
===
THREE
.
BackSide
||
side
===
THREE
.
DoubleSide
)
)
normal
.
negate
();
rotation
Matrix
.
multiplyVector3
(
normal
).
normalize
();
_normal
Matrix
.
multiplyVector3
(
normal
).
normalize
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录