Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
64851129
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,体验更适合开发者的 AI 搜索 >>
提交
64851129
编写于
1月 02, 2021
作者:
G
Garrett Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add setFromMatrix3 function
Add test
上级
6e6bb25c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
0 deletion
+43
-0
docs/api/en/math/Matrix4.html
docs/api/en/math/Matrix4.html
+3
-0
docs/api/zh/math/Matrix4.html
docs/api/zh/math/Matrix4.html
+3
-0
src/math/Matrix4.js
src/math/Matrix4.js
+17
-0
test/unit/src/math/Matrix4.tests.js
test/unit/src/math/Matrix4.tests.js
+20
-0
未找到文件。
docs/api/en/math/Matrix4.html
浏览文件 @
64851129
...
...
@@ -368,6 +368,9 @@ x, y, 1, 0,
[page:Float n12], ... [page:Float n44].
</p>
<h3>
[method:this setFromMatrix3]( [param:Matrix3 m] )
</h3>
<p>
Set the upper 3x3 elements of this matrix to the values of the Matrix3 [page:Matrix3 m].
</p>
<h3>
[method:this setPosition]( [param:Vector3 v] )
</h3>
<h3>
[method:this setPosition]( [param:Float x], [param:Float y], [param:Float z] ) // optional API
</h3>
<p>
...
...
docs/api/zh/math/Matrix4.html
浏览文件 @
64851129
...
...
@@ -351,6 +351,9 @@ x, y, 1, 0,
以行优先的格式将传入的数值设置给该矩阵中的元素[page:.elements elements]。
</p>
<h3>
[method:this setFromMatrix3]( [param:Matrix3 m] )
</h3>
<p>
Set the upper 3x3 elements of this matrix to the values of the Matrix3 [page:Matrix3 m].
</p>
<h3>
[method:this setPosition]( [param:Vector3 v] )
</h3>
<h3>
[method:this setPosition]( [param:Float x], [param:Float y], [param:Float z] ) // optional API
</h3>
<p>
...
...
src/math/Matrix4.js
浏览文件 @
64851129
...
...
@@ -83,6 +83,23 @@ class Matrix4 {
}
setFromMatrix3
(
m
)
{
const
me
=
m
.
elements
;
this
.
set
(
me
[
0
],
me
[
3
],
me
[
6
],
0
,
me
[
1
],
me
[
4
],
me
[
7
],
0
,
me
[
2
],
me
[
5
],
me
[
8
],
0
,
0
,
0
,
0
,
1
);
return
this
;
}
extractBasis
(
xAxis
,
yAxis
,
zAxis
)
{
xAxis
.
setFromMatrixColumn
(
this
,
0
);
...
...
test/unit/src/math/Matrix4.tests.js
浏览文件 @
64851129
/* global QUnit */
import
{
Matrix3
}
from
'
../../../../src/math/Matrix3
'
;
import
{
Matrix4
}
from
'
../../../../src/math/Matrix4
'
;
import
{
Vector3
}
from
'
../../../../src/math/Vector3
'
;
import
{
Euler
}
from
'
../../../../src/math/Euler
'
;
...
...
@@ -163,6 +164,25 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
test
(
"
setFromMatrix4
"
,
(
assert
)
=>
{
var
a
=
new
Matrix3
().
set
(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
);
var
b
=
new
Matrix4
();
var
c
=
new
Matrix4
().
set
(
0
,
1
,
2
,
0
,
3
,
4
,
5
,
0
,
6
,
7
,
8
,
0
,
0
,
0
,
0
,
1
);
b
.
setFromMatrix3
(
a
);
assert
.
ok
(
b
.
equals
(
c
)
);
}
);
QUnit
.
test
(
"
copyPosition
"
,
(
assert
)
=>
{
var
a
=
new
Matrix4
().
set
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录