Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I felt this was so important I'm putting this here in this thread as an announcement - especially as it relates to multiple posts here. DONT use the basic 'deltaTime' in your programming when you need smooth flowing graphics to adjust for slowed framerate. At full speed the numbers come out at alternating 15 & 16 every 2nd frame...in other words its not constant nor accurate enough to use per frame with almost 7% change on every frame - it causes jittering animations. I was using 'smnmhmdy' excellent FPS controller but had issues with jittering character movement when matching it to the camera rotation no matter what I did - the 'deltaTime' was the culprit and removing it totally solved my issues. Now is butter smooth like a pro.. If you want to use delta-time somehow then do an average based over at least 3 cycles and use that instead. |
||||
|
The problem mainly lies in using the 'Time' from : "prototype.onAnimate = function(node, Time) {" if you instead recode it like this will make it much better: this.Time = new Date().getTime(); this.deltaTime = this.Time - this.lastTime; this.lastTime = this.Time; |
||||
|
@Robo shouldn't it be timeMs instead of Time? |
||||
|
@Robo This is a modified version of a behavior I found on the forums. It doesn't alternate 15 to 16 every other frame, but it still does so every so often. /* |
||||
|
No it doesnt have to be called 'timeMs' - like most variables in CC can be called a lot of things. So long as you are using the lookup "new Date().getTime();" each frame will be pretty good then only with occasional change will be seen which is acceptable I guess. |
||||
|
Thanks a lot for sharing this info, this explains a lot of my problems with the slight but annoying jitteriness of some of my projects, glad you discovered the issue and even found a solution for it! |
||||
|
This is so useful thanks for sharing @Robo 😇 |
||||
|
cheers guys...glad to help. |
|