struct Vector3D {
double x, y, z;
Vector3D () {}
Vector3D (double x, double y, double z) {
this->x = x; this->y = y; this->z = z;
}
Vector3D (const SmallVector3D& v);
...........
friend Vector3D divide (const Vector3D& p1, const Vector3D& p2) {
return Vector3D (p1.x / p2.x, p1.y / p2.y, p1.z / p2.z);
}
class BucketTable3D {
protected:
int _nGrids [ 3 ];
Vector3D _min, _max;
Vector3D _gridWidth;
public:
int* nGrids() { return _nGrids; }
virtual void indicesAt ( const Vector3D& position, int& x, int& y, int& z )
{
Vector3D n = ::divide ( position - _min, _gridWidth );
x = (int) n.x; y = (int) n.y; z = (int) n.z;
........
}
struct Vector3D {
double x, y, z;
Vector3D () {}
Vector3D (double x, double y, double z) {
this->x = x; this->y = y; this->z = z;
}
Vector3D (const SmallVector3D& v);
...........
friend Vector3D divide (const Vector3D& p1, const Vector3D& p2) {
return Vector3D (p1.x / p2.x, p1.y / p2.y, p1.z / p2.z);
}
class BucketTable3D {
protected:
int _nGrids [ 3 ];
Vector3D _min, _max;
Vector3D _gridWidth;
public:
int* nGrids() { return _nGrids; }
virtual void indicesAt ( const Vector3D& position, int& x, int& y, int& z )
{
Vector3D n = ::divide ( position - _min, _gridWidth );
x = (int) n.x; y = (int) n.y; z = (int) n.z;
........
}
To copy to clipboard, switch view to plain text mode
Thanks for your kindly help!
Bookmarks