mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 21:35:45 +02:00
Fix syntax that doesn't compile on linux and used smart glm::max instruction
This commit is contained in:
parent
c0496fd466
commit
b6c004c431
2 changed files with 4 additions and 6 deletions
libraries/shared/src
|
@ -43,12 +43,8 @@ void Transform::evalRotationScale(Quat& rotation, Vec3& scale, const Mat3& rotat
|
|||
// extract scale of the matrix as the length of each axis
|
||||
Mat3 scaleMat = glm::inverse(rotationMat) * rotationScaleMatrix;
|
||||
|
||||
scale = Vec3(scaleMat[0][0], scaleMat[1][1], scaleMat[2][2]);
|
||||
if (scale.x < ACCURACY_THREASHOLD) scale.x = ACCURACY_THREASHOLD;
|
||||
if (scale.y < ACCURACY_THREASHOLD) scale.y = ACCURACY_THREASHOLD;
|
||||
if (scale.z < ACCURACY_THREASHOLD) scale.z = ACCURACY_THREASHOLD;
|
||||
scale = glm::max(Vec3(ACCURACY_THREASHOLD), Vec3(scaleMat[0][0], scaleMat[1][1], scaleMat[2][2]));
|
||||
|
||||
|
||||
// Let's work on a local matrix containing rotation only
|
||||
Mat3 matRot(
|
||||
rotationScaleMatrix[0] / scale.x,
|
||||
|
|
|
@ -277,7 +277,9 @@ inline Transform::Mat4& Transform::getMatrix(Transform::Mat4& result) const {
|
|||
}
|
||||
|
||||
inline Transform::Mat4& Transform::getInverseMatrix(Transform::Mat4& result) const {
|
||||
return evalInverse(Transform()).getMatrix(result);
|
||||
Transform inverse;
|
||||
evalInverse(inverse);
|
||||
return inverse.getMatrix(result);
|
||||
}
|
||||
|
||||
inline void Transform::evalFromRawMatrix(const Mat4& matrix) {
|
||||
|
|
Loading…
Reference in a new issue