Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed SampledAnimCurve _findFrameIndex error #66

Merged
merged 2 commits into from
Dec 16, 2015
Merged

fixed SampledAnimCurve _findFrameIndex error #66

merged 2 commits into from
Dec 16, 2015

Conversation

2youyou2
Copy link
Contributor

update fireball-x/fireball#957

@jareguo


var index = (ratio / eachLength) | 0;
return index;
if ((index - formatIndex) < EPSILON) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个计算的目的是?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

判断是否正中那一帧

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那应该加个 abs 吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用, formatIndex 是 用 index 取整算来的,index 是肯定比 formatIndex 大的

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

明白了,既然这样,建议变量名改一下, formatIndex -> floorIndex

jareguo added a commit that referenced this pull request Dec 16, 2015
fixed SampledAnimCurve _findFrameIndex error
@jareguo jareguo merged commit a10193a into cocos:master Dec 16, 2015
zxg0622 pushed a commit to zxg0622/engine that referenced this pull request Jan 17, 2019
SantyWang pushed a commit that referenced this pull request Oct 11, 2021
* NewGenAnim

* Fix/Optimize simple directional blending

* Class transition by type (#29)

* Transition & Gradient transition (#30)

* The default ExitCondition should be 1.0

* Do correct graph eval

* Fix PoseSubgraph connect() signature order (#31)

* Graph defaults test (#32)

* Conditions (#33)

* Trigger (#34)

* Transition should only be considered when satemachine exited (#35)

* Add layer.name (#36)

* Fix some behaviours; add API to query poses and transition (#37)

Fix single frame exit condition behaviours; Fix pose -> subgraph behaviours

* Support self transition; refactor sub state machine implementation (#38)

* Temp

* Flat whole layer statemachine

* Add test for test reset triggers

* Allow self transition

* Self transition test

* Fix deserialize (#39)

* update animgraph template (#40)

* The inheritance of any state (#41)

* StateMachine events (#42)

* Fix state machine events; Allow multiple transitions between two nodes (#43)

* Transition priority test (#44)

* Optimize variable bind (#45)

* Fix variable bind errors (#46)

* Expose blend algorithm to editor (#47)

* Cont (#48)

* update animgraph template (#49)

* update animgraph template

* update animgraph template

* Pose speed (#50)

* blend tree add EditorExtendable data (#51)

* Correct pose blend duration (#52)

* Export some types (#53)

* animation pose EditorExtendable (#54)

(cherry picked from commit d5dd5f3)

* Implement clone() (#55)

* Fix trigger condition serialization (#56)

* Add variable type: integer (#57)

* Optimize 0 weight case (#58)

* Relative duration (#59)

* update_hdr_skybox (#9230)

* Rename.. (#60)

* Optimize animation blend item export (#61)

* Fix Type (#62)

* modify aniamtion graph template data (#63)

* modify aniamtion graph template data

* add animation graph component template

* Fix serialize issue (#64)

* Optimize (#65)

* Remove MotionState.startRatio, loop (#66)

* Update (#67)

* Fix circular reference (#68)

* CR (#69)

* Fix exit time greater than 1 (#70)

Co-authored-by: 黄森斌 <arsen2010@126.com>
Co-authored-by: linshunjun <49218738+linshunjun@users.noreply.github.com>
pandamicro pushed a commit that referenced this pull request Oct 14, 2021
* NewGenAnim

* Fix/Optimize simple directional blending

* Class transition by type (#29)

* Transition & Gradient transition (#30)

* The default ExitCondition should be 1.0

* Do correct graph eval

* Fix PoseSubgraph connect() signature order (#31)

* Graph defaults test (#32)

* Conditions (#33)

* Trigger (#34)

* Transition should only be considered when satemachine exited (#35)

* Add layer.name (#36)

* Fix some behaviours; add API to query poses and transition (#37)

Fix single frame exit condition behaviours; Fix pose -> subgraph behaviours

* Support self transition; refactor sub state machine implementation (#38)

* Temp

* Flat whole layer statemachine

* Add test for test reset triggers

* Allow self transition

* Self transition test

* Fix deserialize (#39)

* update animgraph template (#40)

* The inheritance of any state (#41)

* StateMachine events (#42)

* Fix state machine events; Allow multiple transitions between two nodes (#43)

* Transition priority test (#44)

* Optimize variable bind (#45)

* Fix variable bind errors (#46)

* Expose blend algorithm to editor (#47)

* Cont (#48)

* update animgraph template (#49)

* update animgraph template

* update animgraph template

* Pose speed (#50)

* blend tree add EditorExtendable data (#51)

* Correct pose blend duration (#52)

* Export some types (#53)

* animation pose EditorExtendable (#54)

(cherry picked from commit d5dd5f3)

* Implement clone() (#55)

* Fix trigger condition serialization (#56)

* Add variable type: integer (#57)

* Optimize 0 weight case (#58)

* Relative duration (#59)

* update_hdr_skybox (#9230)

* Rename.. (#60)

* Optimize animation blend item export (#61)

* Fix Type (#62)

* modify aniamtion graph template data (#63)

* modify aniamtion graph template data

* add animation graph component template

* Fix serialize issue (#64)

* Optimize (#65)

* Remove MotionState.startRatio, loop (#66)

* Update (#67)

* Fix circular reference (#68)

* CR (#69)

* Fix exit time greater than 1 (#70)

Co-authored-by: 黄森斌 <arsen2010@126.com>
Co-authored-by: linshunjun <49218738+linshunjun@users.noreply.github.com>
mmyduckx pushed a commit to mmyduckx/engine that referenced this pull request Nov 2, 2021
GengineJS pushed a commit to GengineJS/engine that referenced this pull request Oct 19, 2022
PatriceJiang pushed a commit to PatriceJiang/engine that referenced this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants