Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
bc44c95d
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,发现更多精彩内容 >>
未验证
提交
bc44c95d
编写于
5月 22, 2018
作者:
M
Mr.doob
提交者:
GitHub
5月 22, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14044 from mquander/updatematrixworld-microoptimize
Make Matrix4.compose more efficient
上级
efeb95f1
fdde74af
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
37 deletion
+39
-37
src/math/Matrix4.js
src/math/Matrix4.js
+39
-37
未找到文件。
src/math/Matrix4.js
浏览文件 @
bc44c95d
...
...
@@ -263,12 +263,12 @@ Object.assign( Matrix4.prototype, {
}
//
last column
//
bottom row
te
[
3
]
=
0
;
te
[
7
]
=
0
;
te
[
11
]
=
0
;
//
bottom row
//
last column
te
[
12
]
=
0
;
te
[
13
]
=
0
;
te
[
14
]
=
0
;
...
...
@@ -278,42 +278,18 @@ Object.assign( Matrix4.prototype, {
},
makeRotationFromQuaternion
:
function
(
q
)
{
var
te
=
this
.
elements
;
var
x
=
q
.
_x
,
y
=
q
.
_y
,
z
=
q
.
_z
,
w
=
q
.
_w
;
var
x2
=
x
+
x
,
y2
=
y
+
y
,
z2
=
z
+
z
;
var
xx
=
x
*
x2
,
xy
=
x
*
y2
,
xz
=
x
*
z2
;
var
yy
=
y
*
y2
,
yz
=
y
*
z2
,
zz
=
z
*
z2
;
var
wx
=
w
*
x2
,
wy
=
w
*
y2
,
wz
=
w
*
z2
;
te
[
0
]
=
1
-
(
yy
+
zz
);
te
[
4
]
=
xy
-
wz
;
te
[
8
]
=
xz
+
wy
;
makeRotationFromQuaternion
:
function
()
{
te
[
1
]
=
xy
+
wz
;
te
[
5
]
=
1
-
(
xx
+
zz
);
te
[
9
]
=
yz
-
wx
;
var
zero
=
new
Vector3
(
0
,
0
,
0
);
var
one
=
new
Vector3
(
1
,
1
,
1
);
te
[
2
]
=
xz
-
wy
;
te
[
6
]
=
yz
+
wx
;
te
[
10
]
=
1
-
(
xx
+
yy
);
return
function
makeRotationFromQuaternion
(
q
)
{
// last column
te
[
3
]
=
0
;
te
[
7
]
=
0
;
te
[
11
]
=
0
;
// bottom row
te
[
12
]
=
0
;
te
[
13
]
=
0
;
te
[
14
]
=
0
;
te
[
15
]
=
1
;
return
this
.
compose
(
zero
,
q
,
one
);
return
this
;
}
;
},
}
()
,
lookAt
:
function
()
{
...
...
@@ -754,11 +730,37 @@ Object.assign( Matrix4.prototype, {
compose
:
function
(
position
,
quaternion
,
scale
)
{
this
.
makeRotationFromQuaternion
(
quaternion
);
this
.
scale
(
scale
);
this
.
setPosition
(
position
);
var
te
=
this
.
elements
;
return
this
;
var
x
=
quaternion
.
_x
,
y
=
quaternion
.
_y
,
z
=
quaternion
.
_z
,
w
=
quaternion
.
_w
;
var
x2
=
x
+
x
,
y2
=
y
+
y
,
z2
=
z
+
z
;
var
xx
=
x
*
x2
,
xy
=
x
*
y2
,
xz
=
x
*
z2
;
var
yy
=
y
*
y2
,
yz
=
y
*
z2
,
zz
=
z
*
z2
;
var
wx
=
w
*
x2
,
wy
=
w
*
y2
,
wz
=
w
*
z2
;
var
sx
=
scale
.
x
,
sy
=
scale
.
y
,
sz
=
scale
.
z
;
te
[
0
]
=
(
1
-
(
yy
+
zz
)
)
*
sx
;
te
[
1
]
=
(
xy
+
wz
)
*
sx
;
te
[
2
]
=
(
xz
-
wy
)
*
sx
;
te
[
3
]
=
0
;
te
[
4
]
=
(
xy
-
wz
)
*
sy
;
te
[
5
]
=
(
1
-
(
xx
+
zz
)
)
*
sy
;
te
[
6
]
=
(
yz
+
wx
)
*
sy
;
te
[
7
]
=
0
;
te
[
8
]
=
(
xz
+
wy
)
*
sz
;
te
[
9
]
=
(
yz
-
wx
)
*
sz
;
te
[
10
]
=
(
1
-
(
xx
+
yy
)
)
*
sz
;
te
[
11
]
=
0
;
te
[
12
]
=
position
.
x
;
te
[
13
]
=
position
.
y
;
te
[
14
]
=
position
.
z
;
te
[
15
]
=
1
;
return
this
;
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录