// init camera rotation settings void CRaycaster::initCamRot() { cam_old_dx = cam_old_dy = 0.0f; cam_dy = 0.0f; cam_dx = 0.0f; // ak su nacitane data tak prisposobime vzdialenost kamery podla nich if (data.data!=NULL) cam_old_vz = cam_vz = odmocnina(mocnina(data.x)+mocnina(data.y)+mocnina(data.z)); else cam_old_vz = cam_vz = 1800.0f; setCam(); // nastavime kameru + svetlo na poziciu kamery }
/** * @brief Sestaveni celeho okna kalkulaci a pozicovani objektu */ MainWindow::MainWindow(QWidget *parent) : /* nize je napozicovany kazdy jednotlivy objekt kalkulacky, a take spusteni signalu */ QMainWindow(parent) { this->setWindowTitle("Kalkulačka Vořežpruti"); lcd = new QLCDNumber(10, this); lcd -> setGeometry(QRect(QPoint(50,50), QSize(200, 50))); clear_button = new QPushButton("C",this); clear_button -> setGeometry(QRect(QPoint(200,300), QSize(50,50))); connect(clear_button, SIGNAL(released()), this, SLOT(clear())); napoveda_button = new QPushButton("?", this); napoveda_button -> setGeometry(QRect(QPoint(125,400), QSize(50,50))); connect(napoveda_button, SIGNAL(released()), this, SLOT(napoveda())); rovno_button = new QPushButton("=", this); rovno_button -> setGeometry(QRect(QPoint(50,350), QSize(200,50))); connect(rovno_button, SIGNAL(released()), this, SLOT(rovno())); scitani_button = new QPushButton("+", this); scitani_button -> setGeometry(QRect(QPoint(50,100), QSize(50,50))); connect(scitani_button, SIGNAL(released()), this, SLOT(scitani())); nasobeni_button = new QPushButton("x", this); nasobeni_button -> setGeometry(QRect(QPoint(150,100), QSize(50,50))); connect(nasobeni_button, SIGNAL(released()), this, SLOT(nasobeni())); deleni_button = new QPushButton("/", this); deleni_button -> setGeometry(QRect(QPoint(200,100), QSize(50,50))); connect(deleni_button, SIGNAL(released()), this, SLOT(deleni())); odcitani_button = new QPushButton("-", this); odcitani_button -> setGeometry(QRect(QPoint(100,100), QSize(50,50))); connect(odcitani_button, SIGNAL(released()), this, SLOT(odcitani())); nula_button = new QPushButton("0", this); nula_button -> setGeometry(QRect(QPoint(50,300), QSize(50,50))); connect(nula_button, SIGNAL(released()), this, SLOT(nula())); jedna_button = new QPushButton("1", this); jedna_button -> setGeometry(QRect(QPoint(50,250), QSize(50,50))); connect(jedna_button, SIGNAL(released()), this, SLOT(jedna())); dva_button = new QPushButton("2", this); dva_button -> setGeometry(QRect(QPoint(100,250), QSize(50,50))); connect(dva_button, SIGNAL(released()), this, SLOT(dva())); tri_button = new QPushButton("3", this); tri_button -> setGeometry(QRect(QPoint(150,250), QSize(50,50))); connect(tri_button, SIGNAL(released()), this, SLOT(tri())); ctyri_button = new QPushButton("4", this); ctyri_button -> setGeometry(QRect(QPoint(50,200), QSize(50,50))); connect(ctyri_button, SIGNAL(released()), this, SLOT(ctyri())); pet_button = new QPushButton("5", this); pet_button -> setGeometry(QRect(QPoint(100,200), QSize(50,50))); connect(pet_button, SIGNAL(released()), this, SLOT(pet())); sest_button = new QPushButton("6", this); sest_button -> setGeometry(QRect(QPoint(150,200), QSize(50,50))); connect(sest_button, SIGNAL(released()), this, SLOT(sest())); sedm_button = new QPushButton("7", this); sedm_button -> setGeometry(QRect(QPoint(50,150), QSize(50,50))); connect(sedm_button, SIGNAL(released()), this, SLOT(sedm())); osm_button = new QPushButton("8", this); osm_button -> setGeometry(QRect(QPoint(100,150), QSize(50,50))); connect(osm_button, SIGNAL(released()), this, SLOT(osm())); devet_button = new QPushButton("9", this); devet_button -> setGeometry(QRect(QPoint(150,150), QSize(50,50))); connect(devet_button, SIGNAL(released()), this, SLOT(devet())); tecka_button = new QPushButton(".", this); tecka_button -> setGeometry(QRect(QPoint(100,300), QSize(50,50))); connect(tecka_button, SIGNAL(released()), this, SLOT(tecka())); faktorial_button = new QPushButton("!", this); faktorial_button -> setGeometry(QRect(QPoint(200,150), QSize(50,50))); connect(faktorial_button, SIGNAL(released()), this, SLOT(faktorial())); mocnina_button = new QPushButton("^", this); mocnina_button -> setGeometry(QRect(QPoint(200,200), QSize(50,50))); connect(mocnina_button, SIGNAL(released()), this, SLOT(mocnina())); odmocnina_button = new QPushButton("sqrt", this); odmocnina_button -> setGeometry(QRect(QPoint(200,250), QSize(50,50))); connect(odmocnina_button, SIGNAL(released()), this, SLOT(odmocnina())); negate_button = new QPushButton("+/-", this); negate_button -> setGeometry(QRect(QPoint(150,300), QSize(50,50))); connect(negate_button, SIGNAL(released()), this, SLOT(negate())); }