Example #1
0
/// set the bounding box values
void SphereVolume::calcBB() {
    bb.clear();
    GLVertex maxpt = GLVertex(center.x + radius, center.y + radius, center.z + radius);
    GLVertex minpt = GLVertex(center.x - radius, center.y - radius, center.z - radius);
    bb.addPoint( maxpt );
    bb.addPoint( minpt );
}
Example #2
0
// FIXME??
void RectVolume::calcBB() {
    bb.clear();
    GLVertex maxp;
    GLVertex minp;
    double bignum = 1e6;
    maxp = GLVertex(bignum,bignum,bignum);
    minp = GLVertex( -bignum,-bignum,-bignum);
    bb.addPoint( maxp  );
    bb.addPoint( minp );
}
Example #3
0
 GLVertex  operator*(const double &a) const {
     return GLVertex(*this) *= a;
 }
Example #4
0
 GLVertex cross(const GLVertex &p) const {
     GLfloat xc = y * p.z - z * p.y;
     GLfloat yc = z * p.x - x * p.z;
     GLfloat zc = x * p.y - y * p.x;
     return GLVertex(xc, yc, zc);
 }
Example #5
0
 const GLVertex operator-( const GLVertex &p) const {
     return GLVertex(*this) -= p;
 }
Example #6
0
 const GLVertex operator+( const GLVertex &p) const {
     return GLVertex(*this) += p;
 }
Example #7
0
RectVolume::RectVolume() {
    corner = GLVertex(0,0,0); 
    v1 = GLVertex(1,0,0); 
    v2 = GLVertex(0,1,0);
    v3 = GLVertex(0,0,1);
}
Example #8
0
/// sphere at center
SphereVolume::SphereVolume() {
    center = GLVertex(0,0,0);
    radius = 1.0;
    calcBB();
}
Example #9
0
/// modify given vertex
void GLData::modifyVertex( unsigned int id, float x, float y, float z, float r, float g, float b, float nx, float ny, float nz) {
    GLVertex p = GLVertex(x,y,z,r,g,b,nx,ny,nz);
    vertexArray[workIndex][id] = p;
}
Example #10
0
/// add a vertex with given position and color, return its index
unsigned int GLData::addVertex(float x, float y, float z, float r, float g, float b) {
    return addVertex( GLVertex(x,y,z,r,g,b), NULL );
}
Example #11
0
//              minx       maxx        miny       maxy       minz       maxz
Bbox::Bbox(double b1, double b2, double b3, double b4, double b5, double b6) {
    minpt = GLVertex(b1,b3,b5);
    maxpt = GLVertex(b2,b4,b6);
    initialized = true;
}
Example #12
0
Bbox::Bbox() {
    minpt = GLVertex(0,0,0);
    maxpt = GLVertex(0,0,0);
    initialized = false;
}