randomkeyhits Posted January 12, 2015 Share Posted January 12, 2015 This is a query more than anything. As I read the documentation both Script:UpdateWorld() and Script:UpdatePhysics() are both initiated by a single call to World::Update(). In fact the physics is a child of world and is always(?) invoked. So it appears that the separation is more a conceptual one rather than a functional one. The only reason I can think of is by putting all physics in UpdatePhysics then if (I'm not sure) that is invoked first you would know that all physics updates have been applied before you do any other world level checks/logic. So is that it or am I missing something important? I'm feeling rather dense today. Quote content over form, game play over all. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2015 Share Posted January 12, 2015 UpdateWorld() is called as fast as the PC runs where UpdatePhysics() is called at a constant rate (promises to run x times per second) from what I remember. Which I think would mean if you have a slow PC then UpdatePhysics() might be called multiple times per cycle to catch up. Quote Link to comment Share on other sites More sharing options...
randomkeyhits Posted January 12, 2015 Author Share Posted January 12, 2015 That makes sense and I can measure easily enough too, Thanks. Quote content over form, game play over all. Link to comment Share on other sites More sharing options...
Roberto14 Posted October 25, 2016 Share Posted October 25, 2016 Hi all, so i can resume in: UpdateWorldHook is called as fast as the PC UpdatePhysicsHook is called at a constant rate ( promises to run x times per second ) In my case i see always UpdatePhysicsHook called two times and UpdateWorldHook only one times per cycle... At this point is better to put heavy operations in UpdateWorldHook, and leave UpdatePhysicsHook calls all physics function calls with their respective variables?!? Quote I'm not english, so please sorry for my grammatical errors I'm using Leadwerks and can programm in C++ and LUA Link to comment Share on other sites More sharing options...
Thirsty Panther Posted October 25, 2016 Share Posted October 25, 2016 Josh explains Physics V world here. http://www.leadwerks.com/werkspace/topic/15058-updateworld-vs-updatephysics/page__hl__update%20physics#entry101738 Quote Link to comment Share on other sites More sharing options...
Rick Posted October 26, 2016 Share Posted October 26, 2016 Yeah, UpdatePhysics might be called more than once per cycle or not at all per cycle. My understanding is it tries to keep the constant 60fps rate no matter how it has to do that. UpdateWorld just runs once every cycle/loop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.