questions regarding suitability of newton dynamics

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: questions regarding suitability of newton dynamics

Postby Julio Jerez » Wed Jul 05, 2017 1:28 pm

Listener aren't nothing special. but once you start using them they become very useful for organizing the system.

Imagine you have a main loop that does several things. Camera, physics, AI, game logic, car manager, Character manager and so on.
some of those subsystem have dependency's,
these sub system may already be implemented by some the party, and so on.

here is where listener become useful, the you can create a listener for each one of those sub systems and you add then to the engine in the order of the dependencies that you want.

each listen have two callbacks, a pre listener update which is called after the force and torque call back, and a post listener update which is called after the physic updated integrate all active bodies.
they are always called in the same order.

in these call back the application can interate over all newton objects at will, here you see already a difference with the forces callback which does not allow the application to determine if some other object was already updated or not.

I know is sound like much about nothing, but once you are using the listener they become a very, very important part of the system.

Imagine a character system in which you would like to iterate over each of the body parts to determine some setting that will depend on the state of some other body part. for example say you want to control the setting of the pelvis based of the hand holding some objects or something like that.

I am not saying any application can do that on his on but Listener provide the proper method to do using the engine. Look at the camera or the ragdoll there are very basic listeners, so that you can understand.

also there another benefic, you can parallelize the system, say you have a the same character system, the listener allows for each player to be run in one worker thread.
that's how the vehicle manager is set up.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: questions regarding suitability of newton dynamics

Postby JoeJ » Wed Jul 05, 2017 4:01 pm

Thanks, makes sense.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 14 guests

cron