I have a JAVA core
This one instantiate pre-made abstractions and store references and all infos from them at init time (basically when I'm creating or removing or modifying objects, and when it has to store/load presets)
The bunch of objects almost lives itself and is able to trigger their own events like sound triggering etc.
I have a question.
All those objects have parameters
JAVA core, in order NOT to be the bottleneck wouldn't be the things calculating, for instance, distances between the camera & all my ob3D objects as soon as a movement is occuring.
Because I need that each object is able to know the distance between the camera and itself in order to be autonomous to trigger an event (here a music notes), how would you do that thing ??
1/ distributed calculation
Of course, the basic idea would be to put a distance calculator in each object.
2/ centralized calculation + maxi propagation
The second idea, is obviously to trigger the calculation inside the JAVA Core one time (but VERY often, as soon as a movement occurs), and to propagate ALL distances at time calculation TO EACH object.
Indeed, in the first case, no need to propagate, the JAVA Core only needs to know about initial position (knowing some objects are moving, but the new positions is only important for sounds calculations)
What would you advice to me, you gurus ??