void cube::initialize(const vect3f p, float w) { _width = w; _bottom_left = p; _front.initialize(p+vect3f(0.0, 0.0, _width), _width, FRONT); _right.initialize(p+vect3f(_width, 0.0, 0.0), _width, RIGHT); _back.initialize(p, _width, BACK); _left.initialize(p+vect3f(0.0, 0.0, 0.0), _width, LEFT); _top.initialize(p+vect3f(0.0, _width, 0.0), _width, TOP); _bottom.initialize(p+vect3f(0.0, 0.0, 0.0), _width, BOTTOM); }
void cube::side::initialize(const vect3f& b_left, float width, FACE s) { face = s; bottom_left = b_left; switch(face) { case FRONT: case BACK: { bottom_right = bottom_left + vect3f(width, 0.0, 0.0); top_right = bottom_left + vect3f(width, width, 0.0); top_left = bottom_left + vect3f(0.0, width, 0.0); } break; case RIGHT: case LEFT: { bottom_right = bottom_left + vect3f(0.0, 0.0, width); top_right = bottom_left + vect3f(0.0, width, width); top_left = bottom_left + vect3f(0.0, width, 0.0); } break; case TOP: case BOTTOM: { bottom_right = bottom_left + vect3f(width, 0.0, 0.0); top_right = bottom_left + vect3f(width, 0.0, width); top_left = bottom_left + vect3f(0.0, 0.0, width); } break; default: {} break; } }
vect3f AnimationCameraGL::currentCenterCoordinat() const { if (_currentIndex < 0) return vect3f(); return _listPoints.at(_currentIndex).x1y1z1(); }
vect3f AnimationCameraGL::currentEyeCoordinat() const { if (_currentIndex < 0) return vect3f(); return _listPoints.at(_currentIndex).xyz(); }