mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 07:22:43 +02:00
better fix for model scale floor, remove abs
This commit is contained in:
parent
307867a91f
commit
7558b00467
2 changed files with 5 additions and 5 deletions
|
@ -473,13 +473,13 @@ bool OBJReader::parseOBJGroup(OBJTokenizer& tokenizer, const QVariantHash& mappi
|
|||
if (part < 0) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
parts[i].setNum(vertices.size() - abs(part) + 1);
|
||||
parts[i].setNum(vertices.size() + part + 1);
|
||||
break;
|
||||
case 1:
|
||||
parts[i].setNum(textureUVs.size() - abs(part) + 1);
|
||||
parts[i].setNum(textureUVs.size() + part + 1);
|
||||
break;
|
||||
case 2:
|
||||
parts[i].setNum(normals.size() - abs(part) + 1);
|
||||
parts[i].setNum(normals.size() + part + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "shared/JSONHelpers.h"
|
||||
|
||||
void Transform::evalRotationScale(Quat& rotation, Vec3& scale, const Mat3& rotationScaleMatrix) {
|
||||
const float ACCURACY_THREASHOLD = 0.000001f;
|
||||
const float ACCURACY_THREASHOLD = 0.00001f;
|
||||
|
||||
// Following technique taken from:
|
||||
// http://callumhay.blogspot.com/2010/10/decomposing-affine-transforms.html
|
||||
|
@ -49,7 +49,7 @@ 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 = glm::max(Vec3(ACCURACY_THREASHOLD), Vec3(scaleMat[0][0], scaleMat[1][1], scaleMat[2][2]));
|
||||
scale = Vec3(scaleMat[0][0], scaleMat[1][1], scaleMat[2][2]);
|
||||
|
||||
// Let's work on a local matrix containing rotation only
|
||||
Mat3 matRot(
|
||||
|
|
Loading…
Reference in a new issue