Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0c6219b4
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 搜索 >>
提交
0c6219b4
编写于
9月 27, 2010
作者:
B
Ben Nolan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* Made vector methods chainable
* Added getCenter to Face4
上级
5ce7a10b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
0 deletion
+33
-0
src/core/Face4.js
src/core/Face4.js
+7
-0
src/core/Vector2.js
src/core/Vector2.js
+6
-0
src/core/Vector3.js
src/core/Vector3.js
+16
-0
src/core/Vector4.js
src/core/Vector4.js
+4
-0
未找到文件。
src/core/Face4.js
浏览文件 @
0c6219b4
...
...
@@ -22,6 +22,13 @@ THREE.Face4.prototype = {
return
'
THREE.Face4 (
'
+
this
.
a
+
'
,
'
+
this
.
b
+
'
,
'
+
this
.
c
+
'
'
+
this
.
d
+
'
)
'
;
},
getCenter
:
function
(){
return
this
.
a
.
clone
().
addSelf
(
this
.
b
).
addSelf
(
this
.
c
).
addSelf
(
this
.
d
).
divideScalar
(
4
);
}
}
src/core/Vector2.js
浏览文件 @
0c6219b4
...
...
@@ -30,6 +30,8 @@ THREE.Vector2.prototype = {
this
.
x
+=
v
.
x
;
this
.
y
+=
v
.
y
;
return
this
;
},
...
...
@@ -45,6 +47,8 @@ THREE.Vector2.prototype = {
this
.
x
-=
v
.
x
;
this
.
y
-=
v
.
y
;
return
this
;
},
sub
:
function
(
v1
,
v2
)
{
...
...
@@ -59,6 +63,8 @@ THREE.Vector2.prototype = {
this
.
x
*=
s
;
this
.
y
*=
s
;
return
this
;
},
unit
:
function
()
{
...
...
src/core/Vector3.js
浏览文件 @
0c6219b4
...
...
@@ -44,6 +44,8 @@ THREE.Vector3.prototype = {
this
.
y
+=
v
.
y
;
this
.
z
+=
v
.
z
;
return
this
;
},
addScalar
:
function
(
s
)
{
...
...
@@ -52,6 +54,8 @@ THREE.Vector3.prototype = {
this
.
y
+=
s
;
this
.
z
+=
s
;
return
this
;
},
sub
:
function
(
v1
,
v2
)
{
...
...
@@ -68,6 +72,8 @@ THREE.Vector3.prototype = {
this
.
y
-=
v
.
y
;
this
.
z
-=
v
.
z
;
return
this
;
},
cross
:
function
(
v1
,
v2
)
{
...
...
@@ -86,6 +92,8 @@ THREE.Vector3.prototype = {
this
.
y
=
tz
*
v
.
x
-
tx
*
v
.
z
;
this
.
z
=
tx
*
v
.
y
-
ty
*
v
.
x
;
return
this
;
},
multiplySelf
:
function
(
v
)
{
...
...
@@ -94,6 +102,8 @@ THREE.Vector3.prototype = {
this
.
y
*=
v
.
y
;
this
.
z
*=
v
.
z
;
return
this
;
},
multiplyScalar
:
function
(
s
)
{
...
...
@@ -102,6 +112,8 @@ THREE.Vector3.prototype = {
this
.
y
*=
s
;
this
.
z
*=
s
;
return
this
;
},
divideScalar
:
function
(
s
)
{
...
...
@@ -110,6 +122,8 @@ THREE.Vector3.prototype = {
this
.
y
/=
s
;
this
.
z
/=
s
;
return
this
;
},
dot
:
function
(
v
)
{
...
...
@@ -149,6 +163,8 @@ THREE.Vector3.prototype = {
this
.
y
=
-
this
.
y
;
this
.
z
=
-
this
.
z
;
return
this
;
},
normalize
:
function
()
{
...
...
src/core/Vector4.js
浏览文件 @
0c6219b4
...
...
@@ -48,6 +48,8 @@ THREE.Vector4.prototype = {
this
.
z
+=
v
.
z
;
this
.
w
+=
v
.
w
;
return
this
;
},
sub
:
function
(
v1
,
v2
)
{
...
...
@@ -66,6 +68,8 @@ THREE.Vector4.prototype = {
this
.
z
-=
v
.
z
;
this
.
w
-=
v
.
w
;
return
this
;
},
clone
:
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录