Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
8f92ca23
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,发现更多精彩内容 >>
未验证
提交
8f92ca23
编写于
6月 20, 2019
作者:
M
Mr.doob
提交者:
GitHub
6月 20, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16859 from gero3/addPlaneUnittests
add Plane unittests
上级
95c6dcc9
416c1096
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
9 deletion
+47
-9
src/math/Plane.js
src/math/Plane.js
+2
-0
test/unit/src/math/Plane.tests.js
test/unit/src/math/Plane.tests.js
+45
-9
未找到文件。
src/math/Plane.js
浏览文件 @
8f92ca23
...
...
@@ -16,6 +16,8 @@ function Plane( normal, constant ) {
Object
.
assign
(
Plane
.
prototype
,
{
isPlane
:
true
,
set
:
function
(
normal
,
constant
)
{
this
.
normal
.
copy
(
normal
);
...
...
test/unit/src/math/Plane.tests.js
浏览文件 @
8f92ca23
...
...
@@ -8,6 +8,7 @@ import { Plane } from '../../../../src/math/Plane';
import
{
Vector3
}
from
'
../../../../src/math/Vector3
'
;
import
{
Line3
}
from
'
../../../../src/math/Line3
'
;
import
{
Sphere
}
from
'
../../../../src/math/Sphere
'
;
import
{
Box3
}
from
'
../../../../src/math/Box3
'
;
import
{
Matrix4
}
from
'
../../../../src/math/Matrix4
'
;
import
{
x
,
...
...
@@ -54,9 +55,14 @@ export default QUnit.module( 'Maths', () => {
}
);
// PUBLIC STUFF
QUnit
.
todo
(
"
isPlane
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
isPlane
"
,
(
assert
)
=>
{
var
a
=
new
Plane
();
assert
.
ok
(
a
.
isPlane
===
true
,
"
Passed!
"
);
var
b
=
new
Vector3
();
assert
.
ok
(
!
b
.
isPlane
,
"
Passed!
"
);
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
...
...
@@ -118,9 +124,13 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
todo
(
"
clone
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
clone
"
,
(
assert
)
=>
{
var
a
=
new
Plane
(
2.0
,
0.5
,
0.25
);
var
b
=
a
.
clone
();
assert
.
ok
(
a
.
equals
(
b
),
"
clones are equal
"
);
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
}
);
...
...
@@ -229,15 +239,41 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
todo
(
"
intersectsBox
"
,
(
assert
)
=>
{
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
QUnit
.
test
(
"
intersectsBox
"
,
(
assert
)
=>
{
var
a
=
new
Box3
(
zero3
.
clone
(),
one3
.
clone
()
);
var
b
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
1
);
var
c
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
1.25
);
var
d
=
new
Plane
(
new
Vector3
(
0
,
-
1
,
0
),
1.25
);
var
e
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
0.25
);
var
f
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
-
0.25
);
var
g
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
-
0.75
);
var
h
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
-
1
);
var
i
=
new
Plane
(
new
Vector3
(
1
,
1
,
1
).
normalize
(),
-
1.732
);
var
j
=
new
Plane
(
new
Vector3
(
1
,
1
,
1
).
normalize
(),
-
1.733
);
assert
.
ok
(
!
b
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
!
c
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
!
d
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
!
e
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
f
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
g
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
h
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
i
.
intersectsBox
(
a
),
"
Passed!
"
);
assert
.
ok
(
!
j
.
intersectsBox
(
a
),
"
Passed!
"
);
}
);
QUnit
.
todo
(
"
intersectsSphere
"
,
(
assert
)
=>
{
QUnit
.
test
(
"
intersectsSphere
"
,
(
assert
)
=>
{
var
a
=
new
Sphere
(
zero3
.
clone
(),
1
);
var
b
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
1
);
var
c
=
new
Plane
(
new
Vector3
(
0
,
1
,
0
),
1.25
);
var
d
=
new
Plane
(
new
Vector3
(
0
,
-
1
,
0
),
1.25
);
assert
.
ok
(
false
,
"
everything's gonna be alright
"
);
assert
.
ok
(
b
.
intersectsSphere
(
a
),
"
Passed!
"
);
assert
.
ok
(
!
c
.
intersectsSphere
(
a
),
"
Passed!
"
);
assert
.
ok
(
!
d
.
intersectsSphere
(
a
),
"
Passed!
"
);
}
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录