Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
f3671a9d
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,发现更多精彩内容 >>
提交
f3671a9d
编写于
12月 03, 2012
作者:
B
Ben Houston
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove non-core and trivial geometric primitive fucntions to reduce code bulk.
上级
44774275
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
2 addition
and
75 deletion
+2
-75
src/math/Box2.js
src/math/Box2.js
+0
-6
src/math/Box3.js
src/math/Box3.js
+0
-6
src/math/Plane.js
src/math/Plane.js
+0
-8
src/math/Ray.js
src/math/Ray.js
+0
-13
src/math/Sphere.js
src/math/Sphere.js
+0
-6
test/core/Box2.js
test/core/Box2.js
+0
-8
test/core/Box3.js
test/core/Box3.js
+0
-5
test/core/Plane.js
test/core/Plane.js
+0
-8
test/core/Ray.js
test/core/Ray.js
+2
-15
未找到文件。
src/math/Box2.js
浏览文件 @
f3671a9d
...
...
@@ -115,12 +115,6 @@ THREE.Box2.prototype = {
},
volume
:
function
()
{
return
(
this
.
max
.
x
-
this
.
min
.
x
)
*
(
this
.
max
.
y
-
this
.
min
.
y
);
},
center
:
function
()
{
return
new
THREE
.
Vector2
().
add
(
this
.
min
,
this
.
max
).
multiplyScalar
(
0.5
);
...
...
src/math/Box3.js
浏览文件 @
f3671a9d
...
...
@@ -133,12 +133,6 @@ THREE.Box3.prototype = {
},
volume
:
function
()
{
return
(
this
.
max
.
x
-
this
.
min
.
x
)
*
(
this
.
max
.
y
-
this
.
min
.
y
)
*
(
this
.
max
.
z
-
this
.
min
.
z
);
},
center
:
function
()
{
return
new
THREE
.
Vector3
().
add
(
this
.
min
,
this
.
max
).
multiplyScalar
(
0.5
);
...
...
src/math/Plane.js
浏览文件 @
f3671a9d
...
...
@@ -71,14 +71,6 @@ THREE.Plane.prototype = {
},
flip
:
function
()
{
this
.
normal
.
negate
();
return
this
;
},
normalize
:
function
()
{
// Note: will lead to a divide by zero if the plane is invalid.
...
...
src/math/Ray.js
浏览文件 @
f3671a9d
...
...
@@ -46,19 +46,6 @@ THREE.Ray.prototype = {
},
recast
:
function
(
t
)
{
return
this
.
clone
().
recastSelf
(
t
);
},
flip
:
function
()
{
this
.
direction
.
negate
();
return
this
;
},
closestPointToPoint
:
function
(
point
)
{
var
result
=
point
.
clone
().
subSelf
(
this
.
origin
);
...
...
src/math/Sphere.js
浏览文件 @
f3671a9d
...
...
@@ -65,12 +65,6 @@ THREE.Sphere.prototype = {
},
volume
:
function
()
{
return
Math
.
PI
*
4
/
3
*
(
this
.
radius
*
this
.
radius
*
this
.
radius
);
},
containsPoint
:
function
(
point
)
{
return
(
point
.
distanceToSquared
(
this
.
center
)
<=
(
this
.
radius
*
this
.
radius
)
);
...
...
test/core/Box2.js
浏览文件 @
f3671a9d
...
...
@@ -51,14 +51,6 @@ test( "empty/makeEmpty", function() {
ok
(
a
.
empty
(),
"
Passed!
"
);
});
test
(
"
volume
"
,
function
()
{
var
a
=
new
THREE
.
Box2
(
zero2
,
one2
);
ok
(
a
.
volume
()
==
1
,
"
Passed!
"
);
a
=
new
THREE
.
Box2
(
one2
.
clone
().
negate
(),
zero2
);
ok
(
a
.
volume
()
==
1
,
"
Passed!
"
);
});
test
(
"
center
"
,
function
()
{
var
a
=
new
THREE
.
Box2
(
zero2
);
...
...
test/core/Box3.js
浏览文件 @
f3671a9d
...
...
@@ -51,11 +51,6 @@ test( "empty/makeEmpty", function() {
ok
(
a
.
empty
(),
"
Passed!
"
);
});
test
(
"
volume
"
,
function
()
{
var
a
=
new
THREE
.
Box3
(
zero3
,
one3
);
ok
(
a
.
volume
()
==
1
,
"
Passed!
"
);
});
test
(
"
center
"
,
function
()
{
var
a
=
new
THREE
.
Box3
(
zero3
);
...
...
test/core/Plane.js
浏览文件 @
f3671a9d
...
...
@@ -78,14 +78,6 @@ test( "setFromNormalAndCoplanarPoint", function() {
ok
(
a
.
constant
==
0
,
"
Passed!
"
);
});
test
(
"
flip
"
,
function
()
{
var
a
=
new
THREE
.
Plane
(
one3
,
0
);
ok
(
a
.
normal
.
equals
(
one3
),
"
Passed!
"
);
a
.
flip
();
ok
(
a
.
normal
.
negate
().
equals
(
one3
),
"
Passed!
"
);
});
test
(
"
normalize
"
,
function
()
{
var
a
=
new
THREE
.
Plane
(
new
THREE
.
Vector3
(
2
,
0
,
0
),
2
);
...
...
test/core/Ray.js
浏览文件 @
f3671a9d
...
...
@@ -43,7 +43,7 @@ test( "at", function() {
ok
(
a
.
at
(
1
).
equals
(
new
THREE
.
Vector3
(
1
,
1
,
2
)
),
"
Passed!
"
);
});
test
(
"
recast
/recast
Self/clone
"
,
function
()
{
test
(
"
recastSelf/clone
"
,
function
()
{
var
a
=
new
THREE
.
Ray
(
one3
,
new
THREE
.
Vector3
(
0
,
0
,
1
)
);
ok
(
a
.
recastSelf
(
0
).
equals
(
a
),
"
Passed!
"
);
...
...
@@ -55,25 +55,12 @@ test( "recast/recastSelf/clone", function() {
ok
(
c
.
recastSelf
(
1
).
equals
(
new
THREE
.
Ray
(
new
THREE
.
Vector3
(
1
,
1
,
2
),
new
THREE
.
Vector3
(
0
,
0
,
1
)
)
),
"
Passed!
"
);
var
d
=
a
.
clone
();
var
e
=
d
.
recast
(
1
);
var
e
=
d
.
clone
().
recastSelf
(
1
);
ok
(
d
.
equals
(
a
),
"
Passed!
"
);
ok
(
!
e
.
equals
(
d
),
"
Passed!
"
);
ok
(
e
.
equals
(
c
),
"
Passed!
"
);
});
test
(
"
flip
"
,
function
()
{
var
a
=
new
THREE
.
Ray
(
one3
,
new
THREE
.
Vector3
(
0
,
0
,
1
)
);
var
b
=
a
.
clone
();
b
.
flip
();
ok
(
b
.
direction
.
equals
(
new
THREE
.
Vector3
(
0
,
0
,
-
1
)
),
"
Passed!
"
);
ok
(
!
b
.
equals
(
a
),
"
Passed!
"
);
// and let's flip back to original direction
b
.
flip
();
ok
(
b
.
equals
(
a
),
"
Passed!
"
);
});
test
(
"
closestPointToPoint
"
,
function
()
{
var
a
=
new
THREE
.
Ray
(
one3
,
new
THREE
.
Vector3
(
0
,
0
,
1
)
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录