Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
620fe4b9
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
未验证
提交
620fe4b9
编写于
8月 22, 2019
作者:
M
Mr.doob
提交者:
GitHub
8月 22, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17320 from vlaube-de/dev
TS: add more fromArray and toArray function types
上级
bba76b28
5c42600a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
152 addition
and
15 deletion
+152
-15
src/math/Color.d.ts
src/math/Color.d.ts
+28
-1
src/math/Matrix3.d.ts
src/math/Matrix3.d.ts
+26
-0
src/math/Matrix4.d.ts
src/math/Matrix4.d.ts
+27
-0
src/math/Quaternion.d.ts
src/math/Quaternion.d.ts
+29
-4
src/math/SphericalHarmonics3.d.ts
src/math/SphericalHarmonics3.d.ts
+30
-2
src/math/SphericalHarmonics3.js
src/math/SphericalHarmonics3.js
+9
-5
src/math/Vector3.d.ts
src/math/Vector3.d.ts
+2
-2
src/math/Vector4.d.ts
src/math/Vector4.d.ts
+1
-1
未找到文件。
src/math/Color.d.ts
浏览文件 @
620fe4b9
...
...
@@ -152,8 +152,35 @@ export class Color {
lerp
(
color
:
Color
,
alpha
:
number
):
this
;
lerpHSL
(
color
:
Color
,
alpha
:
number
):
this
;
equals
(
color
:
Color
):
boolean
;
fromArray
(
rgb
:
number
[],
offset
?:
number
):
this
;
/**
* Sets this color's red, green and blue value from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray
(
array
:
number
[],
offset
?:
number
):
this
;
/**
* Sets this color's red, green and blue value from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
this
;
/**
* Returns an array [red, green, blue], or copies red, green and blue into the provided array.
* @param array (optional) array to store the color to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray
(
array
?:
number
[],
offset
?:
number
):
number
[];
/**
* Copies red, green and blue into the provided array-like.
* @param array array-like to store the color to.
* @param offset (optional) optional offset into the array-like.
* @return The provided array-like.
*/
toArray
(
xyz
:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
}
src/math/Matrix3.d.ts
浏览文件 @
620fe4b9
...
...
@@ -111,10 +111,36 @@ export class Matrix3 implements Matrix {
equals
(
matrix
:
Matrix3
):
boolean
;
/**
* Sets the values of this matrix from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray
(
array
:
number
[],
offset
?:
number
):
Matrix3
;
/**
* Sets the values of this matrix from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
Matrix3
;
/**
* Returns an array with the values of this matrix, or copies them into the provided array.
* @param array (optional) array to store the matrix to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray
(
array
?:
number
[],
offset
?:
number
):
number
[];
/**
* Copies he values of this matrix into the provided array-like.
* @param array array-like to store the matrix to.
* @param offset (optional) optional offset into the array-like.
* @return The provided array-like.
*/
toArray
(
array
?:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
/**
* Multiplies this matrix by m.
*/
...
...
src/math/Matrix4.d.ts
浏览文件 @
620fe4b9
...
...
@@ -226,10 +226,37 @@ export class Matrix4 implements Matrix {
far
:
number
):
Matrix4
;
equals
(
matrix
:
Matrix4
):
boolean
;
/**
* Sets the values of this matrix from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray
(
array
:
number
[],
offset
?:
number
):
Matrix4
;
/**
* Sets the values of this matrix from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
Matrix4
;
/**
* Returns an array with the values of this matrix, or copies them into the provided array.
* @param array (optional) array to store the matrix to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray
(
array
?:
number
[],
offset
?:
number
):
number
[];
/**
* Copies he values of this matrix into the provided array-like.
* @param array array-like to store the matrix to.
* @param offset (optional) optional offset into the array-like.
* @return The provided array-like.
*/
toArray
(
array
?:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
/**
* @deprecated Use {@link Matrix4#copyPosition .copyPosition()} instead.
*/
...
...
src/math/Quaternion.d.ts
浏览文件 @
620fe4b9
...
...
@@ -94,11 +94,36 @@ export class Quaternion {
slerp
(
qb
:
Quaternion
,
t
:
number
):
Quaternion
;
equals
(
v
:
Quaternion
):
boolean
;
fromArray
(
n
:
number
[]
):
Quaternion
;
toArray
():
number
[];
fromArray
(
xyzw
:
number
[],
offset
?:
number
):
Quaternion
;
toArray
(
xyzw
?:
number
[],
offset
?:
number
):
number
[];
/**
* Sets this quaternion's x, y, z and w value from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray
(
array
:
number
[],
offset
?:
number
):
this
;
/**
* Sets this quaternion's x, y, z and w value from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
this
;
/**
* Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.
* @param array (optional) array to store the quaternion to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray
(
array
?:
number
[],
offset
?:
number
):
number
[];
/**
* Copies x, y, z and w into the provided array-like.
* @param array array-like to store the quaternion to.
* @param offset (optional) optional offset into the array.
* @return The provided array-like.
*/
toArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
_onChange
(
callback
:
Function
):
Quaternion
;
_onChangeCallback
:
Function
;
...
...
src/math/SphericalHarmonics3.d.ts
浏览文件 @
620fe4b9
...
...
@@ -15,8 +15,36 @@ export class SphericalHarmonics3 {
equals
(
sh
:
SphericalHarmonics3
):
boolean
;
copy
(
sh
:
SphericalHarmonics3
):
SphericalHarmonics3
;
clone
():
SphericalHarmonics3
;
fromArray
(
array
:
number
[]
):
SphericalHarmonics3
;
toArray
():
number
[];
/**
* Sets the values of this spherical harmonics from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray
(
array
:
number
[],
offset
?:
number
):
this
;
/**
* Sets the values of this spherical harmonics from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
this
;
/**
* Returns an array with the values of this spherical harmonics, or copies them into the provided array.
* @param array (optional) array to store the spherical harmonics to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray
(
array
?:
number
[],
offset
?:
number
):
number
[];
/**
* Returns an array with the values of this spherical harmonics, or copies them into the provided array-like.
* @param array array-like to store the spherical harmonics to.
* @param offset (optional) optional offset into the array-like.
* @return The provided array-like.
*/
toArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
getAt
(
normal
:
Vector3
,
target
:
Vector3
)
:
Vector3
;
getIrradianceAt
(
normal
:
Vector3
,
target
:
Vector3
)
:
Vector3
;
...
...
src/math/SphericalHarmonics3.js
浏览文件 @
620fe4b9
...
...
@@ -177,13 +177,15 @@ Object.assign( SphericalHarmonics3.prototype, {
},
fromArray
:
function
(
array
)
{
fromArray
:
function
(
array
,
offset
)
{
if
(
offset
===
undefined
)
offset
=
0
;
var
coefficients
=
this
.
coefficients
;
for
(
var
i
=
0
;
i
<
9
;
i
++
)
{
coefficients
[
i
].
fromArray
(
array
,
i
*
3
);
coefficients
[
i
].
fromArray
(
array
,
offset
+
(
i
*
3
)
);
}
...
...
@@ -191,14 +193,16 @@ Object.assign( SphericalHarmonics3.prototype, {
},
toArray
:
function
()
{
toArray
:
function
(
array
,
offset
)
{
if
(
array
===
undefined
)
array
=
[];
if
(
offset
===
undefined
)
offset
=
0
;
var
array
=
[];
var
coefficients
=
this
.
coefficients
;
for
(
var
i
=
0
;
i
<
9
;
i
++
)
{
coefficients
[
i
].
toArray
(
array
,
i
*
3
);
coefficients
[
i
].
toArray
(
array
,
offset
+
(
i
*
3
)
);
}
...
...
src/math/Vector3.d.ts
浏览文件 @
620fe4b9
...
...
@@ -256,7 +256,7 @@ export class Vector3 implements Vector {
fromArray
(
array
:
number
[],
offset
?:
number
):
this
;
/**
* Sets this vector's x, y and z value from the provided array-lik.
* Sets this vector's x, y and z value from the provided array-lik
e
.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
...
...
@@ -273,7 +273,7 @@ export class Vector3 implements Vector {
/**
* Copies x, y and z into the provided array-like.
* @param array array-like to store the vector to.
* @param offset (optional) optional offset into the array.
* @param offset (optional) optional offset into the array
-like
.
* @return The provided array-like.
*/
toArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
...
...
src/math/Vector4.d.ts
浏览文件 @
620fe4b9
...
...
@@ -199,7 +199,7 @@ export class Vector4 implements Vector {
/**
* Copies x, y, z and w into the provided array-like.
* @param array array-like to store the vector to.
* @param offset (optional) optional offset into the array.
* @param offset (optional) optional offset into the array
-like
.
* @return The provided array-like.
*/
toArray
(
array
:
ArrayLike
<
number
>
,
offset
?:
number
):
ArrayLike
<
number
>
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录