Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
7e45066f
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,发现更多精彩内容 >>
提交
7e45066f
编写于
6月 24, 2016
作者:
W
WestLangley
提交者:
Mr.doob
6月 23, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added Manhattan distance (#9206)
上级
a88d56aa
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
42 addition
and
20 deletion
+42
-20
docs/api/math/Vector2.html
docs/api/math/Vector2.html
+10
-5
docs/api/math/Vector3.html
docs/api/math/Vector3.html
+12
-7
docs/api/math/Vector4.html
docs/api/math/Vector4.html
+8
-8
src/math/Vector2.js
src/math/Vector2.js
+6
-0
src/math/Vector3.js
src/math/Vector3.js
+6
-0
未找到文件。
docs/api/math/Vector2.html
浏览文件 @
7e45066f
...
...
@@ -126,17 +126,17 @@
<h3>
[method:Float lengthSq]() [page:Vector2 this]
</h3>
<div>
Computes squared length of this vector.
Computes
the
squared length of this vector.
</div>
<h3>
[method:Float length]() [page:Vector2 this]
</h3>
<div>
Computes length of this vector.
Computes
the
length of this vector.
</div>
<h3>
[method:Float lengthManhattan]() [page:Vector2 this]
</h3>
<div>
Computes Manhattan length of this vector.
<br
/>
Computes
the
Manhattan length of this vector.
<br
/>
[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
</div>
...
...
@@ -152,12 +152,17 @@
<h3>
[method:Float distanceTo]( [page:Vector2 v] )
</h3>
<div>
Computes
distance of
this vector to *v*.
Computes
the distance from
this vector to *v*.
</div>
<h3>
[method:Float distanceToSquared]( [page:Vector2 v] )
</h3>
<div>
Computes squared distance of this vector to *v*.
Computes the squared distance from this vector to *v*.
</div>
<h3>
[method:Float distanceToManhattan]( [page:Vector2 v] )
</h3>
<div>
Computes the Manhattan distance from this vector to *v*.
</div>
<h3>
[method:Vector2 setLength]( [page:Float l] ) [page:Vector2 this]
</h3>
...
...
docs/api/math/Vector3.html
浏览文件 @
7e45066f
...
...
@@ -130,17 +130,17 @@
<h3>
[method:Float lengthSq]() [page:Vector3 this]
</h3>
<div>
Computes squared length of this vector.
Computes
the
squared length of this vector.
</div>
<h3>
[method:Float length]() [page:Vector3 this]
</h3>
<div>
Computes length of this vector.
Computes
the
length of this vector.
</div>
<h3>
[method:Float lengthManhattan]() [page:Vector3 this]
</h3>
<div>
Computes Manhattan length of this vector.
<br
/>
Computes
the
Manhattan length of this vector.
<br
/>
[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
</div>
...
...
@@ -149,14 +149,19 @@
Normalizes this vector. Transforms this Vector into a Unit vector by dividing the vector by its length.
</div>
<h3>
[method:Float distanceTo]( [page:Vector3 v] )
[page:Vector3 this]
</h3>
<h3>
[method:Float distanceTo]( [page:Vector3 v] )
</h3>
<div>
Computes
distance of
this vector to *v*.
Computes
the distance from
this vector to *v*.
</div>
<h3>
[method:Float distanceToSquared]( [page:Vector3 v] )
[page:Vector3 this]
</h3>
<h3>
[method:Float distanceToSquared]( [page:Vector3 v] )
</h3>
<div>
Computes squared distance of this vector to *v*.
Computes the squared distance from this vector to *v*.
</div>
<h3>
[method:Float distanceToManhattan]( [page:Vector3 v] )
</h3>
<div>
Computes the Manhattan distance from this vector to *v*.
</div>
<h3>
[method:Vector3 setLength]( [page:Float l] ) [page:Vector3 this]
</h3>
...
...
docs/api/math/Vector4.html
浏览文件 @
7e45066f
...
...
@@ -137,12 +137,18 @@
<h3>
[method:Float lengthSq]() [page:Vector4 this]
</h3>
<div>
Computes squared length of this vector.
Computes
the
squared length of this vector.
</div>
<h3>
[method:Float length]() [page:Vector4 this]
</h3>
<div>
Computes length of this vector.
Computes the length of this vector.
</div>
<h3>
[method:Float lengthManhattan]() [page:Vector4 this]
</h3>
<div>
Computes the Manhattan length of this vector.
<br
/>
[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
</div>
<h3>
[method:Vector4 normalize]() [page:Vector4 this]
</h3>
...
...
@@ -294,12 +300,6 @@
Index 3: w
<br/>
</div>
<h3>
[method:Float lengthManhattan]() [page:Vector4 this]
</h3>
<div>
Computes Manhattan length of this vector.
<br
/>
[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
</div>
<h3>
[method:Vector4 clone]() [page:Vector4 this]
</h3>
<div>
Clones this vector.
...
...
src/math/Vector2.js
浏览文件 @
7e45066f
...
...
@@ -393,6 +393,12 @@ THREE.Vector2.prototype = {
},
distanceToManhattan
:
function
(
v
)
{
return
Math
.
abs
(
this
.
x
-
v
.
x
)
+
Math
.
abs
(
this
.
y
-
v
.
y
);
},
setLength
:
function
(
length
)
{
return
this
.
multiplyScalar
(
length
/
this
.
length
()
);
...
...
src/math/Vector3.js
浏览文件 @
7e45066f
...
...
@@ -659,6 +659,12 @@ THREE.Vector3.prototype = {
},
distanceToManhattan
:
function
(
v
)
{
return
Math
.
abs
(
this
.
x
-
v
.
x
)
+
Math
.
abs
(
this
.
y
-
v
.
y
)
+
Math
.
abs
(
this
.
z
-
v
.
z
);
},
setFromSpherical
:
function
(
s
)
{
var
sinPhiRadius
=
Math
.
sin
(
s
.
phi
)
*
s
.
radius
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录