//#####################################################################
// Copyright 2004-2009, Ronald Fedkiw, Geoffrey Irving, Nipun Kwatra, Michael Lentine, Andrew Selle, Tamar Shinar, Eftychios Sifakis, Joseph Teran.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Class DEFORMABLE_PARTICLES
//#####################################################################
#ifndef __DEFORMABLE_PARTICLES__
#define __DEFORMABLE_PARTICLES__

#include <Core/Arrays/ARRAY.h>
#include <Core/Geometry_Particles/GEOMETRY_PARTICLES.h>
#include <Core/Particles/PARTICLES.h>
#include <cfloat>

namespace PhysBAM{

template<class TV> class SOFT_BINDINGS; 

template<class TV>
class DEFORMABLE_PARTICLES:public GEOMETRY_PARTICLES<TV> // X, V
{
    typedef typename TV::SCALAR T;
    typedef GEOMETRY_PARTICLES<TV> BASE;
public:
    using BASE::X;using BASE::V;using BASE::Remove_Array;using BASE::Get_Attribute_Index;using BASE::Remove_Array_Using_Index;

    ARRAY_VIEW<T> mass;
    ARRAY_VIEW<T> one_over_mass;
    ARRAY_VIEW<T> effective_mass;
    ARRAY_VIEW<T> one_over_effective_mass;
    bool store_mass;

    DEFORMABLE_PARTICLES();
    DEFORMABLE_PARTICLES(const DEFORMABLE_PARTICLES&);
    virtual ~DEFORMABLE_PARTICLES();

//#####################################################################
    void Store_Mass(bool store=true);
//#####################################################################
};
}
#endif
