Strategies around instantiating visual objects from Java code ?
HI there,
Intuitively, I'd like to do that:
- design a global Java piece of code instantiating the whole world global stuff.
- design small java piece of code, each one instantiating 1 visual object
The global one would contain array of objects.
It would take care of all properties of all objects instantiated currently.
In a second step, I'll have the current object instantiated and positionned in the 3D world stored in XML preset (probably) ; then, at the launch time, the global stuff would load the preset, then instantiate the required small java stuff in order to display them.
The idea would be to have all objects made on a same structure ; probably:
- properties
- setup / update / draw / playSound like methods (considering draw would be unuseful because an object instantiated is drawn til it is hidden/removed or...)
That way, the global stuff would instantiate all, would be also able to instantiate stuff at runtime (pushing back objects in global arrays), then at each turn (master clock involved probably), all method would be invoked for each objects...
Any strategies to implement this ?
Would it make sense ?
(This question is about a larger thread I opened around my project : https://cycling74.com/forums/some-question-about-3d-worlds-with-jitter-for-the-hugest-project-of-my-life - putting that here for reference purpose)