Giter Club home page Giter Club logo

Comments (7)

imsenyu avatar imsenyu commented on May 22, 2024

one solution is to fix incorrect modification of this.time when passedTime < 0.0. but the inner processing logic is not such robust that maybe other triggers/conditions can lead to same error.

from dragonbonesjs.

imsenyu avatar imsenyu commented on May 22, 2024

for example:

// tick 1
this.time === 1000;
Date.now === 1100;
passedTime got 100;
this.time += 100;
this.time === 1100;

// change system time from 1100 to 900

// tick 2
this.time === 1100;
Date.now === 900;
passedTime got -200;
this.time -= -200;
this.time === 1300;

// tick 3
this.time === 1300;
Date.now === 901;
passedTime got -399;
this.time -= -399;
this.time === 1699;

// tick 4
this.time === 1699;
Date.now === 902;
passedTime got -796;
this.time -= -796;
this.time === 2495;

// tick N
this.time boom to Infinity
passedTime boom to -Infinity

from dragonbonesjs.

imsenyu avatar imsenyu commented on May 22, 2024

I also found the same mistake exists in the implemention of CSharp and Java, but I have not debug into the inner processing logic and I am not sure whether it will lead to infinite loop.

csharp

java

but it is ok in the implemention of CPP...(it does not use this.time to calculate the time difference automatically although this.time is wrong )

from dragonbonesjs.

imsenyu avatar imsenyu commented on May 22, 2024

thanks to @qingyangmoke 's commit fix/modifytime_2018_01_28

he fix same error when timeScale not equal to 1.0

here is PR commit 001c609

from dragonbonesjs.

akdcl avatar akdcl commented on May 22, 2024

clock 内部的系统时间不应该是一个递减的值,我们期望时间应该始终向前流动,所以才尝试修正负向的流逝时间,但是完全没有考虑到因此可能带来的问题,感谢提供的例子信息,我们会尝试让这个地方的逻辑更合理 :)

from dragonbonesjs.

imsenyu avatar imsenyu commented on May 22, 2024

回复及时啊:)

烦请关注/推动对应同事关注JavaCSharpCPP以及其他语言的对应实现问题,虽然其中CPP实现没导致坏掉。

from dragonbonesjs.

akdcl avatar akdcl commented on May 22, 2024

一定会将其他语言的逻辑也都统一的,请放心:)

from dragonbonesjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.