I have a question regarding Physics Objects. I have scenario where there are a bunch of physics objects on the screen, the objects are circles. These objects are divided into two layers. So when I have 100 circles, 50 are in the bottom layer and 50 are in the top layer. Through this I have created a depth effect. Meaning the objects in most bottom layer have blurring and are smaller. The two layers do NOT interact with each other, collisions only happen with the same objects in the same layer.
So here is the kicker. I want the objects to switch layers, so the circles go up and down randomly. This I have done with no problem, the problem lies within the fact that when objects from the bottom move up the upmost layer when it under or partly under an object on the upmost layer, you have jumping movements. The physics objects have to make room for a new object that appear out of no where.
The question is, how do I prevent this jumping movement? I want the topmost objects make room for the new object by moving away from the new object smoothly.
Don't what which of the dozen 3d libs you are using, but as an abstraction: keep all your circles in the same layer in the view, but in the code, put them in 2 separate arrays. when you switch states you perform loops on the two arrays like "all circles in this array go top and de-blur" and "all circles in his array go bottom and blur". You should learn MVC pattern to better structure your project(s). You wouldn't believe the amount of headaches you avoid with it. Pure MVC is a bit outdated but its nice. You might find a 3D MVC implementation but I doubt it adds anything to the basics.