Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
02cf0df1
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
未验证
提交
02cf0df1
编写于
2月 15, 2022
作者:
W
WestLangley
提交者:
GitHub
2月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added Vector3.setFromEuler(); removed Euler.toVector3() (#23494)
上级
7e1c525d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
28 addition
and
52 deletion
+28
-52
docs/api/en/math/Euler.html
docs/api/en/math/Euler.html
+0
-9
docs/api/en/math/Vector3.html
docs/api/en/math/Vector3.html
+5
-0
editor/js/Sidebar.Object.js
editor/js/Sidebar.Object.js
+1
-1
examples/jsm/animation/CCDIKSolver.js
examples/jsm/animation/CCDIKSolver.js
+2
-8
src/Three.Legacy.js
src/Three.Legacy.js
+10
-0
src/math/Euler.js
src/math/Euler.js
+0
-15
src/math/Vector3.js
src/math/Vector3.js
+10
-0
test/unit/src/math/Euler.tests.js
test/unit/src/math/Euler.tests.js
+0
-19
未找到文件。
docs/api/en/math/Euler.html
浏览文件 @
02cf0df1
...
...
@@ -143,15 +143,6 @@
Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
</p>
<h3>
[method:Vector3 toVector3]( [param:Vector3 optionalResult] )
</h3>
<p>
[page:Vector3 optionalResult] — (optional) If specified, the result will be copied into this Vector,
otherwise a new one will be created.
<br
/><br
/>
Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].
</p>
<h2>
Source
</h2>
<p>
...
...
docs/api/en/math/Vector3.html
浏览文件 @
02cf0df1
...
...
@@ -357,6 +357,11 @@
<h3>
[method:this setFromCylindricalCoords]( [param:Float radius], [param:Float theta], [param:Float y] )
</h3>
<p>
Sets this vector from the cylindrical coordinates [page:Cylindrical radius], [page:Cylindrical theta] and [page:Cylindrical y].
</p>
<h3>
[method:this setFromEuler]( [param:Euler euler] )
</h3>
<p>
Sets this vector's [page:.x x], [page:.y y] and [page:.z z] components from the x, y, and z components of the specified [page:Euler Euler Angle].
</p>
<h3>
[method:this setFromMatrixColumn]( [param:Matrix4 matrix], [param:Integer index] )
</h3>
<p>
Sets this vector's [page:.x x], [page:.y y] and [page:.z z] components from [page:Integer index] column of [page:Matrix4 matrix].
...
...
editor/js/Sidebar.Object.js
浏览文件 @
02cf0df1
...
...
@@ -403,7 +403,7 @@ function SidebarObject( editor ) {
}
const
newRotation
=
new
THREE
.
Euler
(
objectRotationX
.
getValue
()
*
THREE
.
MathUtils
.
DEG2RAD
,
objectRotationY
.
getValue
()
*
THREE
.
MathUtils
.
DEG2RAD
,
objectRotationZ
.
getValue
()
*
THREE
.
MathUtils
.
DEG2RAD
);
if
(
object
.
rotation
.
toVector3
().
distanceTo
(
newRotation
.
toVector3
(
)
)
>=
0.01
)
{
if
(
new
THREE
.
Vector3
().
setFromEuler
(
object
.
rotation
).
distanceTo
(
new
THREE
.
Vector3
().
setFromEuler
(
newRotation
)
)
>=
0.01
)
{
editor
.
execute
(
new
SetRotationCommand
(
editor
,
object
,
newRotation
)
);
...
...
examples/jsm/animation/CCDIKSolver.js
浏览文件 @
02cf0df1
...
...
@@ -186,19 +186,13 @@ class CCDIKSolver {
if
(
rotationMin
!==
undefined
)
{
link
.
rotation
.
setFromVector3
(
link
.
rotation
.
toVector3
(
_vector
)
.
max
(
rotationMin
)
);
link
.
rotation
.
setFromVector3
(
_vector
.
setFromEuler
(
link
.
rotation
).
max
(
rotationMin
)
);
}
if
(
rotationMax
!==
undefined
)
{
link
.
rotation
.
setFromVector3
(
link
.
rotation
.
toVector3
(
_vector
)
.
min
(
rotationMax
)
);
link
.
rotation
.
setFromVector3
(
_vector
.
setFromEuler
(
link
.
rotation
).
min
(
rotationMax
)
);
}
...
...
src/Three.Legacy.js
浏览文件 @
02cf0df1
...
...
@@ -49,6 +49,7 @@ import { PointsMaterial } from './materials/PointsMaterial.js';
import
{
ShaderMaterial
}
from
'
./materials/ShaderMaterial.js
'
;
import
{
Box2
}
from
'
./math/Box2.js
'
;
import
{
Box3
}
from
'
./math/Box3.js
'
;
import
{
Euler
}
from
'
./math/Euler.js
'
;
import
{
Sphere
}
from
'
./math/Sphere.js
'
;
import
{
Color
}
from
'
./math/Color.js
'
;
import
{
Frustum
}
from
'
./math/Frustum.js
'
;
...
...
@@ -399,6 +400,15 @@ Box3.prototype.size = function ( optionalTarget ) {
};
//
Euler
.
prototype
.
toVector3
=
function
()
{
console
.
error
(
'
THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead
'
);
};
//
Sphere
.
prototype
.
empty
=
function
()
{
...
...
src/math/Euler.js
浏览文件 @
02cf0df1
import
{
Quaternion
}
from
'
./Quaternion.js
'
;
import
{
Vector3
}
from
'
./Vector3.js
'
;
import
{
Matrix4
}
from
'
./Matrix4.js
'
;
import
{
clamp
}
from
'
./MathUtils.js
'
;
...
...
@@ -288,20 +287,6 @@ class Euler {
}
toVector3
(
optionalResult
)
{
if
(
optionalResult
)
{
return
optionalResult
.
set
(
this
.
_x
,
this
.
_y
,
this
.
_z
);
}
else
{
return
new
Vector3
(
this
.
_x
,
this
.
_y
,
this
.
_z
);
}
}
_onChange
(
callback
)
{
this
.
_onChangeCallback
=
callback
;
...
...
src/math/Vector3.js
浏览文件 @
02cf0df1
...
...
@@ -659,6 +659,16 @@ class Vector3 {
}
setFromEuler
(
e
)
{
this
.
x
=
e
.
_x
;
this
.
y
=
e
.
_y
;
this
.
z
=
e
.
_z
;
return
this
;
}
equals
(
v
)
{
return
(
(
v
.
x
===
this
.
x
)
&&
(
v
.
y
===
this
.
y
)
&&
(
v
.
z
===
this
.
z
)
);
...
...
test/unit/src/math/Euler.tests.js
浏览文件 @
02cf0df1
...
...
@@ -200,25 +200,6 @@ export default QUnit.module( 'Maths', () => {
}
);
QUnit
.
test
(
'
set/setFromVector3/toVector3
'
,
(
assert
)
=>
{
var
a
=
new
Euler
();
a
.
set
(
0
,
1
,
0
,
'
ZYX
'
);
assert
.
ok
(
a
.
equals
(
eulerAzyx
),
'
Passed!
'
);
assert
.
ok
(
!
a
.
equals
(
eulerAxyz
),
'
Passed!
'
);
assert
.
ok
(
!
a
.
equals
(
eulerZero
),
'
Passed!
'
);
var
vec
=
new
Vector3
(
0
,
1
,
0
);
var
b
=
new
Euler
().
setFromVector3
(
vec
,
'
ZYX
'
);
assert
.
ok
(
a
.
equals
(
b
),
'
Passed!
'
);
var
c
=
b
.
toVector3
();
assert
.
ok
(
c
.
equals
(
vec
),
'
Passed!
'
);
}
);
QUnit
.
test
(
'
clone/copy/equals
'
,
(
assert
)
=>
{
var
a
=
eulerAxyz
.
clone
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录