add index-to-box conversion
This commit is contained in:
parent
d0ad7cbacc
commit
a7c15f807d
vcg/space/index
|
@ -153,6 +153,21 @@ public:
|
||||||
p += bbox.min;
|
p += bbox.min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Given a cell index return the corresponding box
|
||||||
|
* @param integer coordinates pi of the cell
|
||||||
|
* @return b is the corresponding box in <ScalarType> coordinates
|
||||||
|
*/
|
||||||
|
inline void IPiToBox(const Point3i & pi, Box3x & b ) const
|
||||||
|
{
|
||||||
|
CoordType p;
|
||||||
|
p[0] = ((ScalarType)pi[0])*voxel[0];
|
||||||
|
p[1] = ((ScalarType)pi[1])*voxel[1];
|
||||||
|
p[2] = ((ScalarType)pi[2])*voxel[2];
|
||||||
|
p += bbox.min;
|
||||||
|
b.min = p;
|
||||||
|
b.max = (p + voxel);
|
||||||
|
}
|
||||||
|
|
||||||
// Same of above but for the case that you just want to transform
|
// Same of above but for the case that you just want to transform
|
||||||
// from a space to the other.
|
// from a space to the other.
|
||||||
inline void IPfToPf(const CoordType & pi, CoordType &p ) const
|
inline void IPfToPf(const CoordType & pi, CoordType &p ) const
|
||||||
|
|
Loading…
Reference in New Issue