Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
fd5e6cfb
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
fd5e6cfb
编写于
8月 10, 2021
作者:
M
Marco Fugaro
提交者:
GitHub
8月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Update missing this. references (#22305)
上级
9a31750a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
28 deletion
+28
-28
examples/jsm/curves/NURBSUtils.js
examples/jsm/curves/NURBSUtils.js
+11
-11
examples/jsm/utils/SkeletonUtils.js
examples/jsm/utils/SkeletonUtils.js
+17
-17
未找到文件。
examples/jsm/curves/NURBSUtils.js
浏览文件 @
fd5e6cfb
...
...
@@ -119,8 +119,8 @@ returns point for given u
*/
function
calcBSplinePoint
(
p
,
U
,
P
,
u
)
{
const
span
=
this
.
findSpan
(
p
,
u
,
U
);
const
N
=
this
.
calcBasisFunctions
(
span
,
u
,
p
,
U
);
const
span
=
findSpan
(
p
,
u
,
U
);
const
N
=
calcBasisFunctions
(
span
,
u
,
p
,
U
);
const
C
=
new
Vector4
(
0
,
0
,
0
,
0
);
for
(
let
j
=
0
;
j
<=
p
;
++
j
)
{
...
...
@@ -289,8 +289,8 @@ function calcBSplineDerivatives( p, U, P, u, nd ) {
const
du
=
nd
<
p
?
nd
:
p
;
const
CK
=
[];
const
span
=
this
.
findSpan
(
p
,
u
,
U
);
const
nders
=
this
.
calcBasisFunctionDerivatives
(
span
,
u
,
p
,
du
,
U
);
const
span
=
findSpan
(
p
,
u
,
U
);
const
nders
=
calcBasisFunctionDerivatives
(
span
,
u
,
p
,
du
,
U
);
const
Pw
=
[];
for
(
let
i
=
0
;
i
<
P
.
length
;
++
i
)
{
...
...
@@ -394,7 +394,7 @@ function calcRationalCurveDerivatives( Pders ) {
for
(
let
i
=
1
;
i
<=
k
;
++
i
)
{
v
.
sub
(
CK
[
k
-
i
].
clone
().
multiplyScalar
(
this
.
calcKoverI
(
k
,
i
)
*
wders
[
i
]
)
);
v
.
sub
(
CK
[
k
-
i
].
clone
().
multiplyScalar
(
calcKoverI
(
k
,
i
)
*
wders
[
i
]
)
);
}
...
...
@@ -420,8 +420,8 @@ returns array with derivatives.
*/
function
calcNURBSDerivatives
(
p
,
U
,
P
,
u
,
nd
)
{
const
Pders
=
this
.
calcBSplineDerivatives
(
p
,
U
,
P
,
u
,
nd
);
return
this
.
calcRationalCurveDerivatives
(
Pders
);
const
Pders
=
calcBSplineDerivatives
(
p
,
U
,
P
,
u
,
nd
);
return
calcRationalCurveDerivatives
(
Pders
);
}
...
...
@@ -438,10 +438,10 @@ returns point for given (u, v)
*/
function
calcSurfacePoint
(
p
,
q
,
U
,
V
,
P
,
u
,
v
,
target
)
{
const
uspan
=
this
.
findSpan
(
p
,
u
,
U
);
const
vspan
=
this
.
findSpan
(
q
,
v
,
V
);
const
Nu
=
this
.
calcBasisFunctions
(
uspan
,
u
,
p
,
U
);
const
Nv
=
this
.
calcBasisFunctions
(
vspan
,
v
,
q
,
V
);
const
uspan
=
findSpan
(
p
,
u
,
U
);
const
vspan
=
findSpan
(
q
,
v
,
V
);
const
Nu
=
calcBasisFunctions
(
uspan
,
u
,
p
,
U
);
const
Nv
=
calcBasisFunctions
(
vspan
,
v
,
q
,
V
);
const
temp
=
[];
for
(
let
l
=
0
;
l
<=
q
;
++
l
)
{
...
...
examples/jsm/utils/SkeletonUtils.js
浏览文件 @
fd5e6cfb
...
...
@@ -28,8 +28,8 @@ function retarget( target, source, options = {} ) {
options
.
hip
=
options
.
hip
!==
undefined
?
options
.
hip
:
'
hip
'
;
options
.
names
=
options
.
names
||
{};
const
sourceBones
=
source
.
isObject3D
?
source
.
skeleton
.
bones
:
this
.
getBones
(
source
),
bones
=
target
.
isObject3D
?
target
.
skeleton
.
bones
:
this
.
getBones
(
target
);
const
sourceBones
=
source
.
isObject3D
?
source
.
skeleton
.
bones
:
getBones
(
source
),
bones
=
target
.
isObject3D
?
target
.
skeleton
.
bones
:
getBones
(
target
);
let
bindBones
,
bone
,
name
,
boneTo
,
...
...
@@ -108,7 +108,7 @@ function retarget( target, source, options = {} ) {
bone
=
bones
[
i
];
name
=
options
.
names
[
bone
.
name
]
||
bone
.
name
;
boneTo
=
this
.
getBoneByName
(
name
,
sourceBones
);
boneTo
=
getBoneByName
(
name
,
sourceBones
);
globalMatrix
.
copy
(
bone
.
matrixWorld
);
...
...
@@ -207,7 +207,7 @@ function retargetClip( target, source, clip, options = {} ) {
if
(
!
source
.
isObject3D
)
{
source
=
this
.
getHelperFromSkeleton
(
source
);
source
=
getHelperFromSkeleton
(
source
);
}
...
...
@@ -215,7 +215,7 @@ function retargetClip( target, source, clip, options = {} ) {
delta
=
1
/
options
.
fps
,
convertedTracks
=
[],
mixer
=
new
AnimationMixer
(
source
),
bones
=
this
.
getBones
(
target
.
skeleton
),
bones
=
getBones
(
target
.
skeleton
),
boneDatas
=
[];
let
positionOffset
,
bone
,
boneTo
,
boneData
,
...
...
@@ -230,13 +230,13 @@ function retargetClip( target, source, clip, options = {} ) {
const
time
=
i
*
delta
;
this
.
retarget
(
target
,
source
,
options
);
retarget
(
target
,
source
,
options
);
for
(
let
j
=
0
;
j
<
bones
.
length
;
++
j
)
{
name
=
options
.
names
[
bones
[
j
].
name
]
||
bones
[
j
].
name
;
boneTo
=
this
.
getBoneByName
(
name
,
source
.
skeleton
);
boneTo
=
getBoneByName
(
name
,
source
.
skeleton
);
if
(
boneTo
)
{
...
...
@@ -350,14 +350,14 @@ function getSkeletonOffsets( target, source, options = {} ) {
if
(
!
source
.
isObject3D
)
{
source
=
this
.
getHelperFromSkeleton
(
source
);
source
=
getHelperFromSkeleton
(
source
);
}
const
nameKeys
=
Object
.
keys
(
options
.
names
),
nameValues
=
Object
.
values
(
options
.
names
),
sourceBones
=
source
.
isObject3D
?
source
.
skeleton
.
bones
:
this
.
getBones
(
source
),
bones
=
target
.
isObject3D
?
target
.
skeleton
.
bones
:
this
.
getBones
(
target
),
sourceBones
=
source
.
isObject3D
?
source
.
skeleton
.
bones
:
getBones
(
source
),
bones
=
target
.
isObject3D
?
target
.
skeleton
.
bones
:
getBones
(
target
),
offsets
=
[];
let
bone
,
boneTo
,
...
...
@@ -370,12 +370,12 @@ function getSkeletonOffsets( target, source, options = {} ) {
bone
=
bones
[
i
];
name
=
options
.
names
[
bone
.
name
]
||
bone
.
name
;
boneTo
=
this
.
getBoneByName
(
name
,
sourceBones
);
boneTo
=
getBoneByName
(
name
,
sourceBones
);
if
(
boneTo
&&
name
!==
options
.
hip
)
{
const
boneParent
=
this
.
getNearestBone
(
bone
.
parent
,
nameKeys
),
boneToParent
=
this
.
getNearestBone
(
boneTo
.
parent
,
nameValues
);
const
boneParent
=
getNearestBone
(
bone
.
parent
,
nameKeys
),
boneToParent
=
getNearestBone
(
boneTo
.
parent
,
nameValues
);
boneParent
.
updateMatrixWorld
();
boneToParent
.
updateMatrixWorld
();
...
...
@@ -424,7 +424,7 @@ function getSkeletonOffsets( target, source, options = {} ) {
function
renameBones
(
skeleton
,
names
)
{
const
bones
=
this
.
getBones
(
skeleton
);
const
bones
=
getBones
(
skeleton
);
for
(
let
i
=
0
;
i
<
bones
.
length
;
++
i
)
{
...
...
@@ -450,7 +450,7 @@ function getBones( skeleton ) {
function
getBoneByName
(
name
,
skeleton
)
{
for
(
let
i
=
0
,
bones
=
this
.
getBones
(
skeleton
);
i
<
bones
.
length
;
i
++
)
{
for
(
let
i
=
0
,
bones
=
getBones
(
skeleton
);
i
<
bones
.
length
;
i
++
)
{
if
(
name
===
bones
[
i
].
name
)
...
...
@@ -501,8 +501,8 @@ function findBoneTrackData( name, tracks ) {
function
getEqualsBonesNames
(
skeleton
,
targetSkeleton
)
{
const
sourceBones
=
this
.
getBones
(
skeleton
),
targetBones
=
this
.
getBones
(
targetSkeleton
),
const
sourceBones
=
getBones
(
skeleton
),
targetBones
=
getBones
(
targetSkeleton
),
bones
=
[];
search
:
for
(
let
i
=
0
;
i
<
sourceBones
.
length
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录