PingPong is a simple application which extrapolates the Pong physics model to a multi-body physical simulation. The application is an example of a 'service-oriented GUI' where the GUI is simply a rendering surface for an application composed of NetKernel hosted services. This application is a full Java Swing application - it is not an applet.
If you see the GUI occasionally judder this is due to a JVM garbage collection cycle kicking in. The NetKernel distribution hasn't been optimised for GUI responsiveness. To see better behaviour please edit the startup scripts in [install]/bin/ and add the JVM flag -Xincgc which significantly reduced GC induced delays.
The application uses a 'GUI Transport'. This consists of a rendering surface for the application GUI and a NetKernel Request Issuer through which Swing GUI events are issued into the NetKernel URI service address space to invoke services for computing and dynamically modifying the physics model. The resultant computed model is returned through the transport to the Swing GUI where it is rendered.
The GUI runs at 50fps (processor dependent). Each frame is computed as the result of a number of NetKernel URI addressed service invocations. The application was conceived to demonstrate the high-performance and stability of the NetKernel microkernel - it also presents an example of a 'service-oriented GUI' design pattern.
We hope this application broadens the pespective on NetKernel. NetKernel is a general purpose symetric client/server peer. You can think of this particular application's architecture as a client 'browser' with pluggable rendering surface...
Try the preset examples or modify the model parameters and watch the instantaneous changes to the model.
| BALL_COUNT | The number of particles in the system |
| DAMPING | The frictional force slowing particles down. |
| GRAVITY | A force attracting particals downard to the floor. |
| INITIAL_SPREAD | Number of pixels over which to randomly scatter the particles at start |
| INITIAL_VELOCITY | Maximum magnitude of randomized velocity at start. |
| INITIAL_VELOCITY_RADIANS | Angular direction of initial velocity (0=outward, 0.25 = clockwise, 0.5 = outward, 0.75=anti-clockwise) |
| INTERACTION_RANGE | Separation distance at which particle-particle interaction begins. |
| ATTRACTION | Strength of the particle-particle attraction field |
| REPULSION | Strength of the short-range particle-particle repulsion field |
| BALL_BALL_RESTITUTION | Energy absorbtion factor in short-range particle-particle repulsion field - when set high produces 'nuclear fission' |
The physics model does not protect against non-linear modes. If you push the model too far it can go chaotic - for example, sometimes the Wigner Solid (a solid consisting purely of strongly repulsive inter-particle forces) goes non-linear. In this case either change the model or do a reset.