We are now coming up to a few places where we need particle systems, be that simple ones where we can do the calculation on the CPU, or more complex ones (e.g. fluids via SPH) where some of the calculation is done in a separate library or another process. Through previous experiences we also know of requirements to these particles systems.
- Should be able to implement different algorithms (e.g. free particles vs. SPH fluids)
- Should be able to delegate work to a separate library (e.g. use PhysX or CUDA implementation)
- Need to collide with our physics objects
- Need different types of emitters, these should work with all kinds of system
- We want a uniform type of particle that can be processed by the rest of the system (e.g. visualizing the system)
For now we are excluding the capability of the particle exerting forces onto our physical objects.
One idea would be to implement a separate ParticleSystemsManager (PSM) running in a separate thread, its representations would be the particle systems that are in the scene. Each type of system being a different representation. This isolates the running of the particle systems from the physics manager, but it would still require coupling the two together so one single collision representation is used.
The PSM could also collect all collision representations that get added to the system to use for its collision tests. The processing in the PSM would be similar to the Physics Manager,
- FreeMotion
- CollisionDetection
- CollisionRepsonse
The FreeMotion step would differ between the different particle system implementations. For the classic particle system we can very likely even use our current ODEEquation and Solver architecture. The CollisionDetection can be based on the sphere shape and all the other DCD classes to detect interpenetration. The collision response would again depend on the type of particle system as the underlying structures might have to be modified depending on the result of collision detection.
How does that sound ?
Harry
--
Harald Scheirich
Principal Software Engineer
Simquest Solutions Inc.