Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
08f03bbc
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,发现更多精彩内容 >>
提交
08f03bbc
编写于
7月 30, 2015
作者:
B
Ben Houston
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more minor bugs.
上级
996879a6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
22 deletion
+25
-22
src/animation/AnimationMixer.js
src/animation/AnimationMixer.js
+3
-2
src/animation/PropertyBinding.js
src/animation/PropertyBinding.js
+22
-20
未找到文件。
src/animation/AnimationMixer.js
浏览文件 @
08f03bbc
...
...
@@ -150,7 +150,8 @@ THREE.AnimationMixer.prototype = {
update
:
function
(
deltaTime
)
{
this
.
time
+=
deltaTime
*
this
.
timeScale
;
var
mixerDeltaTime
=
deltaTime
*
this
.
timeScale
;
this
.
time
+=
mixerDeltaTime
;
//console.log( this.root.name + ".AnimationMixer.update( " + time + " )" );
...
...
@@ -162,7 +163,7 @@ THREE.AnimationMixer.prototype = {
if
(
action
.
weight
<=
0
||
!
action
.
enabled
)
continue
;
var
actionResults
=
action
.
getAt
(
this
.
t
ime
);
var
actionResults
=
action
.
update
(
mixerDeltaT
ime
);
for
(
var
name
in
actionResults
)
{
...
...
src/animation/PropertyBinding.js
浏览文件 @
08f03bbc
...
...
@@ -42,6 +42,8 @@ THREE.PropertyBinding.prototype = {
accumulate
:
function
(
value
,
weight
)
{
if
(
!
this
.
isBound
)
this
.
bind
();
if
(
this
.
cumulativeWeight
===
0
)
{
if
(
this
.
cumulativeValue
===
null
)
{
...
...
@@ -54,7 +56,7 @@ THREE.PropertyBinding.prototype = {
else
{
var
lerpAlpha
=
weight
/
(
this
.
cumulativeWeight
+
weight
);
this
.
cumulativeValue
=
this
.
lerp
(
this
.
cumulativeValue
,
value
,
lerpAlpha
);
this
.
cumulativeValue
=
this
.
lerp
Value
(
this
.
cumulativeValue
,
value
,
lerpAlpha
);
this
.
cumulativeWeight
+=
weight
;
//console.log( this );
...
...
@@ -64,16 +66,17 @@ THREE.PropertyBinding.prototype = {
unbind
:
function
()
{
if
(
this
.
setValue
)
{
if
(
!
this
.
isBound
)
return
;
this
.
setValue
(
this
.
originalValue
);
this
.
setValue
(
this
.
originalValue
);
this
.
setValue
=
null
;
this
.
getValue
=
null
;
this
.
lerpValue
=
null
;
this
.
equalsValue
=
null
;
this
.
triggerDirty
=
null
;
this
.
isBound
=
false
;
this
.
setValue
=
null
;
this
.
getValue
=
null
;
this
.
lerp
=
null
;
this
.
triggerDirty
=
null
;
}
},
// creates the member functions:
...
...
@@ -83,12 +86,10 @@ THREE.PropertyBinding.prototype = {
bind
:
function
()
{
if
(
this
.
setValue
)
throw
new
Error
(
"
can not bind if already bound.
"
)
;
if
(
this
.
isBound
)
return
;
//console.log( "PropertyBinding", this );
var
equalsFunc
=
THREE
.
AnimationUtils
.
getEqualsFunc
(
this
.
originalValue
);
var
targetObject
=
this
.
node
;
// ensure there is a value node
...
...
@@ -181,7 +182,7 @@ THREE.PropertyBinding.prototype = {
//console.log( ' update property array ' + this.propertyName + '[' + this.propertyIndex + '] via assignment.' );
this
.
setValue
=
function
(
value
)
{
if
(
!
equalsFunc
(
nodeProperty
[
this
.
propertyIndex
],
value
)
)
{
if
(
!
this
.
equalsValue
(
nodeProperty
[
this
.
propertyIndex
],
value
)
)
{
nodeProperty
[
this
.
propertyIndex
]
=
value
;
return
true
;
}
...
...
@@ -198,7 +199,7 @@ THREE.PropertyBinding.prototype = {
//console.log( ' update property ' + this.name + '.' + this.propertyName + ' via a set() function.' );
this
.
setValue
=
function
(
value
)
{
if
(
!
equalsFunc
(
nodeProperty
,
value
)
)
{
if
(
!
this
.
equalsValue
(
nodeProperty
,
value
)
)
{
nodeProperty
.
copy
(
value
);
return
true
;
}
...
...
@@ -215,7 +216,7 @@ THREE.PropertyBinding.prototype = {
//console.log( ' update property ' + this.name + '.' + this.propertyName + ' via assignment.' );
this
.
setValue
=
function
(
value
)
{
if
(
!
equalsFunc
(
targetObject
[
this
.
propertyName
],
value
)
)
{
if
(
!
this
.
equalsValue
(
targetObject
[
this
.
propertyName
],
value
)
)
{
targetObject
[
this
.
propertyName
]
=
value
;
return
true
;
}
...
...
@@ -248,16 +249,17 @@ THREE.PropertyBinding.prototype = {
this
.
originalValue
=
this
.
getValue
();
this
.
lerp
=
THREE
.
AnimationUtils
.
getLerpFunc
(
this
.
originalValue
,
true
);
this
.
equalsValue
=
THREE
.
AnimationUtils
.
getEqualsFunc
(
this
.
originalValue
);
this
.
lerpValue
=
THREE
.
AnimationUtils
.
getLerpFunc
(
this
.
originalValue
,
true
);
this
.
isBound
=
true
;
},
apply
:
function
()
{
// for speed capture the setter pattern as a closure (sort of a memoization pattern: https://en.wikipedia.org/wiki/Memoization)
if
(
!
this
.
setValue
)
{
this
.
bind
();
}
if
(
!
this
.
isBound
)
this
.
bind
();
// early exit if there is nothing to apply.
if
(
this
.
cumulativeWeight
>
0
)
{
...
...
@@ -267,7 +269,7 @@ THREE.PropertyBinding.prototype = {
var
remainingWeight
=
1
-
this
.
cumulativeWeight
;
var
lerpAlpha
=
remainingWeight
/
(
this
.
cumulativeWeight
+
remainingWeight
);
this
.
cumulativeValue
=
this
.
lerp
(
this
.
cumulativeValue
,
this
.
originalValue
,
lerpAlpha
);
this
.
cumulativeValue
=
this
.
lerp
Valueler
(
this
.
cumulativeValue
,
this
.
originalValue
,
lerpAlpha
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录