#include "title.hpp"

title::title()
{
    _arwing = loadShell("../data/arwing.shell");
    _titre = loadShell("../data/Titre.shell");
    _cam.setRadius(10);

    _posCam = point(0,0,4);
    _posObj = point(0,0,0);
    _posTitre = point(0,-0.8,0);

    _rotObjX = 0.01;
    _rotObjY = 0.01;
    _rotObjZ = 0;
}

void title::update()
{
    _cam.moveTo(_posCam);

    _arwing.add(_posObj);
    _arwing.rotX(_rotObjX);
    _arwing.rotY(_rotObjY);
    _arwing.rotZ(_rotObjX);

    _titre.add(_posTitre);

    _cam.addShell(_arwing);
    _cam.addShell(_titre);

    _posObj = point(0,0,0);
    _posTitre = point(0,0,0);
}

void title::rotationObjX(float r=0)
{
    _rotObjX = r;
}

void title::rotationObjY(float r=0)
{
    _rotObjY = r;
}

void title::rotationObjZ(float r=0)
{
    _rotObjZ = r;
}

void title::setPosCam(const point& p)
{
    _posCam = p;
}

void title::setPosObj(const point& p)
{
    _posObj = p;
}

void title::setPosTitre(const point& p)
{
    _posTitre = p;
}

//bool title::thereIsLineToDraw()
//{
//    return !_cam.bufferEmpty();
//}
//
//const camera::draw title::nextLineToDraw()
//{
//    camera::draw tmp = _cam.currentLine();
//    _cam.unmountBuffer();
//    return tmp;
//}
