ref #110 Fixing method recalculate - change matrix angel.

This commit is contained in:
IgorekLoschinin 2021-10-06 22:34:28 +03:00
parent 9465c0358b
commit 5674d686cf
2 changed files with 10 additions and 10 deletions

View File

@ -58,21 +58,21 @@ const QVector3D GroupObject::reCalcPos(const QVector3D& pos, const QVector3D &eu
float beta = eulerAngles[1];
float gamma = eulerAngles[2];
float x = pos[0];
float y = pos[1];
float z = pos[2];
float x = pos.x();
float y = pos.y();
float z = pos.z();
float newX = x*(qCos(alha)*qCos(beta)) +
y*(qCos(alha)*qSin(beta)*qSin(gamma) - qSin(alha)*qCos(gamma)) +
float newX = x*(qCos(beta)*qCos(gamma)) +
y*(qCos(gamma)*qSin(alha)*qSin(beta) - qSin(gamma)*qCos(alha)) +
z*(qCos(alha)*qSin(beta)*qCos(gamma) + qSin(alha)*qSin(gamma));
float newY = x*(qSin(alha)*qCos(beta)) +
float newY = x*(qSin(gamma)*qCos(beta)) +
y*(qSin(alha)*qSin(beta)*qSin(gamma) + qCos(alha)*qCos(gamma)) +
z*(qSin(alha)*qSin(beta)*qCos(gamma) - qCos(alha)*qSin(gamma));
z*(qSin(gamma)*qSin(beta)*qCos(alha) - qCos(gamma)*qSin(gamma));
float newZ = x*(-qSin(beta)) +
y*(qCos(beta)*qSin(gamma)) +
z*(qCos(beta)*qCos(gamma));
y*(qCos(beta)*qSin(alha)) +
z*(qCos(alha)*qCos(beta));
return QVector3D({newX, newY, newZ});
}

View File

@ -13,7 +13,7 @@ namespace AbstractLvl {
GroupObstacleRed::GroupObstacleRed(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
QQuaternion rotation =
QQuaternion::fromEulerAngles(QVector3D(0,0,60));
QQuaternion::fromEulerAngles(QVector3D(0,0,-90));
setDistance(7);
setRotation(rotation);