I am not going to use geometry shader,
for now I will just use instancing for displaying the particles. and I will render them as small spheres.
later after all the physics is working, I will try the marching cube for visualization, but that will by optional, maybe a function BuildMesh or something like that.
this is how the interface looks so far.
- Code: Select all
class ndBodyParticleSet: public ndBody
{
public:
D_NEWTON_API ndBodyParticleSet();
D_NEWTON_API ndBodyParticleSet(const nd::TiXmlNode* const xmlNode, const dTree<const ndShape*, dUnsigned32>& shapesCache);
D_NEWTON_API virtual ~ndBodyParticleSet ();
D_NEWTON_API virtual ndBodyParticleSet* GetAsBodyParticleSet();
D_NEWTON_API virtual void Save(nd::TiXmlElement* const rootNode, const char* const assetPath, dInt32 nodeid, const dTree<dUnsigned32, const ndShape*>& shapesCache) const;
const dArray<dVector>& GetPositions() const ;
D_NEWTON_API virtual void AddParticle(const dFloat32 mass, const dVector& position, const dVector& velocity) = 0;
you can see function const dArray<dVector>& GetPositions() const ;
that will be the set of particle that makes the fluid, and will be the minimal interface.
then teh othe funtion will be BuildMesh that create a mesh of point and normals using some surface reconstruction algorithm,
this is the base class for all particle effects, we will have springs for cloth, the fluids and probably the position base dynamics for soft bodies. and that will complete the set of particle effect for 4.00