fixed save camera bug

git-svn-id: svn://db.shs.com.ru/libs@609 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
2019-10-08 16:03:45 +00:00
parent c9640cf425
commit e2c07ef485

View File

@@ -529,6 +529,7 @@ QDataStream & operator >>(QDataStream & s, GLObjectBase *& p) {
int ccnt = 0;
Light * l = nullptr;
Camera * c = nullptr;
QVector3D cam_angles;
//qDebug() << "read obj ...";
while (!cs.atEnd()) {
switch (cs.read()) {
@@ -554,7 +555,13 @@ QDataStream & operator >>(QDataStream & s, GLObjectBase *& p) {
case 9: if (p) p->render_mode = (GLObjectBase::RenderMode)cs.getData<int>(); break;
case 10: if (p) p->material_ = cs.getData<Material>(); break;
case 11: if (p) p->pos_ = cs.getData<QVector3D>(); break;
case 12: if (p) p->angles_ = cs.getData<QVector3D>(); break;
case 12:
if (p) p->angles_ = cs.getData<QVector3D>();
if (c) {
c->setAngles(cs.getData<QVector3D>());
cam_angles = c->angles();
}
break;
case 13: if (p) p->scale_ = cs.getData<QVector3D>(); break;
case 14: if (p) p->mat_ = cs.getData<QMatrix4x4>(); break;
case 15: if (p) p->vbo = cs.getData<GLVBO>(); break;
@@ -581,6 +588,7 @@ QDataStream & operator >>(QDataStream & s, GLObjectBase *& p) {
case 207: if (c) c->mirror_y = cs.getData<bool>(); break;
}
}
if (c) c->setAngles(cam_angles);
//qDebug() << p->name() << ccnt;
for (int i = 0; i < ccnt; ++i) {
GLObjectBase * c = nullptr;