templated SimpleVoxelWithNormal class to ScalarType

This commit is contained in:
Nico Pietroni 2015-09-14 12:03:47 +00:00
parent 0371a3c5be
commit bb5288bcc0
1 changed files with 8 additions and 6 deletions

View File

@ -124,16 +124,18 @@ public:
vcg::Point3<ScalarType> &N() { static Point3<ScalarType> _p(0,0,0); return _p;}
};
template <class _ScalarType=float>
class SimpleVoxelWithNormal
{
private:
float _v;
vcg::Point3f _n;
_ScalarType _v;
vcg::Point3<_ScalarType> _n;
public:
float &V() {return _v;}
float V() const {return _v;}
vcg::Point3f &N() {return _n;}
vcg::Point3f N() const {return _n;}
typedef _ScalarType ScalarType;
ScalarType &V() {return _v;}
ScalarType V() const {return _v;}
vcg::Point3<ScalarType> &N() {return _n;}
vcg::Point3<ScalarType> N() const {return _n;}
static bool HasNormal() {return true;}
};