≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
prototype.onAnimate = function(node, timeMs) Question
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b]hadoken[/b] wrote: When scripting my custom behaviors for CopperCube I would like to ask a fundamental question about: [code]behavior_my_behavior.prototype.onAnimate = function(Node, timeMs)[/code] under [url]https://www.ambiera.com/coppercube/doc/cnt_create_jscript_behavior.html[/url] it says: [quote]"timeMs: The current time of the scene in milliseconds. We use this to be able to smoothly move the cube: Every time, we store the current time we were called, so we can calculate the time difference between this and the last call, and move the scene node accordingly. But of course, there is no need to do this. If you prefer, you can also simply ignore this and create a frame dependent behavior".[/quote] The second .onAnimate param, in my case called [b]timeMs[/b] gives me a nice counter to work with. What is timeMs then really referring to: simply the counted cycles of my behavior script (increasing faster on newer hardware, slower on older) or does it display truly elapsed milliseconds regardless of the users hardware speed thus kind of delta independent (I guess so from the docs half sentence "a frame dependent behavior", but maybe my understanding about it might be wrong)? I don't have two different powerful computers at hand to test the issue out at the moment. So, if a [b]print("timeMs = " + timeMs); [/b] would give me a frame independent counter that would be perfect for my purpose. Thanks for any clarifying information.[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact